Commit 9e980562 authored by Boris Kocherov's avatar Boris Kocherov

Analytics.js disable

parent 3bae8df0
/*global Common, _gaq */
/* jshint -W116 */
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
......@@ -29,17 +31,19 @@
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
if (Common === undefined)
var Common = {};
*/
if (Common === undefined) {
var Common = {}; // jshint ignore:line
}
Common.component = Common.component || {};
Common.Analytics = Common.component.Analytics = new(function() {
Common.Analytics = Common.component.Analytics = (function () {
"use strict";
var _category;
return {
initialize: function(id, category) {
initialize: function (id, category) {
if (typeof id === 'undefined')
throw 'Analytics: invalid id.';
......@@ -49,21 +53,21 @@ Common.component = Common.component || {};
_category = category;
$('head').append(
'<script type="text/javascript">' +
'var _gaq = _gaq || [];' +
'_gaq.push(["_setAccount", "' + id + '"]);' +
'_gaq.push(["_trackPageview"]);' +
'(function() {' +
'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;' +
'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";' +
'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);' +
'})();' +
'</script>'
);
// $('head').append(
// '<script type="text/javascript">' +
// 'var _gaq = _gaq || [];' +
// '_gaq.push(["_setAccount", "' + id + '"]);' +
// '_gaq.push(["_trackPageview"]);' +
// '(function() {' +
// 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;' +
// 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";' +
// 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);' +
// '})();' +
// '</script>'
// );
},
trackEvent: function(action, label, value) {
trackEvent: function (action, label, value) {
if (typeof action !== 'undefined' && Object.prototype.toString.apply(action) !== '[object String]')
throw 'Analytics: invalid action type.';
......@@ -82,5 +86,5 @@ Common.component = Common.component || {};
_gaq.push(['_trackEvent', _category, action, label, value]);
}
}
})();
};
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment