Google Anlytics monitoring of events doesn't work properly - google-analytics

I've a problem with a function of Google Anlytics monitoring.
I want to track the download of a file on my web site and I wrote the following line:
<a href="/file_download/nomefile.zip" onclick="_gaq.push(['_trackEvent', 'download', 'click', 'myFile']);">
But it seemes it doesn't work correctly. There are some downloads not shown and it seems to work only in a specific region: only tracks click from Italy, for example.
Can you give me any help or suggestion in order to resolve the problem, please?
Ps. I'm sure there are not tracking downloads because some people contacted me for support on the file and no event of download is shown.

The problem with this implementation is that the page gets unloaded before the event is recorded. To solve you can do one of the following:
Use universal analytics. This implementation uses a function call which will get executed before unload.
Wrap the click in a function which will delay the unloading of the page by several hundred milliseconds.

Related

How to catch OverQuotaMapError for a Google map?

If my javascript code attempts to load the Google map API more then 25,000 times in a day then Google will write OverQuotaMapError to the window.console.
See https://developers.google.com/maps/documentation/javascript/error-messages
Is OverQuotaMapError a property or a value in the window.console object?
What is the recommended code to see if this ‘error’ has occurred?
I have a wildland fire map that will likely hit the API load limit later today. When that happens I want to be display an informative message to my users.
Silly me. If you open the google documentation link I posted and scroll to the bottom then you will see a link to advice from Google for how to check for any of these errors via your code.

Google tracking code validation doesn't work

So, in order to see interests/demographics/etc on google analytics, I need to make a one line change to my tracking script on the website ( https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad ). So, I simply copied the code and pasted it in my website's base template. Everything works! Realtime analytics, google's debug script gives no errors, but... when I click demographics tab, or any other one requiring the script change, I need to validate the tracking code. When I click that button, nothing happens... Anyone had similar problems?
My website: http://osrodekzdrowiawskale.pl/
I had the same problem; I knew I implemented the code correctly, still the validation didn't work. I hesitated to press skip, though, but it worked when I did! After that, it said on the web page that it will take 24 hours before data reports start to show.
"If you are certain that you’ve made the correct change, you can click Skip validation."
https://support.google.com/analytics/answer/2819948?hl=en-GB (Solution source)
Edit: Just noticed that the question was solved in the comments.
Check again tomorrow. Can take anywhere to 24 hours for demographic data to start populating.

Analytics receives events, but does not log them in reporting

I've been all over google and SO looking for answers here. I've checked code against google's tracking code suggestions and I've even tested with their sample code. But I cannot get the events to be properly tracked in Google Analytics. My code has been live on the site for some time (~ a month), so this should have overcome any lag on the reports there.
I'm using analytics, the async version, which works fine for page tracking and other 'normal' features. Trying to set up event tracking, I followed the example, and waited a week. Still nothing. I've been debugging and I'm not having any of the 'normal' problems (as far as I can see).
So:
Example tracking code fired:
Play
This triggers an event, which according to ga_debug.js, is fired successfully. Checking the network panel I can see the request and _umt.gif returns status 200.
I've checked the request string in there. All seems good.
But checking GA, there is nothing in the reports. But when you go to GA Realtime > Events, you can see the events being fired!?
I can trigger the events on page or fire them from the console and corresponding events show up in the realtime section, but they have no data (Category, Action or Label).
This is odd, that even firing Google's own example code nothing is showing up.
If anyone has any ideas of where to start debugging for this (or has experience of anything similar), it would be great to hear.
I have been struggling with this issue for three days. I know this thread is old, but I stumbled upon it during my searching. I wanted to post what my personal resolution was in case someone else comes across this.
My Solution:
Here is where I finally found it:
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables
Under: "Using Custom Variables" > "Traditional (ga.js) Snippet" (We are using the ga.js still... for now.)
I had a similar problem and ran into this issue:
https://issuetracker.google.com/issues/35353093
In summary, I was setting the userId property via below. Removing that started historical tracking for me.
ga('set', 'userId', username);
This question gets asked a lot and the answer is almost always "Google Analytics standard SLA is 24 hours". The logs are processed in batch behind the scenes. At peak times, this takes a while.
It can take up to 24 hours for the Google Analytics servers to update -- Source: Google Documentation - Check your web tracking code setup

Event conflicts w/ google analytics

I'm a complete newbie to google analytics, new like I was put on a project yesterday and I've been combing through docs trying to figure out what's wrong with this _trackEvent that I'm trying to set up.
Here's the setup:
I have a drupal site that has had some custom events set up. One of the events that we track is outbound links, and that works great. What we want to do is start creating special cases for some of these links. So for example I have a live chat button w/ this code:
<a href='url/to/chat
onclick="_gaq.push(['_trackEvent','LiveChat','btnClick',this.href]);
setTimeout(function(){this.newWindow = window.open(this.href);
this.newWindow.focus();
this.newWindow.opener=window;},200);
return false;"><img alt='Live Chat Software' src='src/url' border='0'></a>
so what I did is ran the calls through the ga_debug.js. This is the output I got
_gaq.push processing "_trackEvent" for args:
"[Outbound links,Click,outgoing/url]": Track Event
Tracking beacon sent!
This means that an event is getting sent on click. So I'm curious why it's sending an Outbound Links event rather than my LiveChat event? Could it be scoping issues? Not sure, as I know the outbound links is defined at a global level. Anyone have any suggestions/insights/opinions? Before berating me about code, I have inherited this project and I'm just trying to understand it better.
thank you,
Brodie
Okay so it turns out that it was a scoping issue. When they had originally set us up the bomb the click event was registered to the body as opposed to being an inline. So that was eating the inline event.
lesson learned: double check scoping
tools that helped
ga_debug.js

Google analytics event tracking not working

I have this code setup to track image downloads throught Google Analytics.
<a href="/media/37768/CC20100117m001_thumb_2000.jpg"
onclick="pageTracker._trackEvent('Image', 'Download', 'file.jpg');"
class="hi-res track">
Hi-Res</a>
But the events don't ever show up in the GA reports.
I thought maybe the the browser was following the link before the javascript was being run but setting href="#" doesn't work either.
Any ideas?
Your browser may be following the link before Analytics can make the call logging the event. Check out this page for Google's solution:
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55527
I don't know what your error is but to find out what it is you can:
Install firefox
Click on the link
Go to Tools | Error Console
Look at the error
This doesn't look correct to me--for one thing, you're using 'pageTracker' to call _trackEvent. In fact, _trackEvent is called by an 'event tracker' object, which is instantiated with _createEventTracker.
There are a couple more steps you haven't mentioned so et's go through them all. (There could be more than one correct way to do this--i'm not sure. So what i can do is compare your code with the steps i follow every time i set up Event Tracking, and which so far, have worked every time.)
Enable 'Event Tracking'. (Do this in
your profile.)
Create the 'event tracker' instance and insert it just after the last line of the pageTracker script. This is usually a single line of code that in your case would look something like this:
var ImageTracker = pageTracker._createEventTracker("Image")
Set up the call to the _trackEvent()
method in your html. I think all you
need to do here is replace
'pageTracker' in your code with 'ImageTracker' (the
event tracker instance you created
in step 2 above).
I faced a lot of problem then I realize it's easy steps and want to share with everyone.
First change your script code, link is https://developers.google.com/analytics/devguides/collection/gajs/#quickstart
Second add a button like this.
<>button onclick="_gaq.push(['_trackEvent', 'button3', 'clicked'])">Press<>/button>
Enjoy :)

Resources