C2S – GTM – Manual
Discover the most-read articles
Notes:
- Your program URL format must be set as a parameter.
- You can change the URL format by going to your programme settings and then editing the general settings.
- The affiliate tag for your website is different for each programme.
- The Affilae tag must be added to every page on your site, including the confirmation page.
- ⚠️ Do not send any personal data: examples include surname, first name or email address.
- Check your CSP configuration
CSP configuration (server-side):
"default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://static.affilae.dev4.kaizen-developments.com/; img-src 'self' https://static.affilae.dev4.kaizen-developments.com/ https://lb.affilae.dev4.kaizen-developments.com/; frame-src 'self' https://lb.affilae.dev4.kaizen-developments.com/; connect-src https://lb.affilae.dev4.kaizen-developments.com/"
Installation of GTM
Follow Google’s official documentation to install and configure the GTM container: support.google.com/gtm
Adding the Affiliate tag (click tag)
- Log in to your GTM account and go to Workspace ➜ Tags.
- Click New to create a tag.
- Settings:
- Name: e.g. Affilae – Click Tag
- Tag configuration: select Custom HTML.
- Code: copy and paste your Affilae script, available in your programme under the Tracking tab ➜ Custom Integration ➜ Track Clicks.
- ⚠️ Important: update the _ae variable with your programme ID (e.g. 5f03acf00000000000000000).
- Trigger: select ‘All pages’.
- Save and publish.

Conversion tracking tag
Create the dataLayer variables
For each conversion data point, create a variable
Conversion ID
- Variables ➜ New
- Name: dl_conversion_id
- Type: Data layer variable
- Variable name: dl_conversion_id (depending on your data layer)
- Version: 2
Amount excluding VAT
- Variables ➜ New
- Name: dl_conversion_amount
- Type: Data layer variable
- Variable name: dl_conversion_amount (depending on your data layer)
- Version: 2
Additional variables (if necessary)
Repeat for: customer, payment, voucher, etc.
Create the trigger
- Triggers ➜ New
- Name: purchase
- Type: Usually ‘Purchase’ or ‘Custom Event’
- Configuration: depending on your conversion event
- Save
Create the conversion tag
- Tags ➜ New
- Name it
- Type: Custom HTML
Download the script
- In Affilae: Settings ➜ Tracking ➜ Custom integration ➜ ‘Track conversions’
- Copy the script
- Configure the variables: replace the values with your GTM variables.
- Trigger: Select ‘purchase’
- Save and publish
Multiple programmes
If you have multiple Affilae programmes:
- Create a new conversion tag for each programme (using different keys)
- Reuse existing variables and triggers where appropriate
- Test each programme individually



For example: The name of the data layer variable must be: ecommerce.purchase.actionField.id (the path must be complete).
Testing and validation
Before you start
GTM Preview Mode:
- Enable Preview Mode ➜ add a tracked link
- Test a complete user journey (click ➜ conversion)
- Check that the tags are firing
DataLayer variables:
- Check that your variables are retrieving the correct values
- Test with live data
In Affilae:
- Check that clicks are being reported
- Check that conversions are being reported
- Check the amounts and data
Help
Is the tracking not working?
- Untracked clicks: check the Program_ID
- Missing conversions: check the dataLayer variables and the KEY.
- Empty variables: check the variable names in your dataLayer.
Support
- Follow these step-by-step instructions
- Contact Affilae support with details of your settings.