Setting up Affiliate Tracking for Any Website

You can assign affiliate links to your creators and track how those links are used with affiliate tracking. With affiliate tracking, you can see how many page views, sales, and commissions your creator’s unique link has generated. This lets you not only easily pay out your creators, but track where your most successful conversions are. 

Different ecommerce stores and websites have different steps for affiliate tracking. If you want to set up affiliate tracking with an ecommerce store instead, check out our other articles on setting up affiliate tracking with Shopify or WooCommerce.

What You'll Need 

  • Access to your website’s HTML. If you use Google Tag manager, you can also include our script through it to be included on every page.


We highly recommend someone on your team with experience in HTML completes this setup. This setup requires scripts to be pasted into specific sections of your website’s HTML to work correctly. If you have any questions, please contact GRIN support.

How to Do It

  1. Log into GRIN
  2. Navigate to Account > Account Settings.


  1. Click on Affiliate Integration. This will open the Affiliate Integration Set Up window.


  1. If you haven’t generated a token yet, click Generate Token. This will generate: 
    • Your token, as well as its created date and a delete button
    • The Installing the Affiliate SDK section 
    • The Tracking Conversions section 


  1. Go to the Installing the Affiliate SDK section.
  2. Click the Copy Install Code button to copy the script. You can also copy it from here: 
    (function () {Grin = window.Grin || (window.Grin = []);var s = document.createElement('script');s.type = 'text/javascript';s.async = true;s.src = '';var x = document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);})();


  1. Navigate to your website’s HTML. 
  2. Paste the code you copied in step 6 into the header or before the closing body on every page of your website.
  3. Go back to GRIN.
  4. Navigate to Account > Account Settings > Affiliate Integration.
  5. Go to the Tracking Conversions section. 
  6. Click the Copy Success Code button to copy the script. You can also copy it from here:
    // set the amount here
    var amount = '100.50';

    // set an order number if it exists
    var order_number = '';

    // send the conversion to Grin
    Grin = window.Grin || (window.Grin = []);Grin.push(['conversion', amount, {order_number: order_number}]);


  1. Paste the script into a text editor and update the amount (the subtotal after discounts and before tax and shipping costs) and order_number values to use the variables used by your website. Your site’s developer will likely be the best resource to help you determine what your variables are.
  2. Copy your script with the updated values.
  3. Navigate to your website’s order success page.
  4. Paste the script you copied in step 14 into your order success page. 


You may need to contact your ecommerce admin for assistance with this step. Please contact GRIN support if you need any additional assistance.

That’s it! Your Shopify account is now set up for affiliate tracking in GRIN. Check out our other articles on creating affiliate link groups and assigning them to your creators to start seeing your creators’ conversions. 

Related Links 



Article is closed for comments.