Discourse Affiliate

:discourse2: Summary Discourse Affiliate Allows the creation of Amazon affiliate links, and can help you monetize your Discourse forum. When users create links and other users click through those links and buy products from Amazon (or another supported affiliate), they earn referral fees.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-affiliate
:open_book: Install Guide How to install plugins in Discourse


List of countries where the Amazon Associates program is operational

Amazon.co.uk Associates Program
Amazon Sign In

Amazon.de Associates Program

Amazon.fr Associates Program
Connexion Amazon

Amazon.it Associates Program

Amazon.ca Associates Program
Amazon Sign In

Amazon.co.jp Associates Program

Amazon.es Associates Program

Amazon.in Associates Program

Amazon.br Associates Program

Amazon.com.mx Associates Program

Amazon.cn Associates Program
δΊšι©¬ι€Š 登录

Sign up and read more about the Amazon Associates program at https://affiliate-program.amazon.com/


This plugin strips out all referral links in posts and replaces them with your Amazon Associates ID or other supported affiliate ID.

:mega: This change will only affect new and future posts. To have the change affect all existing posts, you will need to do a full post rebake once you set your 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:


Will be auto converted to:


Site Settings

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

  • 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, affiliate amazon ca, enter your Associate ID depending on which country programs you have registered for.

Run Tests

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





Has anyone noticed this plugin has stopped working on 3.2.0.beta2-dev (790f6b1121)? :thinking:

If people post a link to a product on amazon.co.uk the link gets replaced in Discourse with a amzn.eu link and when you click through to it, no affiliate tag is added on the end.

eg: https://www.amazon.co.uk/dp/B0B518TW5T gets replaced to https://amzn.eu/d/fbVlE7c and when you click through to it, there’s no affiliate tag on the end.