cloudcmd/lib/client/google_analytics.js
2013-01-03 09:50:07 -05:00

24 lines
No EOL
674 B
JavaScript

var DOM, _gaq;
(function(DOM, _gaq){
'use strict';
/* setting google analitics tracking code */
_gaq = [['_setAccount', 'UA-33536569-2'], ['_trackPageview']];
var lOnError_f = window.onerror;
window.onerror = function(msg, url, line) {
var preventErrorAlert = true;
_gaq.push(['_trackEvent',
'JS Error',
msg,
navigator.userAgent + ' -> ' + url + " : " + line]);
if(typeof lOnError_f === 'function')
lOnError_f();
return preventErrorAlert;
};
DOM.jsload('http://google-analytics.com/ga.js');
})(DOM, _gaq);