Google Analytics Event Tracking Error
Contents |
InteractionsUser TimingsAdvancedStandard and Customized SetupResourcesMigrating to Async TrackingTroubleshooting & ValidationCookie UsageLimits and Quotas IntroductionFundamentalsCampaignsCustom VariablesEcommerceEvent TrackingExperimentsMultiple DomainsSearch EnginesSocial InteractionsUser TimingsAdvancedStandard and Customized SetupResourcesMigrating to Async TrackingTroubleshooting
Google Analytics Exception Tracking
& ValidationCookie UsageLimits and Quotas Products Google Analytics Tracking ga.js google analytics exception report (Legacy) Guides Troubleshooting the Tracking Code ga.js is a legacy library. If you are
Google Analytics View Exceptions
starting a new implementation we recommend you use the latest version of this library, analytics.js. For exisiting implementations, learn how to migrate from ga.js google analytics crashes and exceptions to analytics.js. If you want to troubleshoot issues with Google Analytics tracking, first ensure your basic setup is correct as described in the Help Center under Verifying Your Setup. Troubleshooting your Analytics tracking will center around two key issues: Errors/typos in your tracking code syntax (e.g., whitespace, incorrectly spelled google analytics error reporting customizations, incorrect parameter names) Data missing from your reports The rest of this document covers how you can use troubleshooting tools to help identify and correct these two basic issues. Common Tracking Code Errors Whether you are using the asynchronous or traditional syntax, keep in mind the following to avoid the most common errors when you customize or adjust the tracking code. To learn how to easily check for these errors, see Debugging with ga_debug.js. Method names use incorrect case. Remember that methods are case-sensitive. If you use a method name without the proper casing, your method calls will not work. Examples: _gaq.push(['_trackpageview']); // wrong _gaq.push(['_trackPageView']); // wrong _gaq.push(['_trackPageview']); // correct Incorrect method names. If your tracking is not working correctly, check to make sure you are using the correct name for the method. Examples: _gaq.push(['_setDomain', 'example.com']); // wrong _gaq.push(['_setDomainName', 'example.com']); // co
about analytics, marketing and testing Kissmetrics Customer Analytics: See how each visitor behaves and make better decisions that drive growth Try Kissmetrics 29 Common Google Analytics Data Errors And How To Fix Them With the Ecommerce Foundation quoting
Google Analytics Error Logging
B2C eCommerce figures of $2.2bn worldwide for 2015, it seems that if a track js errors business is not focusing efforts online then it’s falling way behind the current trend. Doing business online these days IS
Google Analytics Not Showing Data
doing business, and the trusted means by which to measure our results is Google Analytics. “If you can not measure it, you can not improve it” - Sir William Thomson (First Baron Kelvin) https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTroubleshooting Rolling out and implementing Google Analytics can be a tricky big process for most businesses and often specialist assistance is required to get things running correctly. However, even with the most skilled of talent, errors can occur in the data that can throw out results, often unknown to the analytics team. Customizing the Google Analytics code is a team effort and will require constant measurement and evaluation https://blog.kissmetrics.com/google-analytics-data-errors/ to get things humming. During the refinement process you are likely to find some of these errors occurring. Here’s 29 of the most common errors, likely causes and ways you can correct them. I’m assuming you are using Universal Analytics analytics.js: Before we begin: Did You Know, there are two [Google Analytics] methods for gathering user data from your website? Use either Universal Analytics or Tag Manager, and be careful not to use both. Note 1: Both are using the same JavaScript code to gather data, it’s only that Tag Manager makes it easier to customize the code with additional tags. Note 2: We are only going to touch on Tag Manager issues in this post. Tag Manager has a lot of elements that we could get into but would be too extensive for this post. Tag Manager Errors deserve a post all to themselves so maybe I’ll hit that one for you guys next time. Campaign Errors Errors associated with setting up both your online and offline your campaigns. Error #1 - Custom Campaigns Not Being Tracked A Custom Campaign is a means of uncovering how referred traffic arrives to your site. Using this data you
(at) simoahava.com You are here: Home / GTM tips / #GTMTips: Track JavaScript Errors As Events#GTMTips: Track JavaScript Errors As Events 24/03/2016 by Simo Ahava 13 Comments Back back to the friggin' basics. Almost two years ago, I wrote a two-parter on how to have fun with http://www.simoahava.com/gtm-tips/track-javascript-errors-events/ Google Tag Manager: Part 1, and Part 2. The first part had a nice exercise for tracking JavaScript Errors as Google Analytics Events, using the recently published "JavaScript Error Listener" Tag. Well, that was in GTM V1. Now we've http://www.davidverhasselt.com/an-easy-javascript-error-logger-using-ga/ been smoothly sailing with the wonderful new interface for well over a year, and it's time to update some of these nifty tricks. In this #GTMTips post, I'll show you how to track uncaught JavaScript errors in the new google analytics interface, plus give you some tips on the overall process. Tip 43: Track JavaScript Errors As Events The process is actually really simple. Much easier than it was in the previous Google Tag Manager interface. By the way, uncaught refers to an error which hasn't been captured and handled by any of the scripts on the page. The most common way to catch an error is to use try...catch blocks around your code, which capture any errors which bubble google analytics exception up to the context where you have the block. If an error makes its way through without having been caught in any way, it will trigger the JavaScript Error Trigger. Thus it's a good way to audit your current error detection methods, too! Anyway, you start by making sure the Built-In Variables are activated. If you're curious about these Built-In Variables, check the relevant section of my Variable Guide For Google Tag Manager. Next, head on over to Triggers, and create a new one: I'm going to let the Trigger fire on "All JavaScript Errors", but be sure to read to the end of this post for tips regarding this selection. Finally, you need a Google Analytics Event Tag, which collects and concatenates all this information. Here's what I use: An example result using these settings would be something like: Event Category: JavaScript Error Event Action: Uncaught ReferenceError: appear is not defined Event Label: 1255: http://www.simoahava.com/scripts/bundle.js I'm sending the event as Non-Interaction: True, because it's not a user interaction, and I don't want it to be counted as such. And that's it for the implementation! Now, there are some things you might want to consider when implementing this on your own website. The next chapter will tackle these issues. Tips Tracking JavaScript Errors can be quite the bipolar experience. On the one hand, it's just a good, solid developer attitude to want t
client-side errors can no longer be considered a luxury. We’ll explore a free method to start logging exceptions with just a few lines of code. Because there’s so many different browsers and configurations out there it’s much harder to write Javascript that works flawlessly everywhere compared to for example server-side code, and you already probably log server-side exceptions. Graphing the amount of errors happening There are many services out there that allow you to log client-side exceptions, but naturally none of them are free once you go beyond the basic offering. Luckily Google Analytics is still free, and we can easily feed it our errors as events. Bonus: sweet graphs! How To We’re going to create a Google Analytics Event every time an exception happens. Creating these events is easy if you already have Google Analytics installed. We’ll just push an array containing ‘_trackEvent’, and the category, action and optionally a label, onto the _gaq (Google Analytics Queue) object: _gaq.push(['_trackEvent', category, action, label]) Tracking an event To catch the exceptions, we’ll use the window.onerror event handler, which gives us the file, line-number and actual exception message. Together that looks like this: window.onerror = function(message, file, line) { _gaq.push(['_trackEvent', "Global", "Exception", file + "(" + line + "): " + message]) } Tracking an Exception as it happens And we’re done! Easy. Script Error Once you start logging your errors, you might notice a lot of “Script error” happening without any file or line number. This is the standard exception message given when a Javascript file from a different domain raises an error. Because these exceptions might leak information across domains the message is sanitized to the standard “Script error”, hiding the real error message, file and line-number that makes logging errors so useful. If you’re using a different domain to serve your