All Collections
Building Links
Building Links Programatically
JavaScript Snippet (iTunes, Microsoft Store, and Amazon)
JavaScript Snippet (iTunes, Microsoft Store, and Amazon)

Converts raw product URLs on your webpage into globalized and affiliated links. Just install it into the header!

Matt Mustarde avatar
Written by Matt Mustarde
Updated over a week ago

What is the JavaScript Snippet?

The Geniuslink JavaScript snippet solution converts raw and/or affiliate links into buy.geni.us links. This tool is ideal for websites or blogs with many hardcoded affiliate links, or if you simply do not want to update your database.  

(Using WordPress? Check out our Amazon Link Engine and iTunes Link Engine plugins. Or, you can use the plain snippet on your WordPress site.)

The JavaScript snippet should be placed in the head of each page or copied into your header template. Each time the page loads, your links are converted to geni.us links on the fly! It even supports a mix of Amazon,  iTunes, and Microsoft Store affiliate links!

This is a programmatic method for building links. Learn about the the differences between manual and programmatic links here.

Please note: 

  • To confirm the snippet is working, hover over a published Amazon, Google Play, Microsoft Store, or iTunes link on your site, and it will display buy.geni.us as the destination instead of the original iTunes, Google Play, Microsoft Store or Amazon link.

How to use the Javascript Snippet Wizard.

1. Navigate to the Tools tab within your Geniuslink Account.

2. Under Embed Geniuslink in your Website select 

3. Once here, select the Group where you would like the clicks to be recorded.

4. If you're using our Custom Domain feature, select the domain that you would like to use for the Javascript Snippet. (Note: You will need to set up your custom domain with the Geniuslink Service prior to completing this step). 

5. Next, select which type of links you would like to translate.

6. Leave the Preserve existing affiliate settings checkbox UNCHECKED unless you have Amazon links with existing affiliate parameters already on your site, and do NOT want to overwrite them with the Affiliate parameters that you have entered into your Geniuslink Account. 

7. Check the Preserve URLs until click time checkbox if you want your links to remain unconverted when the page loads, and only localize once a user clicks your links.

8. Once you are finished customizing your JavaScript Snippet, simply copy the provided code, and paste it into the header of each page on your website (or into your header template).

9. Once it is placed within the header, all of the Amazon Google Play, Microsoft Store, and/or iTunes links within your website will automatically be converted to buy.geni.us links as soon as the page loads.

Other options: 

 - Preserve/ignore links by adding georiot-ignore="true" to each <a> tag you wish to preserve. More...

Did this answer your question?