|
@@ -4,16 +4,23 @@
|
4
|
4
|
/**
|
5
|
5
|
*
|
6
|
6
|
*/
|
7
|
|
- function Analytics() {
|
|
7
|
+ function Analytics(options) {
|
8
|
8
|
/* eslint-disable */
|
9
|
9
|
|
|
10
|
+ if (!options.googleAnalyticsTrackingId) {
|
|
11
|
+ console.log(
|
|
12
|
+ 'Failed to initialize Google Analytics handler, no tracking ID');
|
|
13
|
+ return;
|
|
14
|
+ }
|
|
15
|
+
|
10
|
16
|
/**
|
11
|
17
|
* Google Analytics
|
|
18
|
+ * TODO: Keep this local, there's no need to add it to window.
|
12
|
19
|
*/
|
13
|
20
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
14
|
21
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
15
|
22
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
16
|
|
- ga('create', 'UA-319188-14', 'jit.si');
|
|
23
|
+ ga('create', options.googleAnalyticsTrackingId, 'jit.si');
|
17
|
24
|
ga('send', 'pageview');
|
18
|
25
|
|
19
|
26
|
/* eslint-enable */
|
|
@@ -114,7 +121,7 @@
|
114
|
121
|
* lib-jitsi-meet.
|
115
|
122
|
*/
|
116
|
123
|
Analytics.prototype.sendEvent = function(event) {
|
117
|
|
- if (!event) {
|
|
124
|
+ if (!event || !ga) {
|
118
|
125
|
return;
|
119
|
126
|
}
|
120
|
127
|
|