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

Features

List

Amazon.co.uk Associates Program
Amazon.co.uk

Amazon.de Associates Program
Amazon.de

Amazon.fr Associates Program
Amazon.fr

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

Amazon.ca Associates Program
Amazon.ca

Amazon.co.jp Associates Program
γ‚’γ‚½γ‚·γ‚¨γ‚€γƒˆγƒ»γ‚»γƒ³γƒˆγƒ©γƒ«

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
δΊšι©¬ι€Š 登录

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

Configuration

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:

https://www.amazon.com/Dragon-Quest-Echoes-Elusive-Age-PlayStation/dp/B07BP3J6RG/

Will 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 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"]

CHANGELOG

TODO

Extras

Last edited by @JammyDodger 2024-06-18T15:16:54Z

Check documentPerform check on document:
34 Likes

Is it possible to add support for amzn.eu links to this? :thinking:

Eg:

https://amzn.eu/d/4c3852b

Currently redirects to:

https://www.amazon.co.uk/dp/B0CXJ9GM3G?ref_=cm_sw_r_cso_cp_apin_dp_CDAMFS1FPQXBQEWSKWVE&starsLeft=1

It should be converted to something along the lines of:

https://www.amazon.com/dp/B0CXJ9GM3G/?tag=sams-shop

2 Likes

I recently installed this plugin on our site and it works great for new posts, but running the rake posts:rebake command did not cause historical posts to have their Amazon links updated. Is there some common mistake that my team may be making? What I find odd is that the output he received after running the command mentions a different plugin:

Plugin name is 'GroupInvitation', but plugin directory is named 'group-invitation'
Rebaking post markdown for 'default'
414610 / 414610 (100.0%)e
414610 posts done!

Thanks for any additional guidance you can offer.

1 Like

Hi, did you manage to get this working?