Integration with Shopify.

Get Help

Affilae is an affiliate marketing software, helping marketers growth their online businesses with the right affiliates partnerships.

Create & run your own affiliate marketing program based on multiple commission scheme – today!

 

Setup your Shopify affiliate program with Affilae

 

 

 

 

Well done! You’ve created your new affiliate program. Now you’ve to set up tracking scripts to check if your affiliate sales are taken into account.

To install the tracking scripts for your Shopify affiliate program, follow these steps:
If you are using redirect tracking, go to step 2.

 

Track clicks from your partners

 

This script must be placed on all pages in the<body> tag.

In Shopify, go to the admin and click:

  • ” Online store “ menu
  • Then, on ” Action “ button
  • And on ” Edit HTML / CSS “

Then select the theme.liquid file in the tree and add the following code in the <body> tag.

 

➜ Caution! This script is an example, you must replace PROGRAM_ID by the program_id available in your program “configuration”, “tracking” then “integration with an Affilae plugin”.

<script type="text/javascript">
    var _ae = {
      'pid': 'PROGRAM_ID',
      'advertiserFirst': 43200,
      'host': 'https://lb.affilae.com',
      'forceReferrer': false,
      'skipMouse': false,
      'fp': true,
      'firstParty': true
    };
    (function () {
      var element = document.createElement('script'); element.type = 'text/javascript'; element.async = true;
      element.src = '//static.affilae.com/ae-v3.5.js';
      var scr = document.getElementsByTagName('script')[0]; scr.parentNode.insertBefore(element, scr);
    })();
  </script>

 

Shopify affiliate program click tag

 

 

Track sales

 

Go to Shopify admin and click in:

  • ” Settings “ menu
  • And ” Checkout “

Locate the “Additional content & scripts” field and copy and paste the following code:

 

<!-- AFFILAE BEGIN -->

{% if order.discount_applications.size == 0 %}
    <img src="https://lb.affilae.com/?key=YOUR.KEY&id={{ order_number }}&amount={{ subtotal_price | money_without_currency }}&payment=online&customer={{ customer.id }}&voucher={{ discount.title }}" width="1" height="1" >

{% else %}

    {% for discount in order.discount_applications %}
       <img src="https://lb.affilae.com/?key=YOUR.KEY&id={{ order_number }}&amount={{ subtotal_price | money_without_currency }}&payment=online&customer={{ customer.id }}&voucher={{ discount.title }}" width="1" height="1" >
    {% endfor %}

{% endif %}

<!-- AFFILAE END -->

 

  You only need to replace the value  YOUR.KEY  with the key of the conversion code found in your Affilae account: go to the “configuration” menu, “tracking” and then find your key in the integration with an Affilae pluginpart.

Shopify affiliate program conversion tag

To go further, see Shopify docs.

Now, you have to test a conversion before starting – follow our guideline: Test tracking.

 

Need help? Contact us!