Discourse Affiliate Plugin

The official Discourse Affiliate plugin can help you monetize your Discourse forum. When users create links and other users click through those links and buy products from Amazon, they earn referral fees.

List of countries where the Amazon Associates program is operational

Amazon.co.uk Associates Program
http://associates.amazon.co.uk/gp/associates/join/main.html

Amazon.de Associates Program
http://partnernet.amazon.de/gp/associates/join/main.html

Amazon.fr Associates Program
http://partenaires.amazon.fr/gp/associates/join/main.html

Amazon.it Associates Program
https://programma-affiliazione.amazon.it/

Amazon.ca Associates Program
http://associates.amazon.ca/gp/associates/join/

Amazon.co.jp Associates Program
http://affiliate.amazon.co.jp/gp/associates/join/main.html

Amazon.es Associates Program
https://afiliados.amazon.es/

Amazon.in Associates Program
https://affiliate-program.amazon.in/gp/associates/apply/main.html

Amazon.br Associates Program
https://associados.amazon.com.br/

Amazon.com.mx Associates Program
https://afiliados.amazon.com.mx/

Amazon.cn Associates Program
https://associates.amazon.cn/join

Sign up and read more about the Amazon Associates program here: https://affiliate-program.amazon.com/
This plugin also has support for the French site ldlc.com: Affiliation Groupe LDLC

Installation

Follow the instructions at Install a Plugin using https://github.com/discourse/discourse-affiliate.git as the repository URL. After that, head over to /admin/plugins and enable the Discourse Affiliate plugin.

How it works

This plugin strips out all referral links in posts and replaces them with your Amazon Associates ID or ldlc.com Affiliate ID.

If you set the Site Setting affiliate amazon com to say sams-shop, when people link ANYTHING from amazon.com the plugin will auto append tag=sams-shop and strip out all the existing referral links.

So for example:
https://www.amazon.com/Dragon-Quest-Echoes-Elusive-Age-PlayStation/dp/B07BP3J6RG/ref=br_asw_pdt-5?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=&pf_rd_r=XFGPRSG0SVD5K3RKX5T3&pf_rd_t=36701&pf_rd_p=f8585743-c043-4665-80a7-0cc5fe97d596&pf_rd_i=desktop&th=1

Would be auto converted to:

https://www.amazon.com/Dragon-Quest-Echoes-Elusive-Age-PlayStation/dp/B07BP3J6RG/ref=br_asw_pdt-5?tag=sams-shop

Site Settings

affiliate enabled: Enable the Affiliate plugin.
If you change this, you must rebake all posts with: rake posts:rebake.

affiliate amazon ca: Your amazon.ca (Canada) Associates ID. The links will be transformed only for all amazon.com links using the value entered here.
affiliate amazon com: Your amazon.com (United States) Associates ID. The links will be transformed only for all amazon.ca links using the value entered here.

You will see many more settings such as affiliate amazon co jp, affiliate amazon com au, enter your Associate ID depending on which country’s program you have registered for.
.
.
.
affiliate ldlc com: Your ldlc.com Affiliate ID (without the #). The links will be transformed only for all ldlc.com links using the value entered here.

Run Tests

Run bundle exec rake plugin:spec["discourse-affiliate"]

15 Likes

If you are just concerned about Amazon, it’s also worth considering just the Theme Component option I outline here because it leverages Amazon’s OneLink system which automatically redirects users to their local Amazon site.

5 Likes

Any chance we will see implementation of eBay?

That would be a great addition!

it would be nice to also integrate banggood.com

@rishabh Do I need to rebake the posts after installing the plugin and filling out my affiliate ID’s?

I have installed affiliate plugin for testing purpose, but currently I am not using this plugin.

Can anyone help me, how to uninstall discourse affiliate plugin and remove all there cache files from servers? @rishabh

When posting an Amazon search result link, the plugin strips out the search part of the url and links to the Amazon home page instead. Example:

Search Amazon for teddy bear and the url will be this:
https://www.amazon.com/s?k=teddy+bear&ref=nb_sb_noss_1

The posted link is oneboxed like this:

But the link is actually this:
https://www.amazon.com/s?tag=mytag-20

And that only goes to the Amazon home page.

Any way to avoid this?

1 Like