博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
用Google Analytics跟踪JavaScript Errors (译)
阅读量:7180 次
发布时间:2019-06-29

本文共 807 字,大约阅读时间需要 2 分钟。

通过custom events来实施

// Track basic JavaScript errorswindow.addEventListener('error', function(e) {    _gaq.push([        '_trackEvent',        'JavaScript Error',        e.message,        e.filename + ':  ' + e.lineno,        true    ]);});// Track AJAX errors (jQuery API)$(document).ajaxError(function(e, request, settings) {    _gaq.push([        '_trackEvent',        'Ajax error',        settings.url,        e.result,        true    ]);});

Now when you go into Google Analytics, you can view the custom event information along with other site stats.  Of course you'll tell the marketing people those aren't really error, they're features, but that's another story.  Consider using Google Analytics for to track site errors -- you can thank me later.

来自:

转载于:https://www.cnblogs.com/JoannaQ/p/3669818.html

你可能感兴趣的文章
yum更换国内源 yum下载rpm包 源码包安装
查看>>
i++为什么是线程不安全的
查看>>
C# log4net 不输出日志
查看>>
最好的年龄减肥
查看>>
2015第43周一solr相关概念
查看>>
大数模板
查看>>
SqlServer时间戳与普通格式的转换
查看>>
转:关于腾讯bugly崩溃的android so符号表使用
查看>>
集成支付宝后出现LaunchServices: ERROR: There is no registered handler for URL scheme alipay
查看>>
Http和Socket详解
查看>>
iOS 多线程开发之OperationQueue(二)NSOperation VS GCD
查看>>
LeetCode - Trapping Rain Water
查看>>
Codeforces 437C The Child and Toy(贪心)
查看>>
蓝桥杯 大臣的旅费
查看>>
hql中不能写count(1)能够写count(a.id)
查看>>
Atitit。Time base gc 垃圾 资源 收集的原理与设计
查看>>
还是态度问题
查看>>
判断记录是否存在的通用方法
查看>>
sift算法c语言实现
查看>>
报表中的Excel操作之Aspose.Cells(Excel模板)
查看>>