Merge pull request #169 from petitj/master

Gtag variable should be set in global scope for later use
This commit is contained in:
Amauri CHAMPEAUX 2018-07-12 08:34:51 +02:00 committed by GitHub
commit 6051de4fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1073,7 +1073,7 @@ tarteaucitron.services.gtag = {
"use strict"; "use strict";
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () { tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () {
function gtag(){dataLayer.push(arguments);} window.gtag = function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', tarteaucitron.user.gtagUa); gtag('config', tarteaucitron.user.gtagUa);