C2S – GTM – Templates
Discover the most-read articles
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.
Install the Affilae Click Tag
Add the Affilae template
- Log in to Google Tag Manager.
- Go to Templates, then Search in Gallery.
- Search for Affilae and add Affilae – Click Tag.
Create the click tag
- Go to Tags, then New.
- Name your tag.
- In Tag Configuration, select Affilae – Click Tag.
- Fill in the Affilae Program ID field.
- In Triggering, select All Pages.
- Save and publish.
In Google Tag Manager, a tag blocked when the page loads is not fired again when the visitor accepts: add a Custom Event trigger on the event your CMP sends on acceptance (for instance cookie_consent_update with Cookiebot or OneTrustGroupsUpdated with OneTrust), and set its firing options to Once per page.
Install the Conversion Tag
Create the conversion variables
- Go to Variables, then New.
- Choose the type data layer variable, the one available in your dataLayer.
- Create one variable per conversion data point.
- dl_conversion_id: unique order number.
- dl_conversion_amount: sales amount excluding tax, after discounts and without shipping costs.
- dl_conversion_currency: currency (EUR, USD, etc.).
Create the trigger
- Go to Triggers, then New.
- Name it Purchase.
- Choose the type Custom Event.
- Configure it for your confirmation page.
Add the conversion template
- Go to Templates, then Search in Gallery.
- Add Affilae – Conversion Tag.
Create the conversion tag
- Go to Tags, then New.
- Name it Affilae – Conversion.
- Fill in the fields with your variables.
- In Trigger, select the trigger you created above, for example purchase.
- 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}} |
The template also offers optional fields, grouped under Optional Values: Conversion Sub ID (a free reference of your choice), Conversion Payment, Customer ID, Voucher Code(s) and Product ID(s). They match the conversion tag parameters described in C2S – Manual.
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.
Finalize and test
- Publish your tags.
- Test the tracking of clicks and conversions.
Keep your templates up to date
Our tags are updated from time to time. Every new version published in the gallery appears as a notification on the template, inside your container.
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
- Affilae tracking fundamentals
- Testing click and conversion tracking
- Frequently asked questions, technical integration
- All available integrations
Frequently asked questions
In Affilae, open Configuration, tab Tracking, then the Integration via an Affilae plugin panel. It displays your Program ID, your Rule ID and your Key with a copy button; your Currency is shown next to them.
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 from time to time. Notifications on the template, inside the Templates section of your container, tell you about every new version to apply.
Not if your program is set to Redirect: the templates work with both the Parameter and Redirect formats. The format is set in Configuration, section Global settings, field URL format. On Server-to-Server, follow the S2S – GTM documentation instead.
