|
@@ -17,7 +17,7 @@ AnalyticsAdapter.eventsQueue = [];
|
17
|
17
|
// implementation we will use here and we have to postpone it i.e. we will make
|
18
|
18
|
// a lazy decision, will wait for loaded or dispose methods to be called.
|
19
|
19
|
// in the meantime we accumulate any events received
|
20
|
|
-AnalyticsAdapter.prototype.sendEvent = function (action, data) {
|
|
20
|
+AnalyticsAdapter.prototype.sendEvent = function (action, data, label) {
|
21
|
21
|
if (this.analytics === null || typeof this.analytics === 'undefined') {
|
22
|
22
|
// missing this.analytics but have window implementation, let's use it
|
23
|
23
|
if (window.Analytics) {
|
|
@@ -26,14 +26,16 @@ AnalyticsAdapter.prototype.sendEvent = function (action, data) {
|
26
|
26
|
else {
|
27
|
27
|
AnalyticsAdapter.eventsQueue.push({
|
28
|
28
|
action: action,
|
29
|
|
- data: data
|
|
29
|
+ data: data,
|
|
30
|
+ label: label
|
30
|
31
|
});
|
31
|
32
|
// stored, lets break here
|
32
|
33
|
return;
|
33
|
34
|
}
|
34
|
35
|
}
|
35
|
36
|
try {
|
36
|
|
- this.analytics.sendEvent(action + this.browserActionSuffix, data);
|
|
37
|
+ this.analytics.sendEvent(
|
|
38
|
+ action + this.browserActionSuffix, data, label);
|
37
|
39
|
} catch (ignored) {}
|
38
|
40
|
};
|
39
|
41
|
|
|
@@ -57,7 +59,7 @@ AnalyticsAdapter.prototype.loaded = function () {
|
57
|
59
|
// new analytics lets send all events if any
|
58
|
60
|
if (AnalyticsAdapter.eventsQueue.length) {
|
59
|
61
|
AnalyticsAdapter.eventsQueue.forEach(function (event) {
|
60
|
|
- this.sendEvent(event.action, event.data);
|
|
62
|
+ this.sendEvent(event.action, event.data. event.label);
|
61
|
63
|
}.bind(this));
|
62
|
64
|
AnalyticsAdapter.eventsQueue.length = 0;
|
63
|
65
|
}
|