Google analytics: dataLayer.push não está funcionando?
Com base neste tópico:Acompanhamento de eventos usando o Gerenciador de tags do Google
Criei minha própria versão, localizada em p.http://test.site.com
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event':'GAevent',
'eventCategory': 'App4',
'eventAction': 'Click',
'eventLabel': 'iOS4'
});
</script>
</head>
<body>
<!-- Start google tag manager -->
<script>
(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'//www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'primecont', 'GTM-1234');
</script>
<!-- End google tag manager -->
</body>
</html>
Ativei o modo de depuração do gerenciador de tags do Google e o assisti no Google Analytics em tempo real.
Eu tenho 2 regras de disparo para uma tag:
{{url}} contém test.site.com{{event}} é igual a GAevento que eu tenho é "event category: undefined
"&"event action: undefined
"em tempo real, google analytics.
Se eu remover"{{url}} contains test.site.com
", nada está aparecendo em tempo real.
Atualizar Usei uma conta de gerenciador de tags do Google separada e criei uma página de teste, para que tudo seja mínimo. Parece funcionar em tempo real. O gerenciador de tags do Google que não funciona é compartilhado por escolas e faculdades. Eu suspeito que esse é o motivo?