Google Tag Manager implementation – HTML

Modified on Fri, 22 Nov at 2:41 PM

Implémentation via Google Tag Manager – script HTML

 


Note: ⚠️⚠️⚠️

  • The programme must be in parameter.
  • The affiliation tag for your website is different for each programme.
  • The Affilae tag must be added to each page of your site, including the confirmation page.
  • Check your CSP configuration .

"default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://static.affilae.com/; img-src 'self' https://static.affilae.com/ https://lb.affilae.com/; frame-src 'self' https://lb.affilae.com/; connect-src https://lb.affilae.com/"


The purpose of this guide is to help you implement Affilae tracking via Affilae HTML scripts.

1- Installing GTM To install the GTM container on your site, please follow the documentation for configuring and installing Google: support.google.com/gtm

2- Add the Affilae Tag Once GTM is installed, log into your account and navigate to your ‘Workspace’; from there, in the left-hand column, find and click on ‘Tags’.

  • When the page loads, click on ‘New’ to create a new tag, then :
  • Name your tag e.g tag_affilae (if you have existing tags you can follow the nomenclature).
  • Click in the ‘Tag configuration’ table, then in the right-hand menu that appears select ‘Custom HTML’.
  • Copy and paste your Affilae Tag in the HTML field. You will find your script in the configuration of your programme in the ‘ tracking “ tab via the ” custom integration (scripts)’ section. Track clicks’.

The Affilae tag, which must be integrated on all the pages of your website (or landing pages), detects clicks from affiliated websites and protects you against click fraud.

 

 

  • Once the Tag has been installed and the ‘pid “ filled in, click on the ”trigger’table, the menu of predefined triggers will appear and all you have to do is select ‘ All pages’.
  • Save and send your changes.

 

Note: On the label, don't forget to update the _ae variable to match your program ID (for example, 5f03acf00000000000000000).

3- Add the Affilae Conversion Tag

The Conversion Tag must be installed on the event or confirmation page for which you want to track conversions (e.g. sale, contact form...) and must only be triggered after the Affilae click tag.

Before going any further, it's a good idea to understand how user-defined variables work. You can find the GTM documentation here.

The Affilae conversion tag relies on user-defined variables, and these variables will need to be created by you using your site's data layer. Each of the conversion data elements required for the tag to function correctly (event.Conversion.id, event.Conversion.amount...) must have a corresponding user-defined Variable to ensure that the conversion data is sent to Affilae.

 

Variables: From your Workspace in the left-hand column, find and click on ‘ Variables’.

  • Click on ‘ New ’ to create a new variable
  • Name your variable e.g. dl_conversion_id (if you have existing variables, you can follow the nomenclature).
  • Click in the ‘ Variable configuration “ table, then in the right-hand menu that appears, select ” Data layer variable’.
  • In the ‘ Data layer variable name ’ field, enter your value from the data layer of the page on your site where the conversion is taking place**.
  • For ‘ Data layer version “, leave ” Version 2’.
  • Save and go on to create the next variable.

WARNING: When entering the ‘ Data layer variable name’, as explained above, the value entered must correspond to the value found in the data layer.

 

 

Trigger: Once you have created your variables, you will need to create the trigger for your Affilae conversion tag. To do this, from your ‘ Workspace “ in the left-hand column, find and click on ”Triggers’.

When the page loads, click on ‘New ’ to create a new trigger, then :

  • Name your trigger e.g trigger_confirmation_page (if you have existing triggers you can follow the nomenclature).
  • Click in the ‘ Trigger configuration ’ table, then in the right-hand menu that appears select the type of trigger that best suits your needs, generally the trigger is based on a Purchase event.
  • Save and go on to create your Affilae conversion tag.

Conversion tag: From your ‘ Workspace’, in the left-hand column, find and click on ‘Tags ’. in the left-hand column, find and click on ‘ Tags’.

When the page loads, click on ‘ New ’ to create a new tag, then :

  • Name your tag. e.g tag_affilae_conversion (if you have existing tags you can follow the nomenclature).
  • Click in the ‘ Tag configuration “ table and then select ” Custom HTML’ from the menu on the right.
  • Copy and paste your Affilae Conversion Tag into the HTML field, then fill in the variables you have created.

You will find your script in the configuration of your programme in the ‘ tracking “ tab via the ” custom integration (scripts)’ section. Track conversions".


    • Once the tag has been installed and the variables filled in, click on the ‘ trigger’ table, the triggers menu will appear and all you have to do is select the trigger you created in the previous step.
    • Save and submit your changes.
  • Your tracking configuration is now complete. Before launching your Affilae program, check that your configuration is working properly by carrying out test conversions to verify that the tags are triggered correctly, that the variables created are being tracked and that the clicks and conversions are being tracked in the Affilae platform.

    The steps above should be repeated for each Affilae program you create as each program will have a different Program ID, but depending on your Affilae programs, you could potentially reuse certain variables and triggers without having to create new ones.

 

Parameters to be entered :

 

VariableMandatoryValue
keyyesThe key is provided on the "conversion code" page accessible from the "Config" menu of your affiliate program.
e.g. 5f04fe700000000000000000-5f04fe700000000000000000
idyesFill this parameter with a unique identifier, the simplest being the order number.

 

 

If you're using this code to subscribe to your newsletter and you don't have a unique identifier, we advise you to use a Hash (e.g. MD5) from the surfer's e-mail, for example.

amountYes for salesTotal amount of the order, excluding VAT, which will be the basis for calculating the commission and sales generated.
e.g. 123.45
paymentYes if the conversion is linked to a payment

If conversions are subject to payment, specify the method chosen by your customer, otherwise leave blank:

 

 

 

  • online for online payment
  • bankwire for payment by bank transfer
  • other for any other type of payment
customerYes, if Revenue Share is enabledCustomer ID if Revenue Share is enabled. Please use an identifier that will not change over time, the best being the ID number used in your database.

 

 

Leave blank if you don't use Revenue Share.

cvNoCustom variable that will be returned with the conversion, and available in the interface and API. Allows you to assign your own identifier to a conversion.
voucherNoVariable used to identify the promo code associated with a sale. The code is case-sensitive. Use `;` as separator to add multiple codes.
productNoList of product IDs, separator `;`.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article