Explorar o código

Gtag variable should be set in global scope for later use (gtagMore or event calls)

Julien Petit %!s(int64=7) %!d(string=hai) anos
pai
achega
bbd6cc01b9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      tarteaucitron.services.js

+ 1 - 1
tarteaucitron.services.js

@@ -1073,7 +1073,7 @@ tarteaucitron.services.gtag = {
         "use strict";
         window.dataLayer = window.dataLayer || [];
         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('config', tarteaucitron.user.gtagUa);