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.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

List of countries where the Amazon Associates program is operational

Amazon.co.uk Associates Program
Amazon Sign In

Amazon.de Associates Program
Amazon Anmelden

Amazon.fr Associates Program
Connexion Amazon

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

Amazon.ca Associates Program
Amazon Sign In

Amazon.co.jp Associates Program
アソシエイト・セントラル

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

Amazon.in Associates Program
Amazon Sign In

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 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 @david 2025-07-22T13:13:11Z

Check documentPerform check on document:
35 Me gusta

¿Es posible agregar soporte para enlaces amzn.eu a esto? :thinking:

Por ejemplo:

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

Actualmente redirige a:

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

Debería convertirse en algo como:

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

2 Me gusta

Recientemente instalé este plugin en nuestro sitio y funciona muy bien para las nuevas publicaciones, pero ejecutar el comando rake posts:rebake no hizo que las publicaciones históricas tuvieran sus enlaces de Amazon actualizados. ¿Hay algún error común que mi equipo pueda estar cometiendo? Lo que me parece extraño es que la salida que recibió después de ejecutar el comando menciona un plugin diferente:

El nombre del plugin es 'GroupInvitation', pero el directorio del plugin se llama 'group-invitation'
Volviendo a hornear el markdown de la publicación para 'default'
414610 / 414610 (100.0%)e
¡414610 publicaciones hechas!

Gracias por cualquier orientación adicional que pueda ofrecer.

1 me gusta

Hola, ¿lograste que esto funcionara?

Estoy recibiendo un error de que about.json no existe o no es válido al intentar instalar.

¿Cómo intentas instalar?

Normalmente, ese error se muestra cuando intentas instalar un Plugin como si instalaras un Theme o un Theme component. ¿Seguiste las instrucciones de la guía de instalación enlazada en el primer post?

1 me gusta

Lo siento, ¡mi error! Gracias

2 Me gusta

Hola, estoy usando el plugin Discourse Affiliate y tengo Amazon OneLink habilitado para mi ID de afiliado XXXXXX-20. Dado que OneLink redirige automáticamente a los usuarios a sus tiendas locales de Amazon, ¿debo ingresar mi ID de afiliado solo para affiliate amazon com (EE. UU.), o necesito agregarlo por separado para cada país?

¡Gracias por tu ayuda!

Más información sobre OneLink
:backhand_index_pointing_down::backhand_index_pointing_down::backhand_index_pointing_down:
https://affiliate-program.amazon.com/resource-center/onelink-launch

:partying_face: Este plugin ahora está incluido en el núcleo de Discourse como parte de Bundling more popular plugins with Discourse core. Si te autoalojas y usas el plugin, necesitas eliminarlo de tu app.yml antes de tu próxima actualización.

1 me gusta

¿Podemos añadir esto en las reglas del procesador?

rules["amzn.in"] = create_amazon_rule("in") if postfix == "in"