Google Analytics returning many "undefined" events - google-analytics

I've got a fairly simple Tag Manager/Analytics set up (firing events on clicks/visibility) and it's working as expected for the tags I've set up myself. However when I check the Analytics page there are thousands of "undefined" tags.
I've had a look at all of the tags I created and none of them should be returning "undefined" as the category/action (the label is "(not set)")
All I need is for the undefined events to be ignored (or even better to stop firing) in Google Analytics, as it's getting in the way of the client analysing the data.
Any help is appreciated
EDIT:
As suggested, here's the only User-Defined variable on the Tag Manager:
https://imgur.com/a/flcCpGo
Here's an example of one of the tags:
https://imgur.com/a/eWM22FB
and here's a tag being fired in the preview mode:
https://imgur.com/a/0ipwqhr

May be some other (hardcoded) event returns 'undefined'?
Try to check in Chrome using «Dev Tools», tab «Network», filter google analytics calls.
And I notice you send 'gtm.click' (string) in field 'Value' that must contain integer.

Turns out this was simply just due to a tag not having a category/action/label that had been paused a while ago, the Analytics timeframe was covering from before when this tag was paused, leading it to show the undefined tags.

Related

Google Tag Manager Link Click returns boolean value "false"

I have set up a "linkClick" trigger to track menu clicks. But it shows false instead of the actual text in the Click Text variable. How is it even possible for a string parameter to return a boolean?
I encountered the same problem as you, when setting up a auto-event variable and custom javascript, where return type would always be boolean and result false.
Asking around, there seems to be a problem with Google Tag Manager at the moment, so you are just encountering a bug.
Keep an eye on Google Tag Manager the coming days as it should hopefully be worked out!

Is it ok to pass objects requiring evaluation to the GTM dataLayer variable

When using the GTM (Google Tag Manager) dataLayer variable, is it ok to pass objects whose properties are revealed via getters? In the image below, the last item pushed to the dataLayer array shows ellipses (...) for the properties. When hovering over the ellipses you get the message "Invoke property getter".
I want to confirm whether this can be a problem for GTM or not.
It will cause the issues in GTM because it's expecting simple JS properties and not getters. In gtm.js it just reading properties and not executing them

Value is being sent to datalayer, however, the custom dimension is not being caught in Google Analytics

I am experimenting with getting datalayer variables into GA. I am just experimenting so the values are just for testing.
So I paste this link with a datalayer push onto a page:
<a href="http://www.google.com"
onclick="dataLayer.push({
'test': 'okay'
});">Customize Color</a>
I do the necessary configuration in GTM as well as GA.
However, in the debug console of Chrome I get this into the datalayer:
However, this doesn't come into GA custom dimension as you can see below:
One small note, if I paste the datapush directly under the datalayer script, I get the datalayer variable in the custom dimension. However, in that case I do not have a onclick with the URL.
What I suspect could be happening is that there is a misalignment when that dataLayer push is being made, and when you are grabbing the value to populate your custom dimensions. You should push an event ALONG with the CD value:
dataLayer.push{(
'event': 'someEvent',
'test': 'okay'
})
and then you should trigger your event tag to fire on the someEvent trigger, and at the same time, populate your CD with the test value.
EDITS:
Your trigger should be simply this:
There is absolutely no need to define an event variable that's used in an eventTrigger that fires on someEvent. I believe doing it that way causes issues.
Nyuen, great, that was exactly the issue! I didn't see the VALUE of the first declared variable of the datalayer_push also having to be the name of the custom event. I was constantly pairing it in the condition section.... I still don't see the logic of it, but ey, it works! Many thanks!

How can I make sure that gtm send the pageview fast?

I am making the change from the basic analytics code to google tag manager since I need it to track impressions for certain elements. While testing when the pageview fires, I get this warning :
"This page took a long time to send a pageview hit to Google Analytics. Users could be clicking away from your site before it records a pageview."
Google tag manager requires adding the code at the beginning of the body (I tried adding it in the header just in case it helps with that warning, but that didn't work).
Probably GA is not the best choice for such task. GA is well-tailored for pageviews, but not for custom actions.
I solve similar issue with http://www.devmetrics.io analytics. To track impressions for certain elements on my page: 1) add for each of this elements trackvisible css class 2) using setInterval check visibility every few seconds.
Example code using jQuery and devmetrics analytics:
$('.trackvisible').each(function( index ) {
if ($(this).visible()) {
var tag = 'element.' + $(this).attr('id');
devmetrics.userEvent('impression', [tag]);
}
});

Visitor Custom Variable Google Analytics Help

I am using Google Analytics Custom Variables for a site I am working on. Here is the code snippet uploaded on the page.
_gaq.push(['_setAccount', 'UA-xxxxxxxxx-1']);
//]]>
</script>
<script>
//<![CDATA[
_gaq.push(['_trackPageview', 'searches/new/registration/complete']);
_gaq.push(['_setCustomVar', 1, "member type", "registered", 1]);
_gaq.push(['_trackEvent', 'registration', 'signup',,1]);
Although I am aware that the _trackPageview needs to be placed after the _setCustomVar call, I am still seeing numbers flow through into Google Analytics as 'member type=registered'. I do not want to dismiss these numbers and I want to make some sense of it before I amend this error in how the snippet was placed.
Any reason why I stil received visits for this Name-Value combination?
Thanks -
The Custom Var is set with a GA cookie, and is actually stored and sent on your next _trackPageview, that's why you can still see it, all you are doing to sending the data probably in a moment you don't want to (the next pageview).
Edit: Also as pointed out, it could go with your _trackEvent method, wich will end up doing the same thing, sending the data in a particular time you dont intent to, specially with events, wich are linked to interactions, so if no one triggers those in the page you are trying to set the customVar, it wont get set at all.
Because your custom variable's scope is set to 1, it'll still get fired by "trackEvent" (even without "trackPageview".
If your scope was set to 3 (page-level), it will then rely on "trackPageview" and will not register well with "trackEvent"

Resources