Connecting AffilBox to Google Tag Manager (GTM)

Connecting AffilBox to Google Tag Manager (GTM)

This tutorial is a quick and easy way to connect our affiliate software to Google Tag Manager. In most cases, the GTM is linked to the e-shop itself and the deployment method is adapted accordingly.

Warning before deploying tracking to GTM

If you want to ensure the highest accuracy of affiliate tracking (which is implemented via tracking and conversion code – see below), we recommend deploying the codes directly into the site code, not into an external service like Google Tag Manager (or GTM).

Unfortunately, this service, and others like it, are very often blocked by browsers and ad blockers, so in turn our script is blocked as well. And this in turn reduces the number of clicks and conversions that we can track and match.

You don’t have to worry about the stability and security of the site, our codes are by default loaded asynchronously, so they don’t slow down page loading.

It starts with your own subdomain

First, create a subdomain in your e-shop that will serve as your affiliate administration access. This custom subdomain is paired with your AffilBox according to this guide: How to redirect DNS.

Tracking Code

Creating a new tag:

  • Custom html tag
  • Copy code from your pages
  • Set to run on All Pages

Conversion code

Create 2 new user-defined variables

for conversion value: actionField.revenue (Variable type: Data layer variable

Variable name: ecommerce.purchase.actionField.revenue)

For Transaction ID: (Variable Type: Data Layer Variable

Variable name:

Create new tag: Custom HTML tag

Copy the code from your campaign administration – specifically the Conversion Code block.

Change in code:

  • var ab_cena = ‘{{actionField.revenue}’;
  • var ab_id_transakce = ‘{{}’;

Set startup

  • Rule Type: Page view
  • Some page views
  • Page URL is equal (URL with completion obj, for example example

Always test after deployment

Any change in the code and the GTM deployment itself can affect the accuracy and reliability of the measurements, because always test the functionality after deploying the change.

Or take your affiliate link (you can get it on the main page or on the campaign details in AffilBox), and open it in an anonymous browser window.

In the AffilBox interface, in the Statistics -> Conversion Statistics section, you should see click-throughs at a given time.

Next, make a test order in the same anonymous window. When it passes, congratulations, everything is set up correctly. If not, contact our support, they will be happy to help you check your deployment.

Leave a comment

Your email address will not be published. Required information is marked with *