0Localisation of Amazon Affiliates links

I occa­sion­ally ref­er­ence products on my vari­ous web­sites, and usu­ally link them to Amazon for any­one inter­ested in buy­ing them. A long time ago I used to link with an amazon affil­i­ates link but nev­er earned any­thing from it as my typ­ic­al read­er­ship is well dis­trib­uted around the world. Unfor­tu­nately Amazon don’t provide a way to redir­ect vis­it­ors to their loc­al amazon site whilst retain­ing to affil­i­ates pay­ments. There are vari­ous solu­tions out there but all the ones I found had issues with them, so I developed my own.

I could devel­op it into a plu­gin for release if there is suf­fi­cient demand. In the mean­time, the code is below. You will need to make some modi­fic­a­tions to make it match your site address and your amazon affil­i­ates codes

Note — the code is cur­rently early draft.  It works, but it does­n’t make use of some of the detec­tion that it can do.  It does­n’t have a set­tings page for the asso­ci­ate IDs, and it uses a hard­coded site address, rather than an invis­ible redir­ect.  It DOES how­ever use cli­ent-side javas­cript to gen­er­ate a unique redir­ect url every time to pre­vent any cach­ing sys­tems from caus­ing incor­rect loc­a­tion detection.

Got some thoughts of your own? Indulge yourself below by commenting! If you would like to subscribe please use the subscribe link on the menu at the top right. You can also share this with your friends by using the social links below. Cheers.

Leave a Reply