Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
9e980562
Commit
9e980562
authored
Apr 29, 2017
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Analytics.js disable
parent
3bae8df0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
40 deletions
+44
-40
apps/common/Analytics.js
apps/common/Analytics.js
+44
-40
No files found.
apps/common/Analytics.js
View file @
9e980562
/*global Common, _gaq */
/* jshint -W116 */
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
...
...
@@ -29,58 +31,60 @@
* 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
()
{
var
_category
;
Common
.
Analytics
=
Common
.
component
.
Analytics
=
(
function
()
{
"
use strict
"
;
var
_category
;
return
{
initialize
:
function
(
id
,
category
)
{
return
{
initialize
:
function
(
id
,
category
)
{
if
(
typeof
id
===
'
undefined
'
)
throw
'
Analytics: invalid id.
'
;
if
(
typeof
id
===
'
undefined
'
)
throw
'
Analytics: invalid id.
'
;
if
(
typeof
category
===
'
undefined
'
||
Object
.
prototype
.
toString
.
apply
(
category
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid category type.
'
;
if
(
typeof
category
===
'
undefined
'
||
Object
.
prototype
.
toString
.
apply
(
category
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid category type.
'
;
_category
=
category
;
_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.
'
;
if
(
typeof
action
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
action
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid action type.
'
;
if
(
typeof
label
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
label
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid label type.
'
;
if
(
typeof
label
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
label
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid label type.
'
;
if
(
typeof
value
!==
'
undefined
'
&&
!
(
Object
.
prototype
.
toString
.
apply
(
value
)
===
'
[object Number]
'
&&
isFinite
(
value
)))
throw
'
Analytics: invalid value type.
'
;
if
(
typeof
value
!==
'
undefined
'
&&
!
(
Object
.
prototype
.
toString
.
apply
(
value
)
===
'
[object Number]
'
&&
isFinite
(
value
)))
throw
'
Analytics: invalid value type.
'
;
if
(
typeof
_gaq
===
'
undefined
'
)
return
;
if
(
typeof
_gaq
===
'
undefined
'
)
return
;
if
(
_category
===
'
undefined
'
)
throw
'
Analytics is not initialized.
'
;
if
(
_category
===
'
undefined
'
)
throw
'
Analytics is not initialized.
'
;
_gaq
.
push
([
'
_trackEvent
'
,
_category
,
action
,
label
,
value
]);
}
}
})();
_gaq
.
push
([
'
_trackEvent
'
,
_category
,
action
,
label
,
value
]);
}
};
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment