Explorar o código

gtag() scope for multiple gtag ua

Amauri CHAMPEAUX %!s(int64=7) %!d(string=hai) anos
pai
achega
bcef457b24
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);
             });