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 个赞

可以为此添加对 amzn.eu 链接的支持吗?:thinking:

例如:

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

目前重定向到:

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

应该转换为类似以下的内容:

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

2 个赞

我最近在我们网站上安装了这个插件,它对新帖子效果很好,但运行 rake posts:rebake 命令并没有更新历史帖子的亚马逊链接。我的团队是否犯了什么常见的错误?奇怪的是,他运行该命令后收到的输出提到了一个不同的插件:

插件名称是 'GroupInvitation',但插件目录名为 'group-invitation'
正在重新烘焙 'default' 的帖子 markdown
414610 / 414610 (100.0%)e
完成 414610 个帖子!

感谢您提供的任何额外指导。

1 个赞

您好,您设法让它正常工作了吗?

当我尝试安装时,出现“about.json 不存在或无效”错误。

您正尝试如何安装?

通常,当您尝试像安装 #主题#主题组件 那样安装 #插件 时,会显示该错误。您是否遵循了第一个帖子中链接的安装指南中的说明?

1 个赞

抱歉,是我的错!谢谢

2 个赞

您好,我正在使用 Discourse Affiliate 插件,并启用了 Amazon OneLink,我的联盟 ID 是 XXXXXX-20。由于 OneLink 会自动将用户重定向到他们当地的亚马逊商店,我是否只需要为 affiliate amazon com(美国)输入我的联盟 ID,还是需要为每个国家单独添加?

感谢您的帮助!

有关 OneLink 的更多信息
:backhand_index_pointing_down::backhand_index_pointing_down::backhand_index_pointing_down:
https://affiliate-program.amazon.com/resource-center/onelink-launch

:partying_face: 此插件现已作为 Bundling more popular plugins with Discourse core 的一部分,与 Discourse 核心捆绑在一起。如果您是自托管用户并使用了此插件,则需要在下次升级前将其从 app.yml 中删除。

1 个赞

我们可以在处理器规则中添加这个吗?

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