# Amazon link rewriting for affiliate codes

**URL:** https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174
**Category:** Feature
**Created:** [January 24, 2014, 5:40pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174 "2014-01-24T17:40:26Z")
**Posts on this page:** 15
**Page:** 3

<div class="post-metadata">

### Author: ![anon36484860](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon36484860](https://meta.discourse.org/u/anon36484860)
#### Post date: [June 24, 2015, 8:14am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/42 "2015-06-24T08:14:44Z")

</div>

Hey people

want to dig up this thread!

@dean Does your plugin still work with latest discourse version?  
@CamilleRoux What is the status of your plugin? Still alpha?

---

<div class="post-metadata">

### Author: ![dean](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@dean](https://meta.discourse.org/u/dean)
#### Post date: [June 24, 2015, 8:31am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/43 "2015-06-24T08:31:27Z")

</div>

I’ve not tried tbh, I’m running a discourse forum now so I’ll have a look when I get 5 minutes. Unless any of the classes have been renamed which it relies on then it should work fine. It doesn’t expand short urls though and never will.

---

<div class="post-metadata">

### Author: ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)
#### Post date: [June 24, 2015, 10:13am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/44 "2015-06-24T10:13:39Z")

</div>

My plugin was working, but it needs now to be converted to ES6 and I don’t know how to do it:  
[https://meta.discourse.org/t/discourse-affiliate-insert-affiliate-code-amazon-automatically-to-links/19585/4](https://meta.discourse.org/t/discourse-affiliate-insert-affiliate-code-amazon-automatically-to-links/19585/4)

Can someone help me on this? thanx :slight_smile:

---

<div class="post-metadata">

### Author: ![Gabe](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@Gabe](https://meta.discourse.org/u/Gabe)
#### Post date: [August 25, 2015, 12:43am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/45 "2015-08-25T00:43:26Z")

</div>

Would it be possible for someone walk through how you’d clone the repository and edit the affililink plugin to change the affiliate code?

Also, is there an easy way to exclude the plugin from rewriting subdomains? I have some posts that point to help files on a subdomain (i.e., [sellercentral.amazon.com](http://sellercentral.amazon.com)) and the plugin breaks those links.

---

<div class="post-metadata">

### Author: ![dean](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@dean](https://meta.discourse.org/u/dean)
#### Post date: [August 25, 2015, 5:30am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/46 "2015-08-25T05:30:09Z")

</div>

No need to clone it, just copy it to the customised css section with the admin site and change the values at the top to reflect your own codes.

---

<div class="post-metadata">

### Author: ![Un3qual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/un3qual/32/116194_2.png) [@Un3qual](https://meta.discourse.org/u/Un3qual)
#### Post date: [September 19, 2015, 11:29pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/47 "2015-09-19T23:29:21Z")

</div>

You could use a service like [viglink](https://www.viglink.com/), or [skimlinks](http://skimlinks.com/)

They both have tens of thousands of merchants and will add links to sites that will pay out more. As far as I know, only [viglink](https://www.viglink.com/) will also add links into text. For example if I type “Samsung Galaxy s5” it will add a link to a site with an affiliate link.

* * *

Disclaimer: I do not work for either of those services.

* * *

This could be nice for Discourse because in the settings you could add your ID, and Discourse could have their own affiliate link to the site from the settings panel for users to sign up. I might make a plugin for this at some point

---

<div class="post-metadata">

### Author: ![geek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geek/32/102154_2.png) [@geek](https://meta.discourse.org/u/geek)
#### Post date: [September 20, 2015, 1:51am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/48 "2015-09-20T01:51:06Z")

</div>

I don’t know if posting your own affiliate link is allowed here but it’s pretty lousy behavior. You should be ashamed of yourself.

---

<div class="post-metadata">

### Author: ![Un3qual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/un3qual/32/116194_2.png) [@Un3qual](https://meta.discourse.org/u/Un3qual)
#### Post date: [September 20, 2015, 2:12am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/49 "2015-09-20T02:12:59Z")

</div>

Removed. No monies for me :pensive:.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 20, 2015, 4:37am UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/50 "2015-09-20T04:37:14Z")

</div>

Don’t sweat it @geek is very sensitive about affiliate links :wink: he has been burned before.

---

<div class="post-metadata">

### Author: ![geek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/geek/32/102154_2.png) [@geek](https://meta.discourse.org/u/geek)
#### Post date: [September 20, 2015, 2:16pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/51 "2015-09-20T14:16:40Z")

</div>

I’m unsubscribing from this topic as I’m too old and grumpy to be involved anymore. :smile:

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [October 19, 2015, 7:00pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/52 "2015-10-19T19:00:24Z")

</div>

I’m happy to announce that we’re developping an official affiliate plugin for :discourse:

> **[GitHub - discourse/discourse-affiliate](https://github.com/discourse/discourse-affiliate)**
>
> Contribute to discourse/discourse-affiliate development by creating an account on GitHub.

It only works for amazon right now but more will come later :wink:

---

<div class="post-metadata">

### Author: ![Vocino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vocino/32/85136_2.png) [@Vocino](https://meta.discourse.org/u/Vocino)
#### Post date: [October 19, 2015, 8:49pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/53 "2015-10-19T20:49:29Z")

</div>

Excellent @zogstrip. Is this cool to add to production now?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [October 19, 2015, 8:57pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/54 "2015-10-19T20:57:51Z")

</div>

> [@Vocino](#):
>
> Is this cool to add to production now?

Of course, there’s not much, but it’s production-ready :wink:

---

<div class="post-metadata">

### Author: ![Vocino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vocino/32/85136_2.png) [@Vocino](https://meta.discourse.org/u/Vocino)
#### Post date: [October 19, 2015, 9:08pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/55 "2015-10-19T21:08:54Z")

</div>

Great! I use a lot of rewriting like this on our forum if you need any feedback.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [March 18, 2016, 2:39pm UTC](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174/56 "2016-03-18T14:39:59Z")

</div>



[Previous page](https://meta.discourse.org/t/amazon-link-rewriting-for-affiliate-codes/12174.md?page=2)
