Browse Source

Adds browser suffix to all events reported to analytics.

master
damencho 9 years ago
parent
commit
d376801be4
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      modules/statistics/AnalyticsAdapter.js

+ 7
- 3
modules/statistics/AnalyticsAdapter.js View File

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

Loading…
Cancel
Save