Troubleshooting Google Analytics Tracking for SAS stations

Mar 21, 2014

Ever have one of those days when the next big thing has just launched and everyone is waiting for the good news, but instead of spiking, Google Analytics seems to suddenly have flat-lined? Before you have a coronary there are few things to keep in mind.

A frightening sight or normal Google behavior?

The most likely cause is probably processing latency.
Google Analytics doesn't just spit raw data out on to the screen, it takes a lot of processing to turn individual hits into unique visitors. The expected latency for a standard (free) Google Analytics account is actually 24-48 hours. Accounts with more than 200,000 visits a day are only refreshed once daily starting at 12:00 UTC.  

If you're using SAS you won't have to wait as long, because one of the benefits of using SAS is an upgrade to Premium Google Analytics. Premium accounts are refreshed on a more frequent basis, but the expected processing latency can still be up to 4 hours. That said, no one wants to wait hours only to find out that there was a problem when the data never arrives. Here are a few steps that you can take in the meantime to help put your mind at ease.

Check chartbeat.com
If you are using the Station Analytics System tag Chartbeat can give you an indication of whether things are working correctly. All of the tracking information is included in the same file, so if Chartbeat is working - then it's an encouraging sign that Google Analytics is fine as well.

Check Google Analytics Real-Time reports.
One of the newer sections of the Google Analytics interface, these can sometimes be forgotten, but they provide a wealth of valuable information. Interested in how your Facebook promotion of that new section is performing? You can not only see specific content, but also drill into information on traffic source or geographic location. There's more than enough here to reassure you that things are working correctly.

Confirm your tags.  
If you aren't seeing a what you expect, there are few more things you can try to help you close in on the problem.  The first step is to make sure that the tracking code is still in place. Google Analytics will tell you if it's receiving data from your site even when real-time stats are on the fritz. In the admin section, look for "Tracking info" in the property settings. Under this heading click "tracking code". This will identify the Tracking ID (sometimes called UA number) and give you a status. "Receiving data" means things are ok, but "Tracking Not Installed" could be cause for alarm.

A comforting sign.

Confirm that the file is linked correctly and updated on the CDN.
SAS tags are stored on a CDN so there can be a lag between when you make a change in SAS and when it flows to all of the CDN.  Checking to see if you can open the file in a browser will help you to understand if something has gone wrong with the network that hosts these files.  Try opening your SAS tag directly by copying the address into a browser.  The address is the part of the snippet that starts with stream.publicbroadcasting.net and ends with your .js filename.  If this file opens correctly it helps to note the date and version in the header in case you need to open a ticket.  If you can't get to the file at all it's possible that  there is an outages that impacted tracking please let us know right away.

Try the debugger.
Sometimes another bug in the code can cause errors or prevent you rGoogle Analytics code from executing.  Once you've confirmed the tag is there you will want to understand if something is causing the code to work incorrectly or is preventing it from running at all. Chrome and Firefox both offer a version of the Google Analytics Debugger which will output variables from the Google Analytics code into your browser's console window.  

If there is an error preventing the code from running the debugger can give you a heads up, and if it isn't sending the values that your are expecting you'll be able to double check that here as well.  If the debugger shows the tracking beacon being sent it's generally enough to make me rest easily.  However if you have recently made changes to tracking it is also helpful to double check your account number, page title and the other fields you are looking for in GA. 

If you check these things an still have cause for concern, SAS users should contact the Digital Services Analytics team for support by emailing analytics@ds.npr.org .