Admitad Template for Google Tag Manager provides easy-driven integration with Admitad.
This template tracks users’ actions on your website and sends the data to the Admitad statistics.
When the template fires, the Admitad server receives a request with the information on this action (order ID, order amount, etc.).
For more on the Admitad tracking code, see here.
Admitad Template for Google Tag Manager consists of two mandatory parts:
Both templates should be installed and configured as described in the corresponding manual.
Otherwise, the high quality of tracking is not guaranteed
.
-
Download the
template.tpl
file -
Create a new tag template in the Templates menu
-
Import the
template.tpl
file
Admitad Journey template should fire on every page of your site.
Configure your tracking template in accordance with your dataLayer variables.
Fill in all mandatory fields, otherwise, the high quality of tracking is not guaranteed
.
See below an example for Google Tag Manager variables and a template configured for dataLayer.
Example of the dataLayer code (real code on your site may differ):
// SHA-256 hash of the current user's email '[email protected]'
// we strongly recommend using the standard SHA hashing
let hashed_customer_id = '73062D872926C2A556F17B36F50E328DDF9BFF9D403939BD14B6C3B7F5A33FC2';
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'transactionCustomer': hashed_customer_id, // set 'transactionCustomer': '' if the customer ID is undefined on the page
'suid': ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) {return (c ^ (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)})
});
Code annotations:
suid
— UUID4 identifierhashed_customer_id
— a hashed ID of a user in your system (email, login, etc.). Westrongly recommend
using the standard SHA hashing
You can configure the dataLayer variables in the Variables menu.
Mapping of dataLayer keys and GTM variables:
'transactionCustomer' -> {{accountId}}
'suid' -> {{suid}}
Please note that the real value of your campaign_code
will be sent during integration.
See an example of the configured template below.