Pārlūkot izejas kodu

Adds browser suffix to all events reported to analytics.

master
damencho 9 gadus atpakaļ
vecāks
revīzija
d376801be4
1 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 7
    3
      modules/statistics/AnalyticsAdapter.js

+ 7
- 3
modules/statistics/AnalyticsAdapter.js Parādīt failu

1
+var RTCBrowserType = require("../RTC/RTCBrowserType");
2
+
1
 function NoopAnalytics() {}
3
 function NoopAnalytics() {}
2
 NoopAnalytics.prototype.sendEvent = function () {};
4
 NoopAnalytics.prototype.sendEvent = function () {};
3
 
5
 
7
 // implementation we will use here and we have to postpone it i.e. we will make
9
 // implementation we will use here and we have to postpone it i.e. we will make
8
 // a lazy decision.
10
 // a lazy decision.
9
 
11
 
10
-function AnalyticsAdapter() {}
12
+function AnalyticsAdapter() {
13
+    this.browserActionSuffix = '.' + RTCBrowserType.getBrowserName();
14
+}
11
 
15
 
12
-AnalyticsAdapter.prototype.sendEvent = function ()
16
+AnalyticsAdapter.prototype.sendEvent = function (action, data)
13
 {
17
 {
14
     var a = this.analytics;
18
     var a = this.analytics;
15
 
19
 
19
         this.analytics = a = new AnalyticsImpl();
23
         this.analytics = a = new AnalyticsImpl();
20
     }
24
     }
21
     try {
25
     try {
22
-        a.sendEvent.apply(a, arguments);
26
+        a.sendEvent(action + this.browserActionSuffix, data);
23
     } catch (ignored) {}
27
     } catch (ignored) {}
24
 };
28
 };
25
 
29
 

Notiek ielāde…
Atcelt
Saglabāt