Article

C2S – GTM – Templates

The Affilae templates are two tag templates published in the Google Tag Manager Community Template Gallery. You add them to your container, enter your program ID and your key, and you measure clicks and conversions without writing any code.

This page covers the C2S (client-side) integration through templates. It is the fastest method when your website already runs Google Tag Manager.

Prerequisites: the URL format of your program must be set to Parameter. You change it in Program management > [your program] > Settings, section Global settings, field URL format. You also need a Google Tag Manager container you can publish to, and a dataLayer that exposes order data on your confirmation page.
Warning: never send personal data in your variables, for example a first name, a last name or an email address.

Install the Affilae Click Tag

Add the Affilae template

  1. Log in to Google Tag Manager.
  2. Go to Templates, then Search in Gallery.
  3. Search for Affilae and add Affilae – Click Tag.
Google Tag Manager Community Template Gallery, search for Affilae
The Community Template Gallery lists both Affilae templates, here already marked as added.
Template details for Affilae - Click Tag in Google Tag Manager
The template details panel shows the description, the permissions and the last update date.

Create the click tag

  1. Go to Tags, then New.
  2. Name your tag.
  3. In Tag Configuration, select Affilae – Click Tag.
  4. Enter your Affilae Program_ID.
  5. In Triggering, select All Pages.
  6. Save and publish.
Where to find your Program ID: in Affilae, open Settings > tab Tracking > Integration via an Affilae plugin. The same panel also gives your Key, your Rule ID and your Currency.
Affilae click tag configuration in Google Tag Manager
The click tag configuration, with the Affilae Program ID field and the optional values below it.
All Pages trigger on the Affilae click tag
The finished click tag, fired by the All Pages trigger on every page view.

Install the Conversion Tag

Create the conversion variables

  1. Go to Variables, then New.
  2. Choose the type data layer variable, the one available in your dataLayer.
  3. Create one variable per conversion data point.
  • dl_conversion_id: unique order number.
  • dl_conversion_amount: net sales amount, excluding taxes and shipping.
  • dl_conversion_currency: currency (EUR, USD, etc.).
Warning: the names must exactly match those in your own site dataLayer. The variables listed above are examples.
Data layer variable created in Google Tag Manager
A data layer variable, with its data layer variable name and version 2.

Create the trigger

  1. Go to Triggers, then New.
  2. Name it Purchase.
  3. Choose the type Custom Event.
  4. Configure it for your confirmation page.

Add the conversion template

  1. Go to Templates, then Search in Gallery.
  2. Add Affilae Conversion Tag.

Create the conversion tag

  1. Go to Tags, then New.
  2. Name it Affilae – Conversion.
  3. Fill in the fields with your variables.
  4. In Trigger, select the trigger you created above, for example purchase.
  5. Save and publish.
TAG FIELD WHAT YOU ENTER
Key Your Affilae key.
Conversion ID {{dl_conversion_id}}
Conversion Amount {{dl_conversion_amount}}
Conversion Currency {{dl_conversion_currency}}
Affilae conversion tag configured in Google Tag Manager
The finished conversion tag, with key, Conversion ID, Conversion Amount, Conversion Currency, Voucher Code and the Purchase trigger.

Use the full variable path

The data layer variable name must be the full path, for example ecommerce.purchase.actionField.id. A shortened name returns no value.

Example dataLayer on an order confirmation page
Example dataLayer, where the order ID is nested under ecommerce.purchase.actionField.

Finalize and test

  1. Publish your tags.
  2. Test the tracking of clicks and conversions.

Keep your templates up to date

Our tags are updated regularly. Every new version published in the gallery appears as a notification on the template, inside your container.

Tip: open Templates once a month and apply the updates offered. It is the only maintenance this integration needs, and it prevents you from discovering an outdated tag on a big campaign day.

The other Google Tag Manager integrations

  • C2S – GTM – Manual: you paste the Affilae scripts yourself into Custom HTML tags, without using the gallery.
  • S2S – GTM: the conversion is validated server-side, with two containers talking to each other.

Related articles

Frequently asked
questions

In Affilae, open Settings, tab Tracking, then the Integration via an Affilae plugin panel. It displays your Program ID, your Key, your Rule ID and your Currency, each with a copy button.

First check that both tags are correctly installed and published. Then make sure the variables are correctly mapped, along with your Program_ID and your KEY. Finally, test with a real order. If the problem remains, contact Affilae support with your configuration details.

Your variable names must exactly match those in your site dataLayer. Also mind the full path: the data layer variable name reads for example ecommerce.purchase.actionField.id, not id alone.

No. Never send personal data, for example a first name, a last name or an email address. Stick to the order data needed to calculate the commission.

Yes. Our tags change regularly. Notifications on the template, inside the Templates section of your container, tell you about every new version to apply.

Yes, this integration assumes the Parameter format. Change it in Settings, section Global settings, field URL format. If you would rather stay on Server-to-Server, follow the S2S – GTM documentation instead.

Need help?

Stay up to date with the latest trends in affiliate marketing and never miss any of our articles.

Contact Us