Here are a few tips for debugging your Google Analytics tagging implementation.
- Setup your development environment
This is important for two reasons: firstly you do not want to pollute your Client's data and secondly, you want to concentrate on your test hits. Depending on how much work you need to do, you might consider one of the two options below
a. Create a View in your Client's GA property with an Include filter which allows only your debug traffic using your IP address(es) and/or filtering by Custom Dimension set to debug.
b. Create a testing property and introduce an additional tracker (very easy to do with GTM)
The last option is my favourite: you get two sets of data and the Client feels safe, seeing the difference.
- Use Google Analytics Debugger tools such as Google Analytics Debugger Chrome extension (displays data being sent to Google Analytics) and Analytics Debugger Chrome extension (allows you to visualise your tags directly on the page). There are a number of Add-ons available for Firefox as well.
- Use Real-Time Reporting or use Real-Time Reporting API. The only way to achieve tagging peace-of-mind is knowing that your tags work. And the only way to be sure they work is to look in the reports. The Real-Time Reporting in GA is very good and Google is now targeting 1 second reporting.
- Use Custom Dimensions and Custom Metrics to save debugging information. You may be reluctant to do so when you have only 20 Custom dimensions available, but if you are a Google Analytics Premium Customer - you have plenty of those at your disposal. You can save the complete URL, User Agent (which was invaluable when Google Analytics did not recognise MS Edge browser) or raw campaign UTM variables.
Remember: Happy Tags = Happy Client so happy tagging, guys!