POST
Amazon Affiliate Marketing
Author: Alan Richardson
Some notes on the Amazon Influencer Programme, OneLinks and combining both of these features together, with a tool to help.
Amazon have recently opened up their Amazon Influencer programme to more people.
I assume everyone, since I managed to qualify.
What is it?
The Amazon Influencer Programme allows you to extend your Amazon Affiliate usage to include a ‘page’ on Amazon.
The Amazon Influencer ‘shop’ is built by:
- login to the affiliate account
- add items to the “Influencer” wish list
- they automatically appear on your influencer page
Great.
A really simple way to extend your Amazon affiliate usage.
What about OneLinks?
The affiliate shop is not a OneLink shop, i.e. it is Amazon.com exclusive.
OneLinks are a way of having a single product link, which can be used to redirect people to the relevant Amazon store e.g. if I click on a OneLink from the UK then I am directed to the product on Amazon.co.uk, if I am from the US then Amazon.com
This is a great way to extend your affiliate sales across multiple regions.
All it takes is the usual amazon link e.g.
http://www.amazon.com/exec/obidos/ASIN/014312417X/compendiumdev-20
And JavaScript on the page, supplied by Amazon ‘magically’ converts these links into region redirects.
How can I use both?
I wanted to have the best of both worlds, but I didn’t want to maintain a list twice.
I’m sure there is a proper way of accessing a list through JavaScript in an API, but I went for the shortcut.
I created some code that if I run from the console, when on the Amazon Influencer Page, will output to the console the HTML that I need to add to my web site.
e.g. This recommended reading list page on EvilTester.com is generated from the Amazon Influencer Page, but the one on EvilTester.com is a set of OneLinks.
If you want the code I used then it is below:
var images = document.querySelectorAll("[id^=image_]"), i,m;
var amazonAffiliateId = "compendiumdev-20";
var outputText = "";
for (i = 0; i < images.length; i++) {
var regex = /image_(.*)/gi;
var imgElementHTML = images[i].innerHTML;
m = regex.exec(images[i].getAttribute("id"));
var textspan = document.getElementById("item_title_"+m[1]);
var bookLink = "<a HREF=\"http://www.amazon.com/exec/obidos/ASIN/" + amazonasin + "/" + amazonAffiliateId + "\" target=\"_blank\">";;
var textSpanOutput = "<span>"+textspan.innerHTML.trim()+"</span>";
var htmlFromAmazon = bookLink+imgElementHTML+textSpanOutput+"</a>";
var outputTemplate = "<div>"+htmlFromAmazon+"</div>";
outputText+=outputTemplate;
}
console.log(outputText);
If you use it, remember to change the amazonAffiliateId
variable, otherwise I’ll be the affiliate on your sales.
A Bookmarklet
I thought I would make it easier for myself so I converted the above code into a bookmarklet.
Which means that when I’m on my Amazon Influencer Page, I can click the Bookmarklet and the code runs, I look in the JavaScript console and my HTML is generated.
A Bookmarklet Maker
To make it easier for others, I created the Amazon Influencer OneLink Tool
This allows you to:
- click a button and enter your Affiliate ID
- click another button and the Bookmarklet is automatically generated for you
- copy the bookmarklet to your bookmarks and off you go
The code is simple enough that you can probably see how to amend it to add new styling etc. for yourself.
This means I can have:
- the Affiliate Influencer Page which is easy to maintain.
- periodically build and release the OneLink Page with minimal effort
Adding Amazon Affiliate OneLink Links to Blogger
I added some Amazon links to Blogger and thought it would be useful to take advantage of the Amazon OneLink Code.
It looks a bit like this (not this, but similar):
<script src="//amazon-adsystem.com/onejs?MarketPlace=US&adInstanceId=95a3-sdfs-rtyr-6d9"></script>
Unfortunately when you try to add this into the Blogger Theme, it fails the XML validation.
The solution is to change the &
in the src
to an &
i.e.
<script src="//amazon-adsystem.com/onejs?MarketPlace=US&adInstanceId=95a3-sdfs-rtyr-6d9"></script>