Update: I've published the extension on the Chrome Web Store, you can find it here.
Over the course of the weekend I had to generate some Amazon affiliate link to post on this blog, the problem is the links generated by Amazon own tool are too long.
For example the link to this item is 397 characters long.
So how did I solve this problem?
As you can guess from this post's title I wrote my own Chrome extension, you can find it on GitHub.
Installing and using the extension
The extension is not available on the Chrome Web Store(at the moment, things may change), to install it you have to:
- Download the zip from GitHub and unzip it
- Go to the Windows > Extensions page in Chrome
- Check Developer Mode
- Click load unpacked extension and select the extension's folder
- Click options and enter your tracking ID and hit save
Now visit any item page on Amazon.com, you should see an orange icon in the address bar, click it and copy the text in the field.
The generated link is way shorter than the Amazon's generated affiliate link, only 50 characters!
How it works
As you can see if you inspect the DOM, the form on the right has a hidden field with value equal to the item's code.
Also an affiliate url on amazon.com has this structure
http://amazon.com/dp/ + ASIN-CODE + /?tag=YOUR-CODE
When you have all the data getting the solution is easy 🙂