Affilimate Help Center
Help Center

How to install the Affilimate tracking snippet

Affilimate uses a tiny tracking snippet (also called a "script") to be able to record anytime someone sees or clicks your affiliate links.

The first step in the signup process is installing this snippet, and it must remain installed on your site in order for us to keep tracking your stats!

Here's how to install Affilimate on any blogging platform:

  1. WordPress
  2. Squarespace
  3. Blogger
  4. Wix
  5. Other blogging platforms
  6. Google Tag Manager

Before you start

Be sure to copy your own personal snippet to your clipboard. It will look like this:

<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

You can find this snippet in two ways.

1. The first time you install Affilimate's snippet: When you first create your account, we'll show you this code and ask you to verify your website.

2. Re-installing the snippet: Click the icon in the top navigation bar inside the Affilimate web application.

WordPress

You have several options when it comes to how you install the Affilimate snippet on your WordPress website.

  1. Paste the snippet directly (no plugin), or
  2. Use the "Header and Footer Scripts" plugin, or
  3. Use the Genesis Customizer, or
  4. Use Google Tag Manager

Read on for step-by-step instructions on how to install the Affilimate snippet with each method.

You only need to pick one method for installing your snippet.

NOTE: Many WordPress themes come with a setting that allows you to add code to the header or footer. Be sure to check the documentation for your theme, or email the creator of your theme, if you cannot find such a setting.

Option 1: Paste the snippet directly before the closing body tag </body>

Step 1. Open your WordPress admin and look in the sidebar for "Appearance > Editor"

Step 2. Under the list called "Templates" choose the file "Theme Footer (footer.php)"

Step 3. Paste your Affilimate snippet right before the tag called </body> and then click "Update File"


<?php wp_footer(); ?>

<!-- Below is where your snippet belongs -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

</body>
</html>

Congrats, you've installed Affilimate ๐ŸŽ‰

IMPORTANT: If you install the Affilimate snippet with this technique and then change your theme, you may need to re-install it afterwards because your footer.php file has changed.

Option 2: Header and Footer Scripts plugin

Step 1. Install the Header and Footer scripts plugin by following the installation guide.

Step 2. Activate the "Header and Footer Scripts" plugin through the Plugins menu in WordPress.

Step 3. Paste your Affilimate snippet in the footer section

<!-- Replace the code below with your own snippet -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

Cheers, you've installed Affilimate ๐Ÿฅณ

Option 3: Genesis Customizer

Use the built-in customizer that comes with Genesis to insert the Affilimate snippet.

Step 1. Navigate to "Appearance > Customize > Theme Settings"

Step 2. Click "Header/Footer Scripts"

Step 3. Paste your snippet in the section titled "Footer scripts", and then click "Publish"

<!-- Replace the code below with your own snippet -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

Yahoo, you've installed Affilimate ๐ŸŽŠ

Option 4: Google Tag Manager

Jump down to the section on Google Tag Manager to learn how to install Affilimate with this technique.

Squarespace

You can use Squarespace's code injection feature if you're on a Business or Commerce plan.

Step 1. In the "Home Menu", go to "Settings", then "Advanced", then "Code Injection"

Step 2. Scroll to the section labeled "Footer"

Step 3. Paste your snippet in the box in the "Footer" section, and then save your changes

<!-- Replace the code below with your own snippet -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

Woot, you've installed Affilimate ๐Ÿ’…

Blogger

Step 1. Log in to Blogger and click "Layout" then "Add Gadget" in the section labeled "Footer"

Step 2. Choose the "HTML/Javascript" gadget from the list

Step 3. Paste your snippet in the box labeled "Content" and then the "Save" button

<!-- Replace the code below with your own snippet -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

Bomb-diggity, you've installed Affilimate ๐ŸŽŠ

Wix

You will use Wix's Tracking Tools and Analytics feature.

Step 1. Open your site's dashboard and click "Settings"

Step 2. Click "Tracking & Analytics" under "Advanced Settings" in the left-side navigation

Step 3. On that page, click the button labeled "+ New Tool" and then select "Custom" from the menu

Step 4. Copy your custom code into the box

<!-- Replace the code below with your own snippet -->
<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

Step 5. Choose your domain name and enter a name for the code (you can call it "Affilimate Snippet")

Step 6. Under "Add Code to Pages" choose "Load code on each new page"

Step 7. Under "Place Code in" choose "Body - end"

Step 8. Click "Apply"

Using another blogging platform?

If you're not using one of the mentioned plugins, try googling "custom javascript [your platform's name]".

Then, you will most likely find instructions for adding custom code to your website. You can also either ask your host for help, or send us an email at hi@affilimate.io and we'll try and point you in the right direction!

Google Tag Manager

You'll need to take your original snippet, and copy the value of the attribute data-am-token.

Original snippet:

<script async src="https://snippet.affilimate.io" data-am-token="YOUR_TOKEN_HERE"></script>

And use snippet below instead, but replacing YOUR_TOKEN_HERE with your own unique token, which you copied from the original snippet above.

Google Tag Manager-specific snippet:

<script>
  (function() {
    var el = document.createElement('script');
    el.setAttribute('src', 'https://snippet.affilimate.io');
    el.setAttribute('data-am-token', 'YOUR_TOKEN_HERE');
    el.setAttribute('async', 'async');
    document.body.appendChild(el);
  })();
</script>

You do not need both snippets. Just the second one, shown directly above.

NOTE: The reason you cannot use the normal snippet in Google Tag Manager is because they remove non-standard HTML attributes from all scripts, and the Affilimate snippet relies on your unique token being present in order to verify the website. Hence, a custom snippet for Google Tag Maanger is required.

Having trouble?

Send us an email at hi@affilimate.io and we'll try and point you in the right direction!