Thursday, 29 August 2013

Localising Amazon links

If you look in my left sidebar, under the heading "Buy, Buy, Buy", you'll see something for Amazon that looks like this:
Amazon: (UK | US | BR | CA | DE | ES ... etc
Messy, isn't it? What I need is a way of having just one link to Amazon, but which localizes depending where in the world you are. Something like this, maybe:
Amazon
Now what this should do, if you have JavaScript turned on in your browser, is take you to Amazon UK if you're in the UK, Amazon US if you're in the US, Amazon BR if you're in Brazil... and so on. If you're in a territory that doesn't have it's own Amazon, you'll be defaulted to the US .com site, as that's the one you'd probably use. And if you don't have JavaScript turned on, you'll get taken to the UK site because, let's face it, that's where most of my readers are.

But before I change my sidebar, I need to know whether this works properly. I've written all the code myself but, being in the UK, can only test the UK scenario. What I'm looking for here is help from people in other countries. If you're not in the UK, please could you click the lovely localised link above, then tell me where you're from and where the link took you in the comments section, below. Thanks very much!

EDIT: because this is a Blogger-based site and, by default, renders differently on mobile devices, I've had to change the link slightly - wherever you are in the world, if you're looking at the mobile version of the site then the link above should take you to Amazon UK. Sorry. It's a constraint of where the JavaScript resides...

1 comment:

  1. Thanks to all that tested. I've implemented this in the sidebar now.

    ReplyDelete