Google Tag Manager support

This commit is contained in:
Amauri CHAMPEAUX 2015-02-19 02:55:23 +01:00
parent bf9c6f5a70
commit 53557e0108
1 changed files with 22 additions and 0 deletions

View File

@ -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",