Browse Source

gtag() scope for multiple gtag ua

Amauri CHAMPEAUX 7 years ago
parent
commit
bcef457b24
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tarteaucitron.services.js

+ 1 - 1
tarteaucitron.services.js

@@ -2192,7 +2192,7 @@ tarteaucitron.services.multiplegtag = {
         tarteaucitron.user.multiplegtagUa.forEach(function(ua) {
 
             tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + ua, '', function () {
-                function gtag(){dataLayer.push(arguments);}
+                window.gtag = function gtag(){dataLayer.push(arguments);}
                 gtag('js', new Date());
                 gtag('config', ua);
             });