Based on this thread: Tracking events using Google Tag Manager
I created my own version, which is located at e.g. 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>
I turned on google tag manager debug mode and watched it on google analytics real-time.
I have 2 fire rules for a tag:
- {{url}} contains test.site.com
- {{event}} equals GAevent
what I got is "event category: undefined
" & "event action: undefined
" in real time google analytics.
If I remove "{{url}} contains test.site.com
", nothing is appearing in real-time.
Update I used a separated google tag manager account and create a test page, so everything it is minimum. It seems working in real time. The non-working google tag manager are shared by schools and faculties. I suspect that is the reason?