Adding Amazon ads for different countries

UPDATE, July 2011: I'm now using the WordPress-Amazon-Associate plugin, so much of what's written below is no longer relevant. WPAA seems to do almost everything in one easy-to-use plugin, so give it a go if you're interested.

Some time ago I started looking into ways to add Amazon products to help monetise a WordPress site. My major requirement was to automatically set my affiliate IDs for a range of different Amazon stores, with products appearing depending on a user's worldwide IP location.

I was working on a site with a potentially global reach (aren't they all?), and didn't want to limit the potential by pushing people towards just one Amazon store. Here's how I did it.

Amazon.com, .co.uk, .de?

Signing up to different Amazon stores gives different affiliate IDs each time. The stores appear to operate independently of one another, and there's no way you can sign up to all in one go. This also means sorting out payment details can be quite laborious.

In the case of amazon.co.jp, I found the sign-up process completely baffling. Although the site has an English-language interface, the associates page used to sign up was in Japanese. I contacted the site and they said there were no plans to offer a translation. Using Google Translate took me so far, but Amazon.co.jp simply wouldn't accept a UK postcode. The rogue field was "Postal Code (Hyphen enter into alphanumeric characters)", and whatever I tried, it rejected my postcode.

Signing up to the others was more straightforward, particularly the English-language ones (.com, .ca and .co.uk). Then it was time to start putting ads on the site, and to target them depending on users' locations.

Targeting users by country

To automatically select an Amazon store that nearest matches your user's location requires the ip2country plugin. However, this doesn't install the IP data you need, frustratingly, and those not comfortable handling mysql databases might come unstuck.

I found a couple of plugins that did, however. World Flags is one - once the database is in place you can uninstall it. Alternatively, try the IP-to-Country plugin, which is different from IP2Country.

There's another, more complicated, plugin that adds this IP-country info, called WordPress IP to Country. I got baffled by the installation process, as I'm not a MySQL expert.

UPDATE 4/2011: I accidentally changes something on my server and the Geo IP stopped working. Still trying to find out what was changed - all suggestions welcome...

Amazon machine tags

With the geo parsing in place, I used another plugin to actually display the Amazon products. It's called Amazon Machine Tags, and it's great.

There are various ways to display these (in an article, in a sidebar etc), detailed on the plugin site, but I used it to add products to articles. This involved a simple shortcode for each one. For example, to display The Beatles' Rubber Soul all I have to do is add this to the text field:

[amtap amazon:asin=B0025KVLT2]

See how this looks on my Rubber Soul article. It's the bit in the "Buy on Amazon" box (I added the container box myself, but the price, picture and everything else is brought in by the plugin).

The bit after asin= is the product code for the CD. These are used right across Amazon, and products normally have the same codes across the different international stores (some don't, though, so look out for this).

With the IP to Country plugin also installed (and it's the only way the plugin will work effectively for international users), it serves up the product from the Amazon store nearest the reader. So, people in the US see the price in US$, and those in England see the same product, only with prices in UKĀ£. If either clicks on the ad it will take them to the correct Amazon site. Brilliant.

The Amazon Machine Tags plugin also allows site owners to set their affiliate information, or to donate unused referral fees to the plugin authors (I'm doing this with my Japanese credits, should I get any). Give it a go - it's been trickling money my way for some time.

Comments are closed.