举报来自Google Analytics(分析)analytics.js异常追踪的异常情况 [英] Report for exceptions from Google Analytics analytics.js exception tracking
问题描述
Google通用Analytics(分析)具有命中类型的异常
Google Universal Analytics has a hit type of exception
ga('send', 'exception', {
'exDescription': 'DatabaseError'
});
我期待能够访问Google Analytics(分析)控制台,并在
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.
Android和iOS API说崩溃和异常数据主要在崩溃中可用而且例外情况报告
,但我找不到任何该名称的报告。
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:
哪个给我这样的报告:
你也可以转到自定义
选项卡,然后创建一个自定义报告,给出一个错误表,然后将其添加到您的信息中心。
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
});
}
};
}
您可以将这个处理程序放在Javascript的初始化中 - 这将依赖关于你如何配置所有的JS文件。或者,您可以将其放在html正文标签顶部附近的< script>
标记中。
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.
这篇关于举报来自Google Analytics(分析)analytics.js异常追踪的异常情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!