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
http://associates.amazon.co.uk/gp/associates/join/main.html

Amazon.de Associates Program
Amazon Sign In

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
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 명령을 실행해도 기존 게시물의 아마존 링크가 업데이트되지 않았습니다. 팀에서 흔히 범할 수 있는 실수가 있을까요? 이상한 점은 명령을 실행한 후 받은 출력이 다른 플러그인을 언급한다는 것입니다:

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

추가로 조언해 주실 수 있는 사항이 있다면 알려주시면 감사하겠습니다.

1개의 좋아요

안녕하세요, 이 문제를 해결하셨나요?

설치를 시도할 때 about.json 파일이 존재하지 않거나 유효하지 않다는 오류가 발생합니다.

어떤 방법으로 설치하고 계신가요?

보통 #customization:theme나 #customization:theme-component를 설치하듯 #customization:plugin을 설치하려고 할 때 해당 오류가 표시됩니다. 첫 번째 게시글에 링크된 설치 가이드의 지시를 따르셨나요?

1개의 좋아요

죄송합니다, 제 실수였어요! 감사합니다

2개의 좋아요

안녕하세요, 저는 Discourse Affiliate 플러그인을 사용 중이며, 제휴 ID XXXXXX-20에 대해 Amazon OneLink을 활성화해 두었습니다. OneLink는 사용자가 거주하는 지역의 Amazon 스토어로 자동으로 리다이렉트되므로, 제휴 ID를 affiliate amazon com(미국)에만 입력하면 되는지, 아니면 각 국가별로 별도로 입력해야 하는지 궁금합니다.

도움 주시면 감사하겠습니다!

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 코어에 번들링됩니다. 직접 호스팅(self-hosting)을 수행하고 이 플러그인을 사용하는 경우, 다음 업그레이드 전에 app.yml에서 해당 플러그인을 제거해야 합니다.

1개의 좋아요

프로세서 규칙에 이 내용을 추가할 수 있을까요?

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

토픽 제목에 링크를 직접 입력하면 생성된 링크에 코드가 추가되지 않습니다.

어필리에이트 플러그인에 대해 관심이 있는 몇 가지 사항이 있습니다.

어필리에이트 링크가 포함된 게시물 하단에 알림 문구를 자동으로 삽입하도록 하는 것이 가능할까요? 미국과 캐나다(그리고 다른 많은 국가에서도)에서는 어필리에이트 링크 근처에 눈에 띄는 고지를 의무적으로 표시해야 합니다.

재배키(rebake)가 진행되는 동안, 게시물 하단에 다음과 같은 명확한 메시지를 자동으로 삽입하는 것이 합리적이라고 생각합니다:

이 게시물에는 어필리에이트 링크가 포함되어 있을 수 있으며, 이는 추가 비용 없이 저희 사이트를 지원하는 데 도움이 됩니다.

이렇게 하면 사이트가 현지 법률을 준수할 수 있습니다.

또 다른 고려 사항은 기존 Amazon 어필리에이트 링크를 제거하고 새 버전으로 대체하는 기능을 추가하는 것입니다. Amazon에는 공식 링크 클로커가 많이 있으며, 가장 흔한 것은 amzn.to입니다. amzn.to URL 끝에 태그를 단순히 추가할 수는 없으며, amzn.to 사이트가 이를 제거하고 대체하기 때문입니다.

하지만 Discourse가 리다이렉트를 추적하여 최종 링크에 도달할 수 있는 기능이 있다고 생각합니다. 시스템이 이러한 amzn.to 링크를 찾아 리다이렉트되는 최종 Amazon 제품 링크를 확인한 뒤, 백킹 과정을 거치며 전체 링크를 새 태그가 내장된 직접적인 Amazon 링크로 변경하는 것은 충분히 가능해 보입니다.

결론적으로, 한 사용자가 자신의 어필리에이트 링크가 포함된 여러 기사를 게시한 것을 발견하고, 이제 그들을 찾아 대체하는 방법을 모색하고 있습니다. :areyoukiddingme:

기존 플러그인의 기능을 확장하는 데 기꺼이 도움을 드릴 수 있습니다!

수정:

기능을 테스트하기 위해 개인용 플러그인을 작성했습니다. 이제 의도한 대로 작동합니다. 보시는 것처럼 원래 플러그인(또는 다른什么东西)이 amzn.to URL에 태그를 추가했지만, 실제로는 작동하지 않았습니다.

변경 전:

변경 후:

실제 Amazon 링크로 대체되고, 짧게 된 것이 풀리며 새(하지만 동일한) 어필리에이트 태그가 추가되었습니다.

방금 확인해 보니, 어필리에이트 링크가 있던 사용자의 게시물들은 모두 삭제되고, 사용자를 부유하게 만드는 대신 실제로 사이트를 지원하는 링크로 대체되었습니다.

2개의 좋아요

이 플러그인이 아마존 외에 커스텀 URL에서도 작동할 수 있다면 훨씬 더 가치 있을 것입니다.

대부분의 포럼은 특정 분야(niche)에 집중되어 있으며, 대부분의 분야에서 제휴 마케팅 프로그램을 제공하는 소규모 기업들이 몇 곳 있습니다.

제휴 마케팅에 대한 지식을 도움으로 제공해 드릴 의향이 있지만, 더 이상 코딩을 하지 않습니다.