Google Universal Analytics has a hit type of exception
ga('send', 'exception', { 'exDescription': 'DatabaseError' });
I was expecting to be able to just go to the Google Analytics console and find an exeption report at the same level as 'events' however it's nowhere to be seen.
The Android and iOS APIs say Crash and exception data is available primarily in the Crash and Exceptions report
but I can't find any report by that name.
Figured it out. I'm not sure why they don't make this a built in report but maybe someday.
I made a custom widget in a dashboard with Exception Description
for dimension and 'Crashes' for the metric:
Which gives me a report like this:
You can also go to Customization
tab and create a custom report to give you a table of errors, and then add it to your dashboard.
Used with this global exception handler
if (typeof window.onerror == "object") { window.onerror = function (err, url, line) { if (ga) { ga('send', 'exception', { 'exDescription': line + " " + err }); } }; }
You can put this handler anywhere in the initialization of your Javascript - which will depend upon how you have all your JS files configured. Alternatively you can just put it inside a <script>
tag near the top of your html body tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With