Google Tag Manager support
This commit is contained in:
parent
bf9c6f5a70
commit
53557e0108
|
|
@ -371,6 +371,28 @@ tarteaucitron.services.googlemaps = {
|
|||
}
|
||||
};
|
||||
|
||||
// google tag manager
|
||||
tarteaucitron.services.googletagmanager = {
|
||||
"key": "googletagmanager",
|
||||
"type": "api",
|
||||
"name": "Google Tag Manager",
|
||||
"uri": "http://www.google.com/ads/preferences/",
|
||||
"needConsent": true,
|
||||
"cookies": ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'],
|
||||
"js": function () {
|
||||
"use strict";
|
||||
if (tarteaucitron.user.googletagmanagerId === undefined) {
|
||||
return;
|
||||
}
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.dataLayer.push({
|
||||
'gtm.start': new Date().getTime(),
|
||||
event: 'gtm.js'
|
||||
});
|
||||
tarteaucitron.addScript('//www.googletagmanager.com/gtm.js?id=' + tarteaucitron.user.googletagmanagerId);
|
||||
}
|
||||
};
|
||||
|
||||
// jsapi
|
||||
tarteaucitron.services.jsapi = {
|
||||
"key": "jsapi",
|
||||
|
|
|
|||
Loading…
Reference in New Issue