angulartics2 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular-router.d.ts +3 -0
- package/angulartics2-core.d.ts +3 -0
- package/angulartics2.d.ts +1 -0
- package/angulartics2.module.d.ts +5 -0
- package/angulartics2On.d.ts +6 -0
- package/esm2020/angular-router.mjs +33 -0
- package/{esm2015/angulartics2-config.js → esm2020/angulartics2-config.mjs} +0 -0
- package/esm2020/angulartics2-core.mjs +93 -0
- package/{esm2015/angulartics2-interfaces.js → esm2020/angulartics2-interfaces.mjs} +0 -0
- package/{esm2015/angulartics2-token.js → esm2020/angulartics2-token.mjs} +0 -0
- package/{esm2015/angulartics2.js → esm2020/angulartics2.mjs} +0 -0
- package/esm2020/angulartics2.module.mjs +30 -0
- package/esm2020/angulartics2On.mjs +66 -0
- package/esm2020/providers/adobeanalytics/adobeanalytics.mjs +98 -0
- package/esm2020/providers/amplitude/amplitude.mjs +68 -0
- package/esm2020/providers/appinsights/appinsights.mjs +118 -0
- package/esm2020/providers/baidu/baidu.mjs +81 -0
- package/{esm2015/providers/clicky/clicky.interfaces.js → esm2020/providers/clicky/clicky.interfaces.mjs} +0 -0
- package/esm2020/providers/clicky/clicky.mjs +64 -0
- package/esm2020/providers/facebook/facebook.mjs +45 -0
- package/esm2020/providers/ga/ga.mjs +219 -0
- package/{esm2015/providers/ga-enhanced-ecom/ga-enhanced-ecom-options.js → esm2020/providers/ga-enhanced-ecom/ga-enhanced-ecom-options.mjs} +0 -0
- package/esm2020/providers/ga-enhanced-ecom/ga-enhanced-ecom.mjs +32 -0
- package/esm2020/providers/gosquared/gosquared.mjs +55 -0
- package/{esm2015/providers/gst/gst-interfaces.js → esm2020/providers/gst/gst-interfaces.mjs} +0 -0
- package/esm2020/providers/gst/gst.mjs +197 -0
- package/esm2020/providers/gtm/gtm.mjs +114 -0
- package/esm2020/providers/hubspot/hubspot.mjs +40 -0
- package/esm2020/providers/ibm-digital-analytics/ibm-digital-analytics.mjs +125 -0
- package/esm2020/providers/intercom/intercom.mjs +60 -0
- package/esm2020/providers/kissmetrics/kissmetrics.mjs +40 -0
- package/esm2020/providers/launch/launch.mjs +59 -0
- package/esm2020/providers/matomo/matomo.mjs +303 -0
- package/esm2020/providers/mixpanel/mixpanel.mjs +109 -0
- package/esm2020/providers/pyze/pyze.mjs +65 -0
- package/esm2020/providers/segment/segment.mjs +100 -0
- package/esm2020/providers/splunk/splunk.mjs +46 -0
- package/esm2020/providers/woopra/woopra.mjs +61 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/routerless.js → esm2020/routerless.mjs} +0 -0
- package/esm2020/routerless.module.mjs +28 -0
- package/fesm2015/{angulartics2.js → angulartics2.mjs} +201 -210
- package/fesm2015/angulartics2.mjs.map +1 -0
- package/fesm2020/angulartics2.mjs +2294 -0
- package/fesm2020/angulartics2.mjs.map +1 -0
- package/package.json +23 -11
- package/providers/adobeanalytics/README.md +12 -0
- package/providers/adobeanalytics/adobeanalytics.d.ts +3 -0
- package/providers/amplitude/README.md +12 -0
- package/providers/amplitude/amplitude.d.ts +3 -0
- package/providers/appinsights/README.md +12 -0
- package/providers/appinsights/appinsights.d.ts +3 -0
- package/providers/baidu/README.md +12 -0
- package/providers/baidu/baidu.d.ts +3 -0
- package/providers/clicky/README.md +93 -0
- package/providers/clicky/clicky.d.ts +3 -0
- package/providers/facebook/README.md +36 -0
- package/providers/facebook/facebook.d.ts +3 -0
- package/providers/ga/README.md +25 -0
- package/providers/ga/ga.d.ts +3 -0
- package/providers/ga-enhanced-ecom/README.md +12 -0
- package/providers/ga-enhanced-ecom/ga-enhanced-ecom.d.ts +3 -0
- package/providers/gosquared/README.md +12 -0
- package/providers/gosquared/gosquared.d.ts +3 -0
- package/providers/gst/README.md +110 -0
- package/providers/gst/gst.d.ts +3 -0
- package/providers/gtm/README.md +58 -0
- package/providers/gtm/gtm.d.ts +3 -0
- package/providers/hubspot/README.md +12 -0
- package/providers/hubspot/hubspot.d.ts +3 -0
- package/providers/ibm-digital-analytics/README.md +123 -0
- package/providers/ibm-digital-analytics/ibm-digital-analytics.d.ts +3 -0
- package/providers/intercom/README.md +12 -0
- package/providers/intercom/intercom.d.ts +3 -0
- package/providers/kissmetrics/README.md +12 -0
- package/providers/kissmetrics/kissmetrics.d.ts +3 -0
- package/providers/launch/README.md +59 -0
- package/providers/launch/launch.d.ts +3 -0
- package/providers/matomo/README.md +74 -0
- package/providers/matomo/matomo.d.ts +3 -0
- package/providers/mixpanel/README.md +105 -0
- package/providers/mixpanel/mixpanel.d.ts +3 -0
- package/providers/pyze/README.md +21 -0
- package/providers/pyze/pyze.d.ts +3 -0
- package/providers/segment/README.md +50 -0
- package/providers/segment/segment.d.ts +3 -0
- package/providers/splunk/README.md +57 -0
- package/providers/splunk/splunk.d.ts +3 -0
- package/providers/woopra/README.md +12 -0
- package/providers/woopra/woopra.d.ts +3 -0
- package/routerless.module.d.ts +5 -0
- package/angulartics2.metadata.json +0 -1
- package/bundles/angulartics2.umd.js +0 -2821
- package/bundles/angulartics2.umd.js.map +0 -1
- package/esm2015/angular-router.js +0 -36
- package/esm2015/angulartics2-core.js +0 -91
- package/esm2015/angulartics2.module.js +0 -25
- package/esm2015/angulartics2On.js +0 -55
- package/esm2015/providers/adobeanalytics/adobeanalytics.js +0 -102
- package/esm2015/providers/amplitude/amplitude.js +0 -70
- package/esm2015/providers/appinsights/appinsights.js +0 -120
- package/esm2015/providers/baidu/baidu.js +0 -83
- package/esm2015/providers/clicky/clicky.js +0 -68
- package/esm2015/providers/facebook/facebook.js +0 -47
- package/esm2015/providers/ga/ga.js +0 -208
- package/esm2015/providers/ga-enhanced-ecom/ga-enhanced-ecom.js +0 -30
- package/esm2015/providers/gosquared/gosquared.js +0 -57
- package/esm2015/providers/gst/gst.js +0 -182
- package/esm2015/providers/gtm/gtm.js +0 -107
- package/esm2015/providers/hubspot/hubspot.js +0 -42
- package/esm2015/providers/ibm-digital-analytics/ibm-digital-analytics.js +0 -127
- package/esm2015/providers/intercom/intercom.js +0 -62
- package/esm2015/providers/kissmetrics/kissmetrics.js +0 -42
- package/esm2015/providers/launch/launch.js +0 -61
- package/esm2015/providers/matomo/matomo.js +0 -305
- package/esm2015/providers/mixpanel/mixpanel.js +0 -111
- package/esm2015/providers/pyze/pyze.js +0 -67
- package/esm2015/providers/segment/segment.js +0 -102
- package/esm2015/providers/splunk/splunk.js +0 -48
- package/esm2015/providers/woopra/woopra.js +0 -63
- package/esm2015/routerless.module.js +0 -23
- package/fesm2015/angulartics2.js.map +0 -1
@@ -1,2821 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/router'), require('@angular/platform-browser')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('angulartics2', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/router', '@angular/platform-browser'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.angulartics2 = {}, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.router, global.ng.platformBrowser));
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i2, i1, i2$1) { 'use strict';
|
6
|
-
|
7
|
-
function _interopNamespace(e) {
|
8
|
-
if (e && e.__esModule) return e;
|
9
|
-
var n = Object.create(null);
|
10
|
-
if (e) {
|
11
|
-
Object.keys(e).forEach(function (k) {
|
12
|
-
if (k !== 'default') {
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
15
|
-
enumerable: true,
|
16
|
-
get: function () { return e[k]; }
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|
21
|
-
n["default"] = e;
|
22
|
-
return Object.freeze(n);
|
23
|
-
}
|
24
|
-
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
26
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
27
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
28
|
-
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
29
|
-
|
30
|
-
/*! *****************************************************************************
|
31
|
-
Copyright (c) Microsoft Corporation.
|
32
|
-
|
33
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
34
|
-
purpose with or without fee is hereby granted.
|
35
|
-
|
36
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
37
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
38
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
39
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
40
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
41
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
42
|
-
PERFORMANCE OF THIS SOFTWARE.
|
43
|
-
***************************************************************************** */
|
44
|
-
/* global Reflect, Promise */
|
45
|
-
var extendStatics = function (d, b) {
|
46
|
-
extendStatics = Object.setPrototypeOf ||
|
47
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
48
|
-
function (d, b) { for (var p in b)
|
49
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
50
|
-
d[p] = b[p]; };
|
51
|
-
return extendStatics(d, b);
|
52
|
-
};
|
53
|
-
function __extends(d, b) {
|
54
|
-
if (typeof b !== "function" && b !== null)
|
55
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
56
|
-
extendStatics(d, b);
|
57
|
-
function __() { this.constructor = d; }
|
58
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
59
|
-
}
|
60
|
-
var __assign = function () {
|
61
|
-
__assign = Object.assign || function __assign(t) {
|
62
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
63
|
-
s = arguments[i];
|
64
|
-
for (var p in s)
|
65
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
66
|
-
t[p] = s[p];
|
67
|
-
}
|
68
|
-
return t;
|
69
|
-
};
|
70
|
-
return __assign.apply(this, arguments);
|
71
|
-
};
|
72
|
-
function __rest(s, e) {
|
73
|
-
var t = {};
|
74
|
-
for (var p in s)
|
75
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
76
|
-
t[p] = s[p];
|
77
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
78
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
79
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
80
|
-
t[p[i]] = s[p[i]];
|
81
|
-
}
|
82
|
-
return t;
|
83
|
-
}
|
84
|
-
function __decorate(decorators, target, key, desc) {
|
85
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
86
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
87
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
88
|
-
else
|
89
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
90
|
-
if (d = decorators[i])
|
91
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
92
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
93
|
-
}
|
94
|
-
function __param(paramIndex, decorator) {
|
95
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
96
|
-
}
|
97
|
-
function __metadata(metadataKey, metadataValue) {
|
98
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
99
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
100
|
-
}
|
101
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
102
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
103
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
104
|
-
function fulfilled(value) { try {
|
105
|
-
step(generator.next(value));
|
106
|
-
}
|
107
|
-
catch (e) {
|
108
|
-
reject(e);
|
109
|
-
} }
|
110
|
-
function rejected(value) { try {
|
111
|
-
step(generator["throw"](value));
|
112
|
-
}
|
113
|
-
catch (e) {
|
114
|
-
reject(e);
|
115
|
-
} }
|
116
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
117
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
118
|
-
});
|
119
|
-
}
|
120
|
-
function __generator(thisArg, body) {
|
121
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
122
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
123
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
124
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
125
|
-
function step(op) {
|
126
|
-
if (f)
|
127
|
-
throw new TypeError("Generator is already executing.");
|
128
|
-
while (_)
|
129
|
-
try {
|
130
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
131
|
-
return t;
|
132
|
-
if (y = 0, t)
|
133
|
-
op = [op[0] & 2, t.value];
|
134
|
-
switch (op[0]) {
|
135
|
-
case 0:
|
136
|
-
case 1:
|
137
|
-
t = op;
|
138
|
-
break;
|
139
|
-
case 4:
|
140
|
-
_.label++;
|
141
|
-
return { value: op[1], done: false };
|
142
|
-
case 5:
|
143
|
-
_.label++;
|
144
|
-
y = op[1];
|
145
|
-
op = [0];
|
146
|
-
continue;
|
147
|
-
case 7:
|
148
|
-
op = _.ops.pop();
|
149
|
-
_.trys.pop();
|
150
|
-
continue;
|
151
|
-
default:
|
152
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
153
|
-
_ = 0;
|
154
|
-
continue;
|
155
|
-
}
|
156
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
157
|
-
_.label = op[1];
|
158
|
-
break;
|
159
|
-
}
|
160
|
-
if (op[0] === 6 && _.label < t[1]) {
|
161
|
-
_.label = t[1];
|
162
|
-
t = op;
|
163
|
-
break;
|
164
|
-
}
|
165
|
-
if (t && _.label < t[2]) {
|
166
|
-
_.label = t[2];
|
167
|
-
_.ops.push(op);
|
168
|
-
break;
|
169
|
-
}
|
170
|
-
if (t[2])
|
171
|
-
_.ops.pop();
|
172
|
-
_.trys.pop();
|
173
|
-
continue;
|
174
|
-
}
|
175
|
-
op = body.call(thisArg, _);
|
176
|
-
}
|
177
|
-
catch (e) {
|
178
|
-
op = [6, e];
|
179
|
-
y = 0;
|
180
|
-
}
|
181
|
-
finally {
|
182
|
-
f = t = 0;
|
183
|
-
}
|
184
|
-
if (op[0] & 5)
|
185
|
-
throw op[1];
|
186
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
187
|
-
}
|
188
|
-
}
|
189
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
190
|
-
if (k2 === undefined)
|
191
|
-
k2 = k;
|
192
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
193
|
-
}) : (function (o, m, k, k2) {
|
194
|
-
if (k2 === undefined)
|
195
|
-
k2 = k;
|
196
|
-
o[k2] = m[k];
|
197
|
-
});
|
198
|
-
function __exportStar(m, o) {
|
199
|
-
for (var p in m)
|
200
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
201
|
-
__createBinding(o, m, p);
|
202
|
-
}
|
203
|
-
function __values(o) {
|
204
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
205
|
-
if (m)
|
206
|
-
return m.call(o);
|
207
|
-
if (o && typeof o.length === "number")
|
208
|
-
return {
|
209
|
-
next: function () {
|
210
|
-
if (o && i >= o.length)
|
211
|
-
o = void 0;
|
212
|
-
return { value: o && o[i++], done: !o };
|
213
|
-
}
|
214
|
-
};
|
215
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
216
|
-
}
|
217
|
-
function __read(o, n) {
|
218
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
219
|
-
if (!m)
|
220
|
-
return o;
|
221
|
-
var i = m.call(o), r, ar = [], e;
|
222
|
-
try {
|
223
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
224
|
-
ar.push(r.value);
|
225
|
-
}
|
226
|
-
catch (error) {
|
227
|
-
e = { error: error };
|
228
|
-
}
|
229
|
-
finally {
|
230
|
-
try {
|
231
|
-
if (r && !r.done && (m = i["return"]))
|
232
|
-
m.call(i);
|
233
|
-
}
|
234
|
-
finally {
|
235
|
-
if (e)
|
236
|
-
throw e.error;
|
237
|
-
}
|
238
|
-
}
|
239
|
-
return ar;
|
240
|
-
}
|
241
|
-
/** @deprecated */
|
242
|
-
function __spread() {
|
243
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
244
|
-
ar = ar.concat(__read(arguments[i]));
|
245
|
-
return ar;
|
246
|
-
}
|
247
|
-
/** @deprecated */
|
248
|
-
function __spreadArrays() {
|
249
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
250
|
-
s += arguments[i].length;
|
251
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
252
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
253
|
-
r[k] = a[j];
|
254
|
-
return r;
|
255
|
-
}
|
256
|
-
function __spreadArray(to, from, pack) {
|
257
|
-
if (pack || arguments.length === 2)
|
258
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
259
|
-
if (ar || !(i in from)) {
|
260
|
-
if (!ar)
|
261
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
262
|
-
ar[i] = from[i];
|
263
|
-
}
|
264
|
-
}
|
265
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
266
|
-
}
|
267
|
-
function __await(v) {
|
268
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
269
|
-
}
|
270
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
271
|
-
if (!Symbol.asyncIterator)
|
272
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
273
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
274
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
275
|
-
function verb(n) { if (g[n])
|
276
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
277
|
-
function resume(n, v) { try {
|
278
|
-
step(g[n](v));
|
279
|
-
}
|
280
|
-
catch (e) {
|
281
|
-
settle(q[0][3], e);
|
282
|
-
} }
|
283
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
284
|
-
function fulfill(value) { resume("next", value); }
|
285
|
-
function reject(value) { resume("throw", value); }
|
286
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
287
|
-
resume(q[0][0], q[0][1]); }
|
288
|
-
}
|
289
|
-
function __asyncDelegator(o) {
|
290
|
-
var i, p;
|
291
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
292
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
293
|
-
}
|
294
|
-
function __asyncValues(o) {
|
295
|
-
if (!Symbol.asyncIterator)
|
296
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
297
|
-
var m = o[Symbol.asyncIterator], i;
|
298
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
299
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
300
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
301
|
-
}
|
302
|
-
function __makeTemplateObject(cooked, raw) {
|
303
|
-
if (Object.defineProperty) {
|
304
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
305
|
-
}
|
306
|
-
else {
|
307
|
-
cooked.raw = raw;
|
308
|
-
}
|
309
|
-
return cooked;
|
310
|
-
}
|
311
|
-
;
|
312
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
313
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
314
|
-
}) : function (o, v) {
|
315
|
-
o["default"] = v;
|
316
|
-
};
|
317
|
-
function __importStar(mod) {
|
318
|
-
if (mod && mod.__esModule)
|
319
|
-
return mod;
|
320
|
-
var result = {};
|
321
|
-
if (mod != null)
|
322
|
-
for (var k in mod)
|
323
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
324
|
-
__createBinding(result, mod, k);
|
325
|
-
__setModuleDefault(result, mod);
|
326
|
-
return result;
|
327
|
-
}
|
328
|
-
function __importDefault(mod) {
|
329
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
330
|
-
}
|
331
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
332
|
-
if (kind === "a" && !f)
|
333
|
-
throw new TypeError("Private accessor was defined without a getter");
|
334
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
335
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
336
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
337
|
-
}
|
338
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
339
|
-
if (kind === "m")
|
340
|
-
throw new TypeError("Private method is not writable");
|
341
|
-
if (kind === "a" && !f)
|
342
|
-
throw new TypeError("Private accessor was defined without a setter");
|
343
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
344
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
345
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
346
|
-
}
|
347
|
-
|
348
|
-
var DefaultConfig = /** @class */ (function () {
|
349
|
-
function DefaultConfig() {
|
350
|
-
this.pageTracking = {
|
351
|
-
autoTrackVirtualPages: true,
|
352
|
-
basePath: '',
|
353
|
-
excludedRoutes: [],
|
354
|
-
clearIds: false,
|
355
|
-
clearHash: false,
|
356
|
-
clearQueryParams: false,
|
357
|
-
idsRegExp: /^\d+$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
358
|
-
};
|
359
|
-
this.developerMode = false;
|
360
|
-
this.ga = {};
|
361
|
-
this.appInsights = {};
|
362
|
-
this.gtm = {};
|
363
|
-
this.gst = {};
|
364
|
-
}
|
365
|
-
return DefaultConfig;
|
366
|
-
}());
|
367
|
-
|
368
|
-
var ANGULARTICS2_TOKEN = new i0.InjectionToken('ANGULARTICS2');
|
369
|
-
|
370
|
-
var RouterlessTracking = /** @class */ (function () {
|
371
|
-
function RouterlessTracking() {
|
372
|
-
}
|
373
|
-
RouterlessTracking.prototype.trackLocation = function (settings) {
|
374
|
-
return new rxjs.BehaviorSubject({ url: '/' });
|
375
|
-
};
|
376
|
-
RouterlessTracking.prototype.prepareExternalUrl = function (url) {
|
377
|
-
return url;
|
378
|
-
};
|
379
|
-
return RouterlessTracking;
|
380
|
-
}());
|
381
|
-
|
382
|
-
var Angulartics2 = /** @class */ (function () {
|
383
|
-
function Angulartics2(tracker, setup) {
|
384
|
-
var _this = this;
|
385
|
-
this.tracker = tracker;
|
386
|
-
this.pageTrack = new rxjs.ReplaySubject(10);
|
387
|
-
this.eventTrack = new rxjs.ReplaySubject(10);
|
388
|
-
this.exceptionTrack = new rxjs.ReplaySubject(10);
|
389
|
-
this.setAlias = new rxjs.ReplaySubject(10);
|
390
|
-
this.setUsername = new rxjs.ReplaySubject(10);
|
391
|
-
this.setUserProperties = new rxjs.ReplaySubject(10);
|
392
|
-
this.setUserPropertiesOnce = new rxjs.ReplaySubject(10);
|
393
|
-
this.setSuperProperties = new rxjs.ReplaySubject(10);
|
394
|
-
this.setSuperPropertiesOnce = new rxjs.ReplaySubject(10);
|
395
|
-
this.userTimings = new rxjs.ReplaySubject(10);
|
396
|
-
var defaultConfig = new DefaultConfig();
|
397
|
-
this.settings = Object.assign(Object.assign({}, defaultConfig), setup.settings);
|
398
|
-
this.settings.pageTracking = Object.assign(Object.assign({}, defaultConfig.pageTracking), setup.settings.pageTracking);
|
399
|
-
this.tracker
|
400
|
-
.trackLocation(this.settings)
|
401
|
-
.subscribe(function (event) { return _this.trackUrlChange(event.url); });
|
402
|
-
}
|
403
|
-
/** filters all events when developer mode is true */
|
404
|
-
Angulartics2.prototype.filterDeveloperMode = function () {
|
405
|
-
var _this = this;
|
406
|
-
return operators.filter(function (value, index) { return !_this.settings.developerMode; });
|
407
|
-
};
|
408
|
-
Angulartics2.prototype.trackUrlChange = function (url) {
|
409
|
-
if (this.settings.pageTracking.autoTrackVirtualPages && !this.matchesExcludedRoute(url)) {
|
410
|
-
var clearedUrl = this.clearUrl(url);
|
411
|
-
var path = void 0;
|
412
|
-
if (this.settings.pageTracking.basePath.length) {
|
413
|
-
path = this.settings.pageTracking.basePath + clearedUrl;
|
414
|
-
}
|
415
|
-
else {
|
416
|
-
path = this.tracker.prepareExternalUrl(clearedUrl);
|
417
|
-
}
|
418
|
-
this.pageTrack.next({ path: path });
|
419
|
-
}
|
420
|
-
};
|
421
|
-
/**
|
422
|
-
* Use string literals or regular expressions to exclude routes
|
423
|
-
* from automatic pageview tracking.
|
424
|
-
*
|
425
|
-
* @param url location
|
426
|
-
*/
|
427
|
-
Angulartics2.prototype.matchesExcludedRoute = function (url) {
|
428
|
-
var e_1, _a;
|
429
|
-
try {
|
430
|
-
for (var _b = __values(this.settings.pageTracking.excludedRoutes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
431
|
-
var excludedRoute = _c.value;
|
432
|
-
var matchesRegex = excludedRoute instanceof RegExp && excludedRoute.test(url);
|
433
|
-
if (matchesRegex || url.indexOf(excludedRoute) !== -1) {
|
434
|
-
return true;
|
435
|
-
}
|
436
|
-
}
|
437
|
-
}
|
438
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
439
|
-
finally {
|
440
|
-
try {
|
441
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
442
|
-
}
|
443
|
-
finally { if (e_1) throw e_1.error; }
|
444
|
-
}
|
445
|
-
return false;
|
446
|
-
};
|
447
|
-
/**
|
448
|
-
* Removes id's from tracked route.
|
449
|
-
* EX: `/project/12981/feature` becomes `/project/feature`
|
450
|
-
*
|
451
|
-
* @param url current page path
|
452
|
-
*/
|
453
|
-
Angulartics2.prototype.clearUrl = function (url) {
|
454
|
-
var _this = this;
|
455
|
-
if (this.settings.pageTracking.clearIds ||
|
456
|
-
this.settings.pageTracking.clearQueryParams ||
|
457
|
-
this.settings.pageTracking.clearHash) {
|
458
|
-
return url
|
459
|
-
.split('/')
|
460
|
-
.map(function (part) { return (_this.settings.pageTracking.clearQueryParams ? part.split('?')[0] : part); })
|
461
|
-
.map(function (part) { return (_this.settings.pageTracking.clearHash ? part.split('#')[0] : part); })
|
462
|
-
.filter(function (part) { return !_this.settings.pageTracking.clearIds ||
|
463
|
-
!part.match(_this.settings.pageTracking.idsRegExp); })
|
464
|
-
.join('/');
|
465
|
-
}
|
466
|
-
return url;
|
467
|
-
};
|
468
|
-
return Angulartics2;
|
469
|
-
}());
|
470
|
-
Angulartics2.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2_Factory() { return new Angulartics2(i0__namespace.ɵɵinject(RouterlessTracking), i0__namespace.ɵɵinject(ANGULARTICS2_TOKEN)); }, token: Angulartics2, providedIn: "root" });
|
471
|
-
Angulartics2.decorators = [
|
472
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
473
|
-
];
|
474
|
-
Angulartics2.ctorParameters = function () { return [
|
475
|
-
{ type: RouterlessTracking },
|
476
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [ANGULARTICS2_TOKEN,] }] }
|
477
|
-
]; };
|
478
|
-
|
479
|
-
/**
|
480
|
-
* Track Route changes for applications using Angular's
|
481
|
-
* default router
|
482
|
-
*
|
483
|
-
* @link https://angular.io/api/router/Router
|
484
|
-
*/
|
485
|
-
var AngularRouterTracking = /** @class */ (function () {
|
486
|
-
function AngularRouterTracking(router, location) {
|
487
|
-
this.router = router;
|
488
|
-
this.location = location;
|
489
|
-
}
|
490
|
-
AngularRouterTracking.prototype.trackLocation = function (settings) {
|
491
|
-
return this.router.events.pipe(operators.filter(function (e) { return e instanceof i1.NavigationEnd; }), operators.filter(function () { return !settings.developerMode; }), operators.map(function (e) {
|
492
|
-
return { url: e.urlAfterRedirects };
|
493
|
-
}), operators.delay(0));
|
494
|
-
};
|
495
|
-
AngularRouterTracking.prototype.prepareExternalUrl = function (url) {
|
496
|
-
return this.location.prepareExternalUrl(url);
|
497
|
-
};
|
498
|
-
return AngularRouterTracking;
|
499
|
-
}());
|
500
|
-
AngularRouterTracking.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AngularRouterTracking_Factory() { return new AngularRouterTracking(i0__namespace.ɵɵinject(i1__namespace.Router), i0__namespace.ɵɵinject(i2__namespace.Location)); }, token: AngularRouterTracking, providedIn: "root" });
|
501
|
-
AngularRouterTracking.decorators = [
|
502
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
503
|
-
];
|
504
|
-
AngularRouterTracking.ctorParameters = function () { return [
|
505
|
-
{ type: i1.Router },
|
506
|
-
{ type: i2.Location }
|
507
|
-
]; };
|
508
|
-
|
509
|
-
var Angulartics2On = /** @class */ (function () {
|
510
|
-
function Angulartics2On(elRef, angulartics2, renderer) {
|
511
|
-
this.elRef = elRef;
|
512
|
-
this.angulartics2 = angulartics2;
|
513
|
-
this.renderer = renderer;
|
514
|
-
this.angularticsProperties = {};
|
515
|
-
}
|
516
|
-
Angulartics2On.prototype.ngAfterContentInit = function () {
|
517
|
-
var _this = this;
|
518
|
-
this.renderer.listen(this.elRef.nativeElement, this.angulartics2On || 'click', function (event) { return _this.eventTrack(event); });
|
519
|
-
};
|
520
|
-
Angulartics2On.prototype.eventTrack = function (event) {
|
521
|
-
var action = this.angularticsAction; // || this.inferEventName();
|
522
|
-
var properties = Object.assign(Object.assign({}, this.angularticsProperties), { eventType: event.type });
|
523
|
-
if (this.angularticsCategory) {
|
524
|
-
properties.category = this.angularticsCategory;
|
525
|
-
}
|
526
|
-
if (this.angularticsLabel) {
|
527
|
-
properties.label = this.angularticsLabel;
|
528
|
-
}
|
529
|
-
if (this.angularticsValue) {
|
530
|
-
properties.value = this.angularticsValue;
|
531
|
-
}
|
532
|
-
this.angulartics2.eventTrack.next({
|
533
|
-
action: action,
|
534
|
-
properties: properties,
|
535
|
-
});
|
536
|
-
};
|
537
|
-
return Angulartics2On;
|
538
|
-
}());
|
539
|
-
Angulartics2On.decorators = [
|
540
|
-
{ type: i0.Directive, args: [{ selector: '[angulartics2On]' },] }
|
541
|
-
];
|
542
|
-
Angulartics2On.ctorParameters = function () { return [
|
543
|
-
{ type: i0.ElementRef },
|
544
|
-
{ type: Angulartics2 },
|
545
|
-
{ type: i0.Renderer2 }
|
546
|
-
]; };
|
547
|
-
Angulartics2On.propDecorators = {
|
548
|
-
angulartics2On: [{ type: i0.Input, args: ['angulartics2On',] }],
|
549
|
-
angularticsAction: [{ type: i0.Input }],
|
550
|
-
angularticsCategory: [{ type: i0.Input }],
|
551
|
-
angularticsLabel: [{ type: i0.Input }],
|
552
|
-
angularticsValue: [{ type: i0.Input }],
|
553
|
-
angularticsProperties: [{ type: i0.Input }]
|
554
|
-
};
|
555
|
-
var Angulartics2OnModule = /** @class */ (function () {
|
556
|
-
function Angulartics2OnModule() {
|
557
|
-
}
|
558
|
-
return Angulartics2OnModule;
|
559
|
-
}());
|
560
|
-
Angulartics2OnModule.decorators = [
|
561
|
-
{ type: i0.NgModule, args: [{
|
562
|
-
declarations: [Angulartics2On],
|
563
|
-
exports: [Angulartics2On],
|
564
|
-
},] }
|
565
|
-
];
|
566
|
-
|
567
|
-
var Angulartics2Module = /** @class */ (function () {
|
568
|
-
function Angulartics2Module() {
|
569
|
-
}
|
570
|
-
Angulartics2Module.forRoot = function (settings) {
|
571
|
-
if (settings === void 0) { settings = {}; }
|
572
|
-
return {
|
573
|
-
ngModule: Angulartics2Module,
|
574
|
-
providers: [
|
575
|
-
{ provide: ANGULARTICS2_TOKEN, useValue: { settings: settings } },
|
576
|
-
{ provide: RouterlessTracking, useClass: AngularRouterTracking },
|
577
|
-
Angulartics2,
|
578
|
-
],
|
579
|
-
};
|
580
|
-
};
|
581
|
-
return Angulartics2Module;
|
582
|
-
}());
|
583
|
-
Angulartics2Module.decorators = [
|
584
|
-
{ type: i0.NgModule, args: [{
|
585
|
-
imports: [Angulartics2OnModule],
|
586
|
-
exports: [Angulartics2On],
|
587
|
-
},] }
|
588
|
-
];
|
589
|
-
|
590
|
-
var Angulartics2RouterlessModule = /** @class */ (function () {
|
591
|
-
function Angulartics2RouterlessModule() {
|
592
|
-
}
|
593
|
-
Angulartics2RouterlessModule.forRoot = function (settings) {
|
594
|
-
if (settings === void 0) { settings = {}; }
|
595
|
-
return {
|
596
|
-
ngModule: Angulartics2RouterlessModule,
|
597
|
-
providers: [
|
598
|
-
{ provide: ANGULARTICS2_TOKEN, useValue: { settings: settings } },
|
599
|
-
RouterlessTracking,
|
600
|
-
Angulartics2,
|
601
|
-
],
|
602
|
-
};
|
603
|
-
};
|
604
|
-
return Angulartics2RouterlessModule;
|
605
|
-
}());
|
606
|
-
Angulartics2RouterlessModule.decorators = [
|
607
|
-
{ type: i0.NgModule, args: [{
|
608
|
-
imports: [Angulartics2OnModule],
|
609
|
-
},] }
|
610
|
-
];
|
611
|
-
|
612
|
-
var Angulartics2AdobeAnalytics = /** @class */ (function () {
|
613
|
-
function Angulartics2AdobeAnalytics(angulartics2, location) {
|
614
|
-
var _this = this;
|
615
|
-
this.angulartics2 = angulartics2;
|
616
|
-
this.location = location;
|
617
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
618
|
-
}
|
619
|
-
Angulartics2AdobeAnalytics.prototype.startTracking = function () {
|
620
|
-
var _this = this;
|
621
|
-
this.angulartics2.pageTrack
|
622
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
623
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
624
|
-
this.angulartics2.eventTrack
|
625
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
626
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
627
|
-
};
|
628
|
-
Angulartics2AdobeAnalytics.prototype.pageTrack = function (path) {
|
629
|
-
if (typeof s !== 'undefined' && s) {
|
630
|
-
s.clearVars();
|
631
|
-
s.t({ pageName: path });
|
632
|
-
}
|
633
|
-
};
|
634
|
-
/**
|
635
|
-
* Track Event in Adobe Analytics
|
636
|
-
*
|
637
|
-
* @param action associated with the event
|
638
|
-
* @param properties action detials
|
639
|
-
*
|
640
|
-
* @link https://marketing.adobe.com/resources/help/en_US/sc/implement/js_implementation.html
|
641
|
-
*/
|
642
|
-
Angulartics2AdobeAnalytics.prototype.eventTrack = function (action, properties) {
|
643
|
-
// TODO: make interface
|
644
|
-
// @property {string} properties.category
|
645
|
-
// @property {string} properties.label
|
646
|
-
// @property {number} properties.value
|
647
|
-
// @property {boolean} properties.noninteraction
|
648
|
-
if (!properties) {
|
649
|
-
properties = properties || {};
|
650
|
-
}
|
651
|
-
if (typeof s !== 'undefined' && s) {
|
652
|
-
if (typeof properties === 'object') {
|
653
|
-
this.setUserProperties(properties);
|
654
|
-
}
|
655
|
-
if (action) {
|
656
|
-
// if linkName property is passed, use that; otherwise, the action is the linkName
|
657
|
-
var linkName = properties['linkName'] ? properties['linkName'] : action;
|
658
|
-
// note that 'this' should refer the link element, but we can't get that in this function. example:
|
659
|
-
// <a href="http://anothersite.com" onclick="s.tl(this,'e','AnotherSite',null)">
|
660
|
-
// if disableDelay property is passed, use that to turn off/on the 500ms delay; otherwise, it uses this
|
661
|
-
var disableDelay = !!properties['disableDelay'] ? true : this;
|
662
|
-
// if action property is passed, use that; otherwise, the action remains unchanged
|
663
|
-
if (properties['action']) {
|
664
|
-
action = properties['action'];
|
665
|
-
}
|
666
|
-
this.setPageName();
|
667
|
-
if (action.toUpperCase() === 'DOWNLOAD') {
|
668
|
-
s.tl(disableDelay, 'd', linkName);
|
669
|
-
}
|
670
|
-
else if (action.toUpperCase() === 'EXIT') {
|
671
|
-
s.tl(disableDelay, 'e', linkName);
|
672
|
-
}
|
673
|
-
else {
|
674
|
-
s.tl(disableDelay, 'o', linkName);
|
675
|
-
}
|
676
|
-
}
|
677
|
-
}
|
678
|
-
};
|
679
|
-
Angulartics2AdobeAnalytics.prototype.setPageName = function () {
|
680
|
-
var path = this.location.path(true);
|
681
|
-
var hashNdx = path.indexOf('#');
|
682
|
-
if (hashNdx > 0 && hashNdx < path.length) {
|
683
|
-
s.pageName = path.substring(hashNdx + 1);
|
684
|
-
}
|
685
|
-
else {
|
686
|
-
s.pageName = path;
|
687
|
-
}
|
688
|
-
};
|
689
|
-
Angulartics2AdobeAnalytics.prototype.setUserProperties = function (properties) {
|
690
|
-
if (typeof s !== 'undefined' && s) {
|
691
|
-
if (typeof properties === 'object') {
|
692
|
-
for (var key in properties) {
|
693
|
-
if (properties.hasOwnProperty(key)) {
|
694
|
-
s[key] = properties[key];
|
695
|
-
}
|
696
|
-
}
|
697
|
-
}
|
698
|
-
}
|
699
|
-
};
|
700
|
-
return Angulartics2AdobeAnalytics;
|
701
|
-
}());
|
702
|
-
Angulartics2AdobeAnalytics.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2AdobeAnalytics_Factory() { return new Angulartics2AdobeAnalytics(i0__namespace.ɵɵinject(Angulartics2), i0__namespace.ɵɵinject(i2__namespace.Location)); }, token: Angulartics2AdobeAnalytics, providedIn: "root" });
|
703
|
-
Angulartics2AdobeAnalytics.decorators = [
|
704
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
705
|
-
];
|
706
|
-
Angulartics2AdobeAnalytics.ctorParameters = function () { return [
|
707
|
-
{ type: Angulartics2 },
|
708
|
-
{ type: i2.Location }
|
709
|
-
]; };
|
710
|
-
|
711
|
-
var AppInsightsDefaults = /** @class */ (function () {
|
712
|
-
function AppInsightsDefaults() {
|
713
|
-
this.userId = null;
|
714
|
-
}
|
715
|
-
return AppInsightsDefaults;
|
716
|
-
}());
|
717
|
-
var Angulartics2AppInsights = /** @class */ (function () {
|
718
|
-
function Angulartics2AppInsights(angulartics2, title, router) {
|
719
|
-
var _this = this;
|
720
|
-
this.angulartics2 = angulartics2;
|
721
|
-
this.title = title;
|
722
|
-
this.router = router;
|
723
|
-
this.loadStartTime = null;
|
724
|
-
this.loadTime = null;
|
725
|
-
this.metrics = null;
|
726
|
-
this.dimensions = null;
|
727
|
-
this.measurements = null;
|
728
|
-
if (typeof appInsights === 'undefined') {
|
729
|
-
console.warn('appInsights not found');
|
730
|
-
}
|
731
|
-
var defaults = new AppInsightsDefaults();
|
732
|
-
// Set the default settings for this module
|
733
|
-
this.angulartics2.settings.appInsights = Object.assign(Object.assign({}, defaults), this.angulartics2.settings.appInsights);
|
734
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
735
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
736
|
-
}
|
737
|
-
Angulartics2AppInsights.prototype.startTracking = function () {
|
738
|
-
var _this = this;
|
739
|
-
this.angulartics2.pageTrack
|
740
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
741
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
742
|
-
this.angulartics2.eventTrack
|
743
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
744
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
745
|
-
this.angulartics2.exceptionTrack
|
746
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
747
|
-
.subscribe(function (x) { return _this.exceptionTrack(x); });
|
748
|
-
this.router.events
|
749
|
-
.pipe(this.angulartics2.filterDeveloperMode(), operators.filter(function (event) { return event instanceof i1.NavigationStart; }))
|
750
|
-
.subscribe(function (event) { return _this.startTimer(); });
|
751
|
-
this.router.events
|
752
|
-
.pipe(operators.filter(function (event) { return event instanceof i1.NavigationError || event instanceof i1.NavigationEnd; }))
|
753
|
-
.subscribe(function (error) { return _this.stopTimer(); });
|
754
|
-
};
|
755
|
-
Angulartics2AppInsights.prototype.startTimer = function () {
|
756
|
-
this.loadStartTime = Date.now();
|
757
|
-
this.loadTime = null;
|
758
|
-
};
|
759
|
-
Angulartics2AppInsights.prototype.stopTimer = function () {
|
760
|
-
this.loadTime = Date.now() - this.loadStartTime;
|
761
|
-
this.loadStartTime = null;
|
762
|
-
};
|
763
|
-
/**
|
764
|
-
* Page Track in Baidu Analytics
|
765
|
-
*
|
766
|
-
* @param path - Location 'path'
|
767
|
-
*
|
768
|
-
* @link https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#trackpageview
|
769
|
-
*/
|
770
|
-
Angulartics2AppInsights.prototype.pageTrack = function (path) {
|
771
|
-
appInsights.trackPageView(this.title.getTitle(), path, this.dimensions, this.metrics, this.loadTime);
|
772
|
-
};
|
773
|
-
/**
|
774
|
-
* Log a user action or other occurrence.
|
775
|
-
*
|
776
|
-
* @param name Name to identify this event in the portal.
|
777
|
-
* @param properties Additional data used to filter events and metrics in the portal. Defaults to empty.
|
778
|
-
*
|
779
|
-
* @link https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#trackevent
|
780
|
-
*/
|
781
|
-
Angulartics2AppInsights.prototype.eventTrack = function (name, properties) {
|
782
|
-
appInsights.trackEvent(name, properties, this.measurements);
|
783
|
-
};
|
784
|
-
/**
|
785
|
-
* Exception Track Event in GA
|
786
|
-
*
|
787
|
-
* @param properties - Comprised of the mandatory fields 'appId' (string), 'appName' (string) and 'appVersion' (string) and
|
788
|
-
* optional fields 'fatal' (boolean) and 'description' (string), error
|
789
|
-
*
|
790
|
-
* @link https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#trackexception
|
791
|
-
*/
|
792
|
-
Angulartics2AppInsights.prototype.exceptionTrack = function (properties) {
|
793
|
-
var description = properties.event || properties.description || properties;
|
794
|
-
appInsights.trackException(description);
|
795
|
-
};
|
796
|
-
/**
|
797
|
-
* @link https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#setauthenticatedusercontext
|
798
|
-
*/
|
799
|
-
Angulartics2AppInsights.prototype.setUsername = function (userId) {
|
800
|
-
this.angulartics2.settings.appInsights.userId = userId;
|
801
|
-
appInsights.setAuthenticatedUserContext(userId);
|
802
|
-
};
|
803
|
-
Angulartics2AppInsights.prototype.setUserProperties = function (properties) {
|
804
|
-
if (properties.userId) {
|
805
|
-
this.angulartics2.settings.appInsights.userId = properties.userId;
|
806
|
-
}
|
807
|
-
if (properties.accountId) {
|
808
|
-
appInsights.setAuthenticatedUserContext(this.angulartics2.settings.appInsights.userId, properties.accountId);
|
809
|
-
}
|
810
|
-
else {
|
811
|
-
appInsights.setAuthenticatedUserContext(this.angulartics2.settings.appInsights.userId);
|
812
|
-
}
|
813
|
-
};
|
814
|
-
return Angulartics2AppInsights;
|
815
|
-
}());
|
816
|
-
Angulartics2AppInsights.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2AppInsights_Factory() { return new Angulartics2AppInsights(i0__namespace.ɵɵinject(Angulartics2), i0__namespace.ɵɵinject(i2__namespace$1.Title), i0__namespace.ɵɵinject(i1__namespace.Router)); }, token: Angulartics2AppInsights, providedIn: "root" });
|
817
|
-
Angulartics2AppInsights.decorators = [
|
818
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
819
|
-
];
|
820
|
-
Angulartics2AppInsights.ctorParameters = function () { return [
|
821
|
-
{ type: Angulartics2 },
|
822
|
-
{ type: i2$1.Title },
|
823
|
-
{ type: i1.Router }
|
824
|
-
]; };
|
825
|
-
|
826
|
-
var Angulartics2BaiduAnalytics = /** @class */ (function () {
|
827
|
-
function Angulartics2BaiduAnalytics(angulartics2) {
|
828
|
-
var _this = this;
|
829
|
-
this.angulartics2 = angulartics2;
|
830
|
-
if (typeof _hmt === 'undefined') {
|
831
|
-
_hmt = [];
|
832
|
-
}
|
833
|
-
else {
|
834
|
-
_hmt.push(['_setAutoPageview', false]);
|
835
|
-
}
|
836
|
-
this.angulartics2.setUsername
|
837
|
-
.subscribe(function (x) { return _this.setUsername(x); });
|
838
|
-
this.angulartics2.setUserProperties
|
839
|
-
.subscribe(function (x) { return _this.setUserProperties(x); });
|
840
|
-
}
|
841
|
-
Angulartics2BaiduAnalytics.prototype.startTracking = function () {
|
842
|
-
var _this = this;
|
843
|
-
this.angulartics2.pageTrack
|
844
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
845
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
846
|
-
this.angulartics2.eventTrack
|
847
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
848
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
849
|
-
};
|
850
|
-
/**
|
851
|
-
* Page Track in Baidu Analytics
|
852
|
-
*
|
853
|
-
* @param path Required url 'path'
|
854
|
-
*
|
855
|
-
* @link http://tongji.baidu.com/open/api/more?p=ref_trackPageview
|
856
|
-
*/
|
857
|
-
Angulartics2BaiduAnalytics.prototype.pageTrack = function (path) {
|
858
|
-
if (typeof _hmt !== 'undefined' && _hmt) {
|
859
|
-
_hmt.push(['_trackPageview', path]);
|
860
|
-
}
|
861
|
-
};
|
862
|
-
/**
|
863
|
-
* Track Event in Baidu Analytics
|
864
|
-
*
|
865
|
-
* @param action Name associated with the event
|
866
|
-
* @param properties Comprised of:
|
867
|
-
* - 'category' (string)
|
868
|
-
* - 'opt_label' (string)
|
869
|
-
* - 'opt_value' (string)
|
870
|
-
*
|
871
|
-
* @link http://tongji.baidu.com/open/api/more?p=ref_trackEvent
|
872
|
-
*/
|
873
|
-
Angulartics2BaiduAnalytics.prototype.eventTrack = function (action, properties) {
|
874
|
-
// baidu analytics requires category
|
875
|
-
if (!properties || !properties.category) {
|
876
|
-
properties = properties || {};
|
877
|
-
properties.category = 'Event';
|
878
|
-
properties.opt_label = 'default';
|
879
|
-
properties.opt_value = 'default';
|
880
|
-
}
|
881
|
-
if (typeof _hmt !== 'undefined' && _hmt) {
|
882
|
-
_hmt.push([
|
883
|
-
'_trackEvent',
|
884
|
-
properties.category,
|
885
|
-
action,
|
886
|
-
properties.opt_label,
|
887
|
-
properties.opt_value,
|
888
|
-
]);
|
889
|
-
}
|
890
|
-
};
|
891
|
-
Angulartics2BaiduAnalytics.prototype.setUsername = function (userId) {
|
892
|
-
// set default custom variables name to 'identity' and 'value'
|
893
|
-
_hmt.push(['_setCustomVar', 1, 'identity', userId]);
|
894
|
-
};
|
895
|
-
Angulartics2BaiduAnalytics.prototype.setUserProperties = function (properties) {
|
896
|
-
_hmt.push(['_setCustomVar', 2, 'user', JSON.stringify(properties)]);
|
897
|
-
};
|
898
|
-
return Angulartics2BaiduAnalytics;
|
899
|
-
}());
|
900
|
-
Angulartics2BaiduAnalytics.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2BaiduAnalytics_Factory() { return new Angulartics2BaiduAnalytics(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2BaiduAnalytics, providedIn: "root" });
|
901
|
-
Angulartics2BaiduAnalytics.decorators = [
|
902
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
903
|
-
];
|
904
|
-
Angulartics2BaiduAnalytics.ctorParameters = function () { return [
|
905
|
-
{ type: Angulartics2 }
|
906
|
-
]; };
|
907
|
-
|
908
|
-
var facebookEventList = [
|
909
|
-
'ViewContent',
|
910
|
-
'Search',
|
911
|
-
'AddToCart',
|
912
|
-
'AddToWishlist',
|
913
|
-
'InitiateCheckout',
|
914
|
-
'AddPaymentInfo',
|
915
|
-
'Purchase',
|
916
|
-
'Lead',
|
917
|
-
'CompleteRegistration',
|
918
|
-
];
|
919
|
-
var Angulartics2Facebook = /** @class */ (function () {
|
920
|
-
function Angulartics2Facebook(angulartics2) {
|
921
|
-
this.angulartics2 = angulartics2;
|
922
|
-
}
|
923
|
-
Angulartics2Facebook.prototype.startTracking = function () {
|
924
|
-
var _this = this;
|
925
|
-
this.angulartics2.eventTrack
|
926
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
927
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
928
|
-
};
|
929
|
-
/**
|
930
|
-
* Send interactions to the Pixel, i.e. for event tracking in Pixel
|
931
|
-
*
|
932
|
-
* @param action action associated with the event
|
933
|
-
*/
|
934
|
-
Angulartics2Facebook.prototype.eventTrack = function (action, properties) {
|
935
|
-
if (properties === void 0) { properties = {}; }
|
936
|
-
if (typeof fbq === 'undefined') {
|
937
|
-
return;
|
938
|
-
}
|
939
|
-
if (facebookEventList.indexOf(action) === -1) {
|
940
|
-
return fbq('trackCustom', action, properties);
|
941
|
-
}
|
942
|
-
return fbq('track', action, properties);
|
943
|
-
};
|
944
|
-
return Angulartics2Facebook;
|
945
|
-
}());
|
946
|
-
Angulartics2Facebook.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Facebook_Factory() { return new Angulartics2Facebook(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Facebook, providedIn: "root" });
|
947
|
-
Angulartics2Facebook.decorators = [
|
948
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
949
|
-
];
|
950
|
-
Angulartics2Facebook.ctorParameters = function () { return [
|
951
|
-
{ type: Angulartics2 }
|
952
|
-
]; };
|
953
|
-
|
954
|
-
var GoogleAnalyticsDefaults = /** @class */ (function () {
|
955
|
-
function GoogleAnalyticsDefaults() {
|
956
|
-
this.additionalAccountNames = [];
|
957
|
-
this.userId = null;
|
958
|
-
this.transport = '';
|
959
|
-
this.anonymizeIp = false;
|
960
|
-
}
|
961
|
-
return GoogleAnalyticsDefaults;
|
962
|
-
}());
|
963
|
-
var Angulartics2GoogleAnalytics = /** @class */ (function () {
|
964
|
-
function Angulartics2GoogleAnalytics(angulartics2) {
|
965
|
-
var _this = this;
|
966
|
-
this.angulartics2 = angulartics2;
|
967
|
-
this.dimensionsAndMetrics = [];
|
968
|
-
var defaults = new GoogleAnalyticsDefaults();
|
969
|
-
// Set the default settings for this module
|
970
|
-
this.angulartics2.settings.ga = Object.assign(Object.assign({}, defaults), this.angulartics2.settings.ga);
|
971
|
-
this.settings = this.angulartics2.settings.ga;
|
972
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
973
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
974
|
-
}
|
975
|
-
Angulartics2GoogleAnalytics.prototype.startTracking = function () {
|
976
|
-
var _this = this;
|
977
|
-
this.angulartics2.pageTrack
|
978
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
979
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
980
|
-
this.angulartics2.eventTrack
|
981
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
982
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
983
|
-
this.angulartics2.exceptionTrack
|
984
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
985
|
-
.subscribe(function (x) { return _this.exceptionTrack(x); });
|
986
|
-
this.angulartics2.userTimings
|
987
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
988
|
-
.subscribe(function (x) { return _this.userTimings(x); });
|
989
|
-
};
|
990
|
-
Angulartics2GoogleAnalytics.prototype.pageTrack = function (path) {
|
991
|
-
var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
|
992
|
-
if (typeof _gaq !== 'undefined' && _gaq) {
|
993
|
-
_gaq.push(['_trackPageview', path]);
|
994
|
-
try {
|
995
|
-
for (var _e = __values(this.angulartics2.settings.ga.additionalAccountNames), _f = _e.next(); !_f.done; _f = _e.next()) {
|
996
|
-
var accountName = _f.value;
|
997
|
-
_gaq.push([accountName + '._trackPageview', path]);
|
998
|
-
}
|
999
|
-
}
|
1000
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1001
|
-
finally {
|
1002
|
-
try {
|
1003
|
-
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
1004
|
-
}
|
1005
|
-
finally { if (e_1) throw e_1.error; }
|
1006
|
-
}
|
1007
|
-
}
|
1008
|
-
if (typeof ga !== 'undefined' && ga) {
|
1009
|
-
if (this.angulartics2.settings.ga.userId) {
|
1010
|
-
ga('set', '&uid', this.angulartics2.settings.ga.userId);
|
1011
|
-
try {
|
1012
|
-
for (var _g = __values(this.angulartics2.settings.ga.additionalAccountNames), _h = _g.next(); !_h.done; _h = _g.next()) {
|
1013
|
-
var accountName = _h.value;
|
1014
|
-
ga(accountName + '.set', '&uid', this.angulartics2.settings.ga.userId);
|
1015
|
-
}
|
1016
|
-
}
|
1017
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
1018
|
-
finally {
|
1019
|
-
try {
|
1020
|
-
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
1021
|
-
}
|
1022
|
-
finally { if (e_2) throw e_2.error; }
|
1023
|
-
}
|
1024
|
-
}
|
1025
|
-
if (this.angulartics2.settings.ga.anonymizeIp) {
|
1026
|
-
ga('set', 'anonymizeIp', true);
|
1027
|
-
try {
|
1028
|
-
for (var _j = __values(this.angulartics2.settings.ga.additionalAccountNames), _k = _j.next(); !_k.done; _k = _j.next()) {
|
1029
|
-
var accountName = _k.value;
|
1030
|
-
ga(accountName + '.set', 'anonymizeIp', true);
|
1031
|
-
}
|
1032
|
-
}
|
1033
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
1034
|
-
finally {
|
1035
|
-
try {
|
1036
|
-
if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
|
1037
|
-
}
|
1038
|
-
finally { if (e_3) throw e_3.error; }
|
1039
|
-
}
|
1040
|
-
}
|
1041
|
-
ga('send', 'pageview', path);
|
1042
|
-
try {
|
1043
|
-
for (var _l = __values(this.angulartics2.settings.ga.additionalAccountNames), _m = _l.next(); !_m.done; _m = _l.next()) {
|
1044
|
-
var accountName = _m.value;
|
1045
|
-
ga(accountName + '.send', 'pageview', path);
|
1046
|
-
}
|
1047
|
-
}
|
1048
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
1049
|
-
finally {
|
1050
|
-
try {
|
1051
|
-
if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
|
1052
|
-
}
|
1053
|
-
finally { if (e_4) throw e_4.error; }
|
1054
|
-
}
|
1055
|
-
}
|
1056
|
-
};
|
1057
|
-
/**
|
1058
|
-
* Track Event in GA
|
1059
|
-
*
|
1060
|
-
* @param action Associated with the event
|
1061
|
-
* @param properties Comprised of:
|
1062
|
-
* - category (string) and optional
|
1063
|
-
* - label (string)
|
1064
|
-
* - value (integer)
|
1065
|
-
* - noninteraction (boolean)
|
1066
|
-
*
|
1067
|
-
* @link https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#SettingUpEventTracking
|
1068
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
1069
|
-
*/
|
1070
|
-
Angulartics2GoogleAnalytics.prototype.eventTrack = function (action, properties) {
|
1071
|
-
var e_5, _a;
|
1072
|
-
// Google Analytics requires an Event Category
|
1073
|
-
if (!properties || !properties.category) {
|
1074
|
-
properties = properties || {};
|
1075
|
-
properties.category = 'Event';
|
1076
|
-
}
|
1077
|
-
// GA requires that eventValue be an integer, see:
|
1078
|
-
// https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#eventValue
|
1079
|
-
// https://github.com/luisfarzati/angulartics/issues/81
|
1080
|
-
if (properties.value) {
|
1081
|
-
var parsed = parseInt(properties.value, 10);
|
1082
|
-
properties.value = isNaN(parsed) ? 0 : parsed;
|
1083
|
-
}
|
1084
|
-
if (typeof ga !== 'undefined') {
|
1085
|
-
var eventOptions = Object.assign({ eventCategory: properties.category, eventAction: action, eventLabel: properties.label, eventValue: properties.value, nonInteraction: properties.noninteraction, page: properties.page || location.hash.substring(1) || location.pathname, userId: this.angulartics2.settings.ga.userId, hitCallback: properties.hitCallback }, (this.angulartics2.settings.ga.transport && {
|
1086
|
-
transport: this.angulartics2.settings.ga.transport,
|
1087
|
-
}));
|
1088
|
-
// add custom dimensions and metrics
|
1089
|
-
this.setDimensionsAndMetrics(properties);
|
1090
|
-
ga('send', 'event', eventOptions);
|
1091
|
-
try {
|
1092
|
-
for (var _b = __values(this.angulartics2.settings.ga.additionalAccountNames), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1093
|
-
var accountName = _c.value;
|
1094
|
-
ga(accountName + '.send', 'event', eventOptions);
|
1095
|
-
}
|
1096
|
-
}
|
1097
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
1098
|
-
finally {
|
1099
|
-
try {
|
1100
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1101
|
-
}
|
1102
|
-
finally { if (e_5) throw e_5.error; }
|
1103
|
-
}
|
1104
|
-
}
|
1105
|
-
else if (typeof _gaq !== 'undefined') {
|
1106
|
-
_gaq.push([
|
1107
|
-
'_trackEvent',
|
1108
|
-
properties.category,
|
1109
|
-
action,
|
1110
|
-
properties.label,
|
1111
|
-
properties.value,
|
1112
|
-
properties.noninteraction,
|
1113
|
-
]);
|
1114
|
-
}
|
1115
|
-
};
|
1116
|
-
/**
|
1117
|
-
* Exception Track Event in GA
|
1118
|
-
*
|
1119
|
-
* @param properties Comprised of the optional fields:
|
1120
|
-
* - fatal (string)
|
1121
|
-
* - description (string)
|
1122
|
-
*
|
1123
|
-
* @https://developers.google.com/analytics/devguides/collection/analyticsjs/exceptions
|
1124
|
-
*
|
1125
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
1126
|
-
*/
|
1127
|
-
Angulartics2GoogleAnalytics.prototype.exceptionTrack = function (properties) {
|
1128
|
-
var e_6, _a;
|
1129
|
-
if (properties.fatal === undefined) {
|
1130
|
-
console.log('No "fatal" provided, sending with fatal=true');
|
1131
|
-
properties.fatal = true;
|
1132
|
-
}
|
1133
|
-
properties.exDescription = properties.description;
|
1134
|
-
var eventOptions = {
|
1135
|
-
exFatal: properties.fatal,
|
1136
|
-
exDescription: properties.description,
|
1137
|
-
};
|
1138
|
-
ga('send', 'exception', eventOptions);
|
1139
|
-
try {
|
1140
|
-
for (var _b = __values(this.angulartics2.settings.ga.additionalAccountNames), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1141
|
-
var accountName = _c.value;
|
1142
|
-
ga(accountName + '.send', 'exception', eventOptions);
|
1143
|
-
}
|
1144
|
-
}
|
1145
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
1146
|
-
finally {
|
1147
|
-
try {
|
1148
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1149
|
-
}
|
1150
|
-
finally { if (e_6) throw e_6.error; }
|
1151
|
-
}
|
1152
|
-
};
|
1153
|
-
/**
|
1154
|
-
* User Timings Event in GA
|
1155
|
-
*
|
1156
|
-
* @param properties Comprised of the mandatory fields:
|
1157
|
-
* - timingCategory (string)
|
1158
|
-
* - timingVar (string)
|
1159
|
-
* - timingValue (number)
|
1160
|
-
* Properties can also have the optional fields:
|
1161
|
-
* - timingLabel (string)
|
1162
|
-
*
|
1163
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings
|
1164
|
-
*/
|
1165
|
-
Angulartics2GoogleAnalytics.prototype.userTimings = function (properties) {
|
1166
|
-
var e_7, _a;
|
1167
|
-
if (!properties ||
|
1168
|
-
!properties.timingCategory ||
|
1169
|
-
!properties.timingVar ||
|
1170
|
-
!properties.timingValue) {
|
1171
|
-
console.error('Properties timingCategory, timingVar, and timingValue are required to be set.');
|
1172
|
-
return;
|
1173
|
-
}
|
1174
|
-
if (typeof ga !== 'undefined') {
|
1175
|
-
ga('send', 'timing', properties);
|
1176
|
-
try {
|
1177
|
-
for (var _b = __values(this.angulartics2.settings.ga.additionalAccountNames), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1178
|
-
var accountName = _c.value;
|
1179
|
-
ga(accountName + '.send', 'timing', properties);
|
1180
|
-
}
|
1181
|
-
}
|
1182
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
1183
|
-
finally {
|
1184
|
-
try {
|
1185
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1186
|
-
}
|
1187
|
-
finally { if (e_7) throw e_7.error; }
|
1188
|
-
}
|
1189
|
-
}
|
1190
|
-
};
|
1191
|
-
Angulartics2GoogleAnalytics.prototype.setUsername = function (userId) {
|
1192
|
-
this.angulartics2.settings.ga.userId = userId;
|
1193
|
-
if (typeof ga === 'undefined') {
|
1194
|
-
return;
|
1195
|
-
}
|
1196
|
-
ga('set', 'userId', userId);
|
1197
|
-
};
|
1198
|
-
Angulartics2GoogleAnalytics.prototype.setUserProperties = function (properties) {
|
1199
|
-
this.setDimensionsAndMetrics(properties);
|
1200
|
-
};
|
1201
|
-
Angulartics2GoogleAnalytics.prototype.setDimensionsAndMetrics = function (properties) {
|
1202
|
-
var _this = this;
|
1203
|
-
if (typeof ga === 'undefined') {
|
1204
|
-
return;
|
1205
|
-
}
|
1206
|
-
// clean previously used dimensions and metrics that will not be overriden
|
1207
|
-
this.dimensionsAndMetrics.forEach(function (elem) {
|
1208
|
-
if (!properties.hasOwnProperty(elem)) {
|
1209
|
-
ga('set', elem, undefined);
|
1210
|
-
_this.angulartics2.settings.ga.additionalAccountNames.forEach(function (accountName) {
|
1211
|
-
ga(accountName + ".set", elem, undefined);
|
1212
|
-
});
|
1213
|
-
}
|
1214
|
-
});
|
1215
|
-
this.dimensionsAndMetrics = [];
|
1216
|
-
// add custom dimensions and metrics
|
1217
|
-
Object.keys(properties).forEach(function (key) {
|
1218
|
-
if (key.lastIndexOf('dimension', 0) === 0 || key.lastIndexOf('metric', 0) === 0) {
|
1219
|
-
ga('set', key, properties[key]);
|
1220
|
-
_this.angulartics2.settings.ga.additionalAccountNames.forEach(function (accountName) {
|
1221
|
-
ga(accountName + ".set", key, properties[key]);
|
1222
|
-
});
|
1223
|
-
_this.dimensionsAndMetrics.push(key);
|
1224
|
-
}
|
1225
|
-
});
|
1226
|
-
};
|
1227
|
-
return Angulartics2GoogleAnalytics;
|
1228
|
-
}());
|
1229
|
-
Angulartics2GoogleAnalytics.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2GoogleAnalytics_Factory() { return new Angulartics2GoogleAnalytics(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2GoogleAnalytics, providedIn: "root" });
|
1230
|
-
Angulartics2GoogleAnalytics.decorators = [
|
1231
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1232
|
-
];
|
1233
|
-
Angulartics2GoogleAnalytics.ctorParameters = function () { return [
|
1234
|
-
{ type: Angulartics2 }
|
1235
|
-
]; };
|
1236
|
-
|
1237
|
-
var Angulartics2GoogleAnalyticsEnhancedEcommerce = /** @class */ (function () {
|
1238
|
-
function Angulartics2GoogleAnalyticsEnhancedEcommerce() {
|
1239
|
-
}
|
1240
|
-
/**
|
1241
|
-
* Add impression in GA enhanced ecommerce tracking
|
1242
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#measuring-activities
|
1243
|
-
*/
|
1244
|
-
Angulartics2GoogleAnalyticsEnhancedEcommerce.prototype.ecAddImpression = function (properties) {
|
1245
|
-
ga('ec:addImpression', properties);
|
1246
|
-
};
|
1247
|
-
/**
|
1248
|
-
* Add product in GA enhanced ecommerce tracking
|
1249
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
|
1250
|
-
*/
|
1251
|
-
Angulartics2GoogleAnalyticsEnhancedEcommerce.prototype.ecAddProduct = function (product) {
|
1252
|
-
ga('ec:addProduct', product);
|
1253
|
-
};
|
1254
|
-
/**
|
1255
|
-
* Set action in GA enhanced ecommerce tracking
|
1256
|
-
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
|
1257
|
-
*/
|
1258
|
-
Angulartics2GoogleAnalyticsEnhancedEcommerce.prototype.ecSetAction = function (action, properties) {
|
1259
|
-
ga('ec:setAction', action, properties);
|
1260
|
-
};
|
1261
|
-
return Angulartics2GoogleAnalyticsEnhancedEcommerce;
|
1262
|
-
}());
|
1263
|
-
Angulartics2GoogleAnalyticsEnhancedEcommerce.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2GoogleAnalyticsEnhancedEcommerce_Factory() { return new Angulartics2GoogleAnalyticsEnhancedEcommerce(); }, token: Angulartics2GoogleAnalyticsEnhancedEcommerce, providedIn: "root" });
|
1264
|
-
Angulartics2GoogleAnalyticsEnhancedEcommerce.decorators = [
|
1265
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1266
|
-
];
|
1267
|
-
|
1268
|
-
var GoogleTagManagerDefaults = /** @class */ (function () {
|
1269
|
-
function GoogleTagManagerDefaults() {
|
1270
|
-
this.userId = null;
|
1271
|
-
}
|
1272
|
-
return GoogleTagManagerDefaults;
|
1273
|
-
}());
|
1274
|
-
var Angulartics2GoogleTagManager = /** @class */ (function () {
|
1275
|
-
function Angulartics2GoogleTagManager(angulartics2) {
|
1276
|
-
var _this = this;
|
1277
|
-
this.angulartics2 = angulartics2;
|
1278
|
-
// The dataLayer needs to be initialized
|
1279
|
-
if (typeof dataLayer !== 'undefined' && dataLayer) {
|
1280
|
-
dataLayer = window.dataLayer = window.dataLayer || [];
|
1281
|
-
}
|
1282
|
-
var defaults = new GoogleTagManagerDefaults();
|
1283
|
-
// Set the default settings for this module
|
1284
|
-
this.angulartics2.settings.gtm = Object.assign(Object.assign({}, defaults), this.angulartics2.settings.gtm);
|
1285
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
1286
|
-
}
|
1287
|
-
Angulartics2GoogleTagManager.prototype.startTracking = function () {
|
1288
|
-
var _this = this;
|
1289
|
-
this.angulartics2.pageTrack
|
1290
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1291
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1292
|
-
this.angulartics2.eventTrack
|
1293
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1294
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1295
|
-
this.angulartics2.exceptionTrack
|
1296
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1297
|
-
.subscribe(function (x) { return _this.exceptionTrack(x); });
|
1298
|
-
};
|
1299
|
-
Angulartics2GoogleTagManager.prototype.pageTrack = function (path) {
|
1300
|
-
this.pushLayer({
|
1301
|
-
event: 'Page View',
|
1302
|
-
'content-name': path,
|
1303
|
-
userId: this.angulartics2.settings.gtm.userId,
|
1304
|
-
});
|
1305
|
-
};
|
1306
|
-
/**
|
1307
|
-
* Send Data Layer
|
1308
|
-
*
|
1309
|
-
* @layer data layer object
|
1310
|
-
*/
|
1311
|
-
Angulartics2GoogleTagManager.prototype.pushLayer = function (layer) {
|
1312
|
-
if (typeof dataLayer !== 'undefined' && dataLayer) {
|
1313
|
-
dataLayer.push(layer);
|
1314
|
-
}
|
1315
|
-
};
|
1316
|
-
/**
|
1317
|
-
* Send interactions to the dataLayer, i.e. for event tracking in Google Analytics
|
1318
|
-
*
|
1319
|
-
* @param action associated with the event
|
1320
|
-
*/
|
1321
|
-
Angulartics2GoogleTagManager.prototype.eventTrack = function (action, properties) {
|
1322
|
-
// TODO: make interface
|
1323
|
-
// @param {string} properties.category
|
1324
|
-
// @param {string} [properties.label]
|
1325
|
-
// @param {number} [properties.value]
|
1326
|
-
// @param {boolean} [properties.noninteraction]
|
1327
|
-
// Set a default GTM category
|
1328
|
-
properties = properties || {};
|
1329
|
-
this.pushLayer(Object.assign({ event: properties.event || 'interaction', target: properties.category || 'Event', action: action, label: properties.label, value: properties.value, interactionType: properties.noninteraction, userId: this.angulartics2.settings.gtm.userId }, properties.gtmCustom));
|
1330
|
-
};
|
1331
|
-
/**
|
1332
|
-
* Exception Track Event in GTM
|
1333
|
-
*
|
1334
|
-
*/
|
1335
|
-
Angulartics2GoogleTagManager.prototype.exceptionTrack = function (properties) {
|
1336
|
-
// TODO: make interface
|
1337
|
-
// @param {Object} properties
|
1338
|
-
// @param {string} properties.appId
|
1339
|
-
// @param {string} properties.appName
|
1340
|
-
// @param {string} properties.appVersion
|
1341
|
-
// @param {string} [properties.description]
|
1342
|
-
// @param {boolean} [properties.fatal]
|
1343
|
-
if (!properties || !properties.appId || !properties.appName || !properties.appVersion) {
|
1344
|
-
console.error('Must be setted appId, appName and appVersion.');
|
1345
|
-
return;
|
1346
|
-
}
|
1347
|
-
if (properties.fatal === undefined) {
|
1348
|
-
console.log('No "fatal" provided, sending with fatal=true');
|
1349
|
-
properties.exFatal = true;
|
1350
|
-
}
|
1351
|
-
properties.exDescription = properties.event ? properties.event.stack : properties.description;
|
1352
|
-
this.eventTrack("Exception thrown for " + properties.appName + " <" + properties.appId + "@" + properties.appVersion + ">", {
|
1353
|
-
category: 'Exception',
|
1354
|
-
label: properties.exDescription,
|
1355
|
-
});
|
1356
|
-
};
|
1357
|
-
/**
|
1358
|
-
* Set userId for use with Universal Analytics User ID feature
|
1359
|
-
*
|
1360
|
-
* @param userId used to identify user cross-device in Google Analytics
|
1361
|
-
*/
|
1362
|
-
Angulartics2GoogleTagManager.prototype.setUsername = function (userId) {
|
1363
|
-
this.angulartics2.settings.gtm.userId = userId;
|
1364
|
-
};
|
1365
|
-
return Angulartics2GoogleTagManager;
|
1366
|
-
}());
|
1367
|
-
Angulartics2GoogleTagManager.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2GoogleTagManager_Factory() { return new Angulartics2GoogleTagManager(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2GoogleTagManager, providedIn: "root" });
|
1368
|
-
Angulartics2GoogleTagManager.decorators = [
|
1369
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1370
|
-
];
|
1371
|
-
Angulartics2GoogleTagManager.ctorParameters = function () { return [
|
1372
|
-
{ type: Angulartics2 }
|
1373
|
-
]; };
|
1374
|
-
|
1375
|
-
var GoogleGlobalSiteTagDefaults = /** @class */ (function () {
|
1376
|
-
function GoogleGlobalSiteTagDefaults() {
|
1377
|
-
var _this = this;
|
1378
|
-
this.trackingIds = [];
|
1379
|
-
if (typeof ga !== 'undefined' && ga) {
|
1380
|
-
// See: https://developers.google.com/analytics/devguides/collection/analyticsjs/ga-object-methods-reference
|
1381
|
-
ga(function () {
|
1382
|
-
ga.getAll().forEach(function (tracker) {
|
1383
|
-
var id = tracker.get('trackingId');
|
1384
|
-
// If set both in forRoot and HTML page, we want to avoid duplicates
|
1385
|
-
if (id !== undefined && _this.trackingIds.indexOf(id) === -1) {
|
1386
|
-
_this.trackingIds.push(id);
|
1387
|
-
}
|
1388
|
-
});
|
1389
|
-
});
|
1390
|
-
}
|
1391
|
-
}
|
1392
|
-
return GoogleGlobalSiteTagDefaults;
|
1393
|
-
}());
|
1394
|
-
var Angulartics2GoogleGlobalSiteTag = /** @class */ (function () {
|
1395
|
-
function Angulartics2GoogleGlobalSiteTag(angulartics2) {
|
1396
|
-
this.angulartics2 = angulartics2;
|
1397
|
-
this.dimensionsAndMetrics = {};
|
1398
|
-
var defaults = new GoogleGlobalSiteTagDefaults();
|
1399
|
-
// Set the default settings for this module
|
1400
|
-
this.angulartics2.settings.gst = Object.assign(Object.assign({}, defaults), this.angulartics2.settings.gst);
|
1401
|
-
}
|
1402
|
-
Angulartics2GoogleGlobalSiteTag.prototype.startTracking = function () {
|
1403
|
-
var _this = this;
|
1404
|
-
this.angulartics2.pageTrack
|
1405
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1406
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1407
|
-
this.angulartics2.eventTrack
|
1408
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1409
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1410
|
-
this.angulartics2.exceptionTrack
|
1411
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1412
|
-
.subscribe(function (x) { return _this.exceptionTrack(x); });
|
1413
|
-
this.angulartics2.userTimings
|
1414
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1415
|
-
.subscribe(function (x) { return _this.userTimings(_this.convertTimings(x)); });
|
1416
|
-
this.angulartics2.setUsername
|
1417
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1418
|
-
.subscribe(function (x) { return _this.setUsername(x); });
|
1419
|
-
this.angulartics2.setUserProperties
|
1420
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1421
|
-
.subscribe(function (x) { return _this.setUserProperties(x); });
|
1422
|
-
};
|
1423
|
-
/**
|
1424
|
-
* Manually track page view, see:
|
1425
|
-
*
|
1426
|
-
* https://developers.google.com/analytics/devguides/collection/gtagjs/single-page-applications#tracking_virtual_pageviews
|
1427
|
-
*
|
1428
|
-
* @param path relative url
|
1429
|
-
*/
|
1430
|
-
Angulartics2GoogleGlobalSiteTag.prototype.pageTrack = function (path) {
|
1431
|
-
var e_1, _a;
|
1432
|
-
if (typeof gtag !== 'undefined' && gtag) {
|
1433
|
-
var params = Object.assign({ page_path: path, page_location: window.location.protocol + '//' + window.location.host + path }, this.dimensionsAndMetrics);
|
1434
|
-
// Custom map must be reset with all config to stay valid.
|
1435
|
-
if (this.angulartics2.settings.gst.customMap) {
|
1436
|
-
params.custom_map = this.angulartics2.settings.gst.customMap;
|
1437
|
-
}
|
1438
|
-
if (this.angulartics2.settings.gst.userId) {
|
1439
|
-
params.user_id = this.angulartics2.settings.gst.userId;
|
1440
|
-
}
|
1441
|
-
if (this.angulartics2.settings.gst.anonymizeIp) {
|
1442
|
-
params.anonymize_ip = this.angulartics2.settings.gst.anonymizeIp;
|
1443
|
-
}
|
1444
|
-
try {
|
1445
|
-
for (var _b = __values(this.angulartics2.settings.gst.trackingIds), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1446
|
-
var id = _c.value;
|
1447
|
-
gtag('config', id, params);
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1451
|
-
finally {
|
1452
|
-
try {
|
1453
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1454
|
-
}
|
1455
|
-
finally { if (e_1) throw e_1.error; }
|
1456
|
-
}
|
1457
|
-
}
|
1458
|
-
};
|
1459
|
-
/**
|
1460
|
-
* Send interactions to gtag, i.e. for event tracking in Google Analytics. See:
|
1461
|
-
*
|
1462
|
-
* https://developers.google.com/analytics/devguides/collection/gtagjs/events
|
1463
|
-
*
|
1464
|
-
* @param action associated with the event
|
1465
|
-
*/
|
1466
|
-
Angulartics2GoogleGlobalSiteTag.prototype.eventTrack = function (action, properties) {
|
1467
|
-
if (properties === void 0) { properties = {}; }
|
1468
|
-
this.eventTrackInternal(action, Object.assign({ event_category: properties.category || 'interaction', event_label: properties.label, value: properties.value, non_interaction: properties.noninteraction }, properties.gstCustom));
|
1469
|
-
};
|
1470
|
-
/**
|
1471
|
-
* Exception Track Event in GST. See:
|
1472
|
-
*
|
1473
|
-
* https://developers.google.com/analytics/devguides/collection/gtagjs/exceptions
|
1474
|
-
*
|
1475
|
-
*/
|
1476
|
-
Angulartics2GoogleGlobalSiteTag.prototype.exceptionTrack = function (properties) {
|
1477
|
-
// TODO: make interface
|
1478
|
-
// @param {Object} properties
|
1479
|
-
// @param {string} [properties.description]
|
1480
|
-
// @param {boolean} [properties.fatal]
|
1481
|
-
if (properties.fatal === undefined) {
|
1482
|
-
console.log('No "fatal" provided, sending with fatal=true');
|
1483
|
-
properties.fatal = true;
|
1484
|
-
}
|
1485
|
-
properties.exDescription = properties.event ? properties.event.stack : properties.description;
|
1486
|
-
this.eventTrack('exception', {
|
1487
|
-
gstCustom: Object.assign({ description: properties.exDescription, fatal: properties.fatal }, properties.gstCustom),
|
1488
|
-
});
|
1489
|
-
};
|
1490
|
-
/**
|
1491
|
-
* User Timings Event in GST.
|
1492
|
-
*
|
1493
|
-
* @param properties Comprised of the mandatory fields:
|
1494
|
-
* - name (string)
|
1495
|
-
* - value (number - integer)
|
1496
|
-
* Properties can also have the optional fields:
|
1497
|
-
* - category (string)
|
1498
|
-
* - label (string)
|
1499
|
-
*
|
1500
|
-
* @link https://developers.google.com/analytics/devguides/collection/gtagjs/user-timings
|
1501
|
-
*/
|
1502
|
-
Angulartics2GoogleGlobalSiteTag.prototype.userTimings = function (properties) {
|
1503
|
-
if (!properties) {
|
1504
|
-
console.error('User timings - "properties" parameter is required to be set.');
|
1505
|
-
return;
|
1506
|
-
}
|
1507
|
-
this.eventTrackInternal('timing_complete', {
|
1508
|
-
name: properties.name,
|
1509
|
-
value: properties.value,
|
1510
|
-
event_category: properties.category,
|
1511
|
-
event_label: properties.label,
|
1512
|
-
});
|
1513
|
-
};
|
1514
|
-
Angulartics2GoogleGlobalSiteTag.prototype.convertTimings = function (properties) {
|
1515
|
-
return {
|
1516
|
-
name: properties.timingVar,
|
1517
|
-
value: properties.timingValue,
|
1518
|
-
category: properties.timingCategory,
|
1519
|
-
label: properties.timingLabel,
|
1520
|
-
};
|
1521
|
-
};
|
1522
|
-
Angulartics2GoogleGlobalSiteTag.prototype.setUsername = function (userId) {
|
1523
|
-
this.angulartics2.settings.gst.userId = userId;
|
1524
|
-
if (typeof gtag !== 'undefined' && gtag) {
|
1525
|
-
gtag('set', { user_id: typeof userId === 'string' || !userId ? userId : userId.userId });
|
1526
|
-
}
|
1527
|
-
};
|
1528
|
-
Angulartics2GoogleGlobalSiteTag.prototype.setUserProperties = function (properties) {
|
1529
|
-
this.setDimensionsAndMetrics(properties);
|
1530
|
-
};
|
1531
|
-
Angulartics2GoogleGlobalSiteTag.prototype.setDimensionsAndMetrics = function (properties) {
|
1532
|
-
var _this = this;
|
1533
|
-
// We want the dimensions and metrics to accumulate, so we merge with previous value
|
1534
|
-
this.dimensionsAndMetrics = Object.assign(Object.assign({}, this.dimensionsAndMetrics), properties);
|
1535
|
-
// Remove properties that are null or undefined
|
1536
|
-
Object.keys(this.dimensionsAndMetrics).forEach(function (key) {
|
1537
|
-
var val = _this.dimensionsAndMetrics[key];
|
1538
|
-
if (val === undefined || val === null) {
|
1539
|
-
delete _this.dimensionsAndMetrics[key];
|
1540
|
-
}
|
1541
|
-
});
|
1542
|
-
if (typeof gtag !== 'undefined' && gtag) {
|
1543
|
-
gtag('set', this.dimensionsAndMetrics);
|
1544
|
-
}
|
1545
|
-
};
|
1546
|
-
Angulartics2GoogleGlobalSiteTag.prototype.eventTrackInternal = function (action, properties) {
|
1547
|
-
if (properties === void 0) { properties = {}; }
|
1548
|
-
this.cleanProperties(properties);
|
1549
|
-
if (typeof gtag !== 'undefined' && gtag) {
|
1550
|
-
gtag('event', action, properties);
|
1551
|
-
}
|
1552
|
-
};
|
1553
|
-
Angulartics2GoogleGlobalSiteTag.prototype.cleanProperties = function (properties) {
|
1554
|
-
// GA requires that eventValue be an non-negative integer, see:
|
1555
|
-
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
|
1556
|
-
if (properties.value) {
|
1557
|
-
var parsed = parseInt(properties.value, 10);
|
1558
|
-
properties.value = isNaN(parsed) ? 0 : parsed;
|
1559
|
-
}
|
1560
|
-
};
|
1561
|
-
return Angulartics2GoogleGlobalSiteTag;
|
1562
|
-
}());
|
1563
|
-
Angulartics2GoogleGlobalSiteTag.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2GoogleGlobalSiteTag_Factory() { return new Angulartics2GoogleGlobalSiteTag(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2GoogleGlobalSiteTag, providedIn: "root" });
|
1564
|
-
Angulartics2GoogleGlobalSiteTag.decorators = [
|
1565
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1566
|
-
];
|
1567
|
-
Angulartics2GoogleGlobalSiteTag.ctorParameters = function () { return [
|
1568
|
-
{ type: Angulartics2 }
|
1569
|
-
]; };
|
1570
|
-
|
1571
|
-
var Angulartics2Hubspot = /** @class */ (function () {
|
1572
|
-
function Angulartics2Hubspot(angulartics2) {
|
1573
|
-
var _this = this;
|
1574
|
-
this.angulartics2 = angulartics2;
|
1575
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
1576
|
-
}
|
1577
|
-
Angulartics2Hubspot.prototype.startTracking = function () {
|
1578
|
-
var _this = this;
|
1579
|
-
this.angulartics2.pageTrack
|
1580
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1581
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1582
|
-
this.angulartics2.eventTrack
|
1583
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1584
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1585
|
-
};
|
1586
|
-
Angulartics2Hubspot.prototype.pageTrack = function (path) {
|
1587
|
-
if (typeof _hsq !== 'undefined') {
|
1588
|
-
_hsq.push(['setPath', path]);
|
1589
|
-
_hsq.push(['trackPageView']);
|
1590
|
-
}
|
1591
|
-
};
|
1592
|
-
Angulartics2Hubspot.prototype.eventTrack = function (action, properties) {
|
1593
|
-
if (typeof _hsq !== 'undefined') {
|
1594
|
-
_hsq.push(['trackEvent', properties]);
|
1595
|
-
}
|
1596
|
-
};
|
1597
|
-
Angulartics2Hubspot.prototype.setUserProperties = function (properties) {
|
1598
|
-
if (typeof _hsq !== 'undefined') {
|
1599
|
-
_hsq.push(['identify', properties]);
|
1600
|
-
}
|
1601
|
-
};
|
1602
|
-
return Angulartics2Hubspot;
|
1603
|
-
}());
|
1604
|
-
Angulartics2Hubspot.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Hubspot_Factory() { return new Angulartics2Hubspot(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Hubspot, providedIn: "root" });
|
1605
|
-
Angulartics2Hubspot.decorators = [
|
1606
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1607
|
-
];
|
1608
|
-
Angulartics2Hubspot.ctorParameters = function () { return [
|
1609
|
-
{ type: Angulartics2 }
|
1610
|
-
]; };
|
1611
|
-
|
1612
|
-
var Angulartics2Kissmetrics = /** @class */ (function () {
|
1613
|
-
function Angulartics2Kissmetrics(angulartics2) {
|
1614
|
-
var _this = this;
|
1615
|
-
this.angulartics2 = angulartics2;
|
1616
|
-
if (typeof _kmq === 'undefined') {
|
1617
|
-
_kmq = [];
|
1618
|
-
}
|
1619
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
1620
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
1621
|
-
}
|
1622
|
-
Angulartics2Kissmetrics.prototype.startTracking = function () {
|
1623
|
-
var _this = this;
|
1624
|
-
this.angulartics2.pageTrack
|
1625
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1626
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1627
|
-
this.angulartics2.eventTrack
|
1628
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1629
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1630
|
-
};
|
1631
|
-
Angulartics2Kissmetrics.prototype.pageTrack = function (path) {
|
1632
|
-
_kmq.push(['record', 'Pageview', { Page: path }]);
|
1633
|
-
};
|
1634
|
-
Angulartics2Kissmetrics.prototype.eventTrack = function (action, properties) {
|
1635
|
-
_kmq.push(['record', action, properties]);
|
1636
|
-
};
|
1637
|
-
Angulartics2Kissmetrics.prototype.setUsername = function (userId) {
|
1638
|
-
_kmq.push(['identify', userId]);
|
1639
|
-
};
|
1640
|
-
Angulartics2Kissmetrics.prototype.setUserProperties = function (properties) {
|
1641
|
-
_kmq.push(['set', properties]);
|
1642
|
-
};
|
1643
|
-
return Angulartics2Kissmetrics;
|
1644
|
-
}());
|
1645
|
-
Angulartics2Kissmetrics.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Kissmetrics_Factory() { return new Angulartics2Kissmetrics(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Kissmetrics, providedIn: "root" });
|
1646
|
-
Angulartics2Kissmetrics.decorators = [
|
1647
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1648
|
-
];
|
1649
|
-
Angulartics2Kissmetrics.ctorParameters = function () { return [
|
1650
|
-
{ type: Angulartics2 }
|
1651
|
-
]; };
|
1652
|
-
|
1653
|
-
var Angulartics2LaunchByAdobe = /** @class */ (function () {
|
1654
|
-
function Angulartics2LaunchByAdobe(angulartics2) {
|
1655
|
-
var _this = this;
|
1656
|
-
this.angulartics2 = angulartics2;
|
1657
|
-
this.payload = {};
|
1658
|
-
if ('undefined' === typeof _satellite) {
|
1659
|
-
console.warn('Launch not found!');
|
1660
|
-
}
|
1661
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
1662
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
1663
|
-
}
|
1664
|
-
Angulartics2LaunchByAdobe.prototype.setUsername = function (userId) {
|
1665
|
-
if ('undefined' !== typeof userId && userId) {
|
1666
|
-
this.payload.userId = userId;
|
1667
|
-
}
|
1668
|
-
};
|
1669
|
-
Angulartics2LaunchByAdobe.prototype.setUserProperties = function (properties) {
|
1670
|
-
if ('undefined' !== typeof properties && properties) {
|
1671
|
-
this.payload.properties = properties;
|
1672
|
-
}
|
1673
|
-
};
|
1674
|
-
Angulartics2LaunchByAdobe.prototype.startTracking = function () {
|
1675
|
-
var _this = this;
|
1676
|
-
this.angulartics2.pageTrack
|
1677
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1678
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1679
|
-
this.angulartics2.eventTrack
|
1680
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1681
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1682
|
-
};
|
1683
|
-
Angulartics2LaunchByAdobe.prototype.pageTrack = function (path) {
|
1684
|
-
this.payload = this.payload || {};
|
1685
|
-
this.payload.path = path;
|
1686
|
-
if ('undefined' !== typeof _satellite && _satellite) {
|
1687
|
-
_satellite.track('pageTrack', this.payload);
|
1688
|
-
}
|
1689
|
-
};
|
1690
|
-
/**
|
1691
|
-
* @param action associated with the event
|
1692
|
-
* @param properties associated with the event
|
1693
|
-
*/
|
1694
|
-
Angulartics2LaunchByAdobe.prototype.eventTrack = function (action, properties) {
|
1695
|
-
properties = properties || {};
|
1696
|
-
// add properties to payload
|
1697
|
-
this.payload.action = action;
|
1698
|
-
this.payload.eventProperties = properties;
|
1699
|
-
if ('undefined' !== typeof _satellite && _satellite) {
|
1700
|
-
_satellite.track('eventTrack', this.payload);
|
1701
|
-
}
|
1702
|
-
};
|
1703
|
-
return Angulartics2LaunchByAdobe;
|
1704
|
-
}());
|
1705
|
-
Angulartics2LaunchByAdobe.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2LaunchByAdobe_Factory() { return new Angulartics2LaunchByAdobe(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2LaunchByAdobe, providedIn: "root" });
|
1706
|
-
Angulartics2LaunchByAdobe.decorators = [
|
1707
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1708
|
-
];
|
1709
|
-
Angulartics2LaunchByAdobe.ctorParameters = function () { return [
|
1710
|
-
{ type: Angulartics2 }
|
1711
|
-
]; };
|
1712
|
-
|
1713
|
-
var Angulartics2Mixpanel = /** @class */ (function () {
|
1714
|
-
function Angulartics2Mixpanel(angulartics2) {
|
1715
|
-
var _this = this;
|
1716
|
-
this.angulartics2 = angulartics2;
|
1717
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
1718
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
1719
|
-
this.angulartics2.setUserPropertiesOnce.subscribe(function (x) { return _this.setUserPropertiesOnce(x); });
|
1720
|
-
this.angulartics2.setSuperProperties.subscribe(function (x) { return _this.setSuperProperties(x); });
|
1721
|
-
this.angulartics2.setSuperPropertiesOnce.subscribe(function (x) { return _this.setSuperPropertiesOnce(x); });
|
1722
|
-
this.angulartics2.setAlias.subscribe(function (x) { return _this.setAlias(x); });
|
1723
|
-
}
|
1724
|
-
Angulartics2Mixpanel.prototype.startTracking = function () {
|
1725
|
-
var _this = this;
|
1726
|
-
this.angulartics2.pageTrack
|
1727
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1728
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1729
|
-
this.angulartics2.eventTrack
|
1730
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1731
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1732
|
-
};
|
1733
|
-
Angulartics2Mixpanel.prototype.pageTrack = function (path) {
|
1734
|
-
try {
|
1735
|
-
mixpanel.track('Page Viewed', { page: path });
|
1736
|
-
}
|
1737
|
-
catch (e) {
|
1738
|
-
if (!(e instanceof ReferenceError)) {
|
1739
|
-
throw e;
|
1740
|
-
}
|
1741
|
-
}
|
1742
|
-
};
|
1743
|
-
Angulartics2Mixpanel.prototype.eventTrack = function (action, properties) {
|
1744
|
-
try {
|
1745
|
-
mixpanel.track(action, properties);
|
1746
|
-
}
|
1747
|
-
catch (e) {
|
1748
|
-
if (!(e instanceof ReferenceError)) {
|
1749
|
-
throw e;
|
1750
|
-
}
|
1751
|
-
}
|
1752
|
-
};
|
1753
|
-
Angulartics2Mixpanel.prototype.setUsername = function (userId) {
|
1754
|
-
try {
|
1755
|
-
mixpanel.identify(userId);
|
1756
|
-
}
|
1757
|
-
catch (e) {
|
1758
|
-
if (!(e instanceof ReferenceError)) {
|
1759
|
-
throw e;
|
1760
|
-
}
|
1761
|
-
}
|
1762
|
-
};
|
1763
|
-
Angulartics2Mixpanel.prototype.setUserProperties = function (properties) {
|
1764
|
-
try {
|
1765
|
-
mixpanel.people.set(properties);
|
1766
|
-
}
|
1767
|
-
catch (e) {
|
1768
|
-
if (!(e instanceof ReferenceError)) {
|
1769
|
-
throw e;
|
1770
|
-
}
|
1771
|
-
}
|
1772
|
-
};
|
1773
|
-
Angulartics2Mixpanel.prototype.setUserPropertiesOnce = function (properties) {
|
1774
|
-
try {
|
1775
|
-
mixpanel.people.set_once(properties);
|
1776
|
-
}
|
1777
|
-
catch (e) {
|
1778
|
-
if (!(e instanceof ReferenceError)) {
|
1779
|
-
throw e;
|
1780
|
-
}
|
1781
|
-
}
|
1782
|
-
};
|
1783
|
-
Angulartics2Mixpanel.prototype.setSuperProperties = function (properties) {
|
1784
|
-
try {
|
1785
|
-
mixpanel.register(properties);
|
1786
|
-
}
|
1787
|
-
catch (e) {
|
1788
|
-
if (!(e instanceof ReferenceError)) {
|
1789
|
-
throw e;
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
};
|
1793
|
-
Angulartics2Mixpanel.prototype.setSuperPropertiesOnce = function (properties) {
|
1794
|
-
try {
|
1795
|
-
mixpanel.register_once(properties);
|
1796
|
-
}
|
1797
|
-
catch (e) {
|
1798
|
-
if (!(e instanceof ReferenceError)) {
|
1799
|
-
throw e;
|
1800
|
-
}
|
1801
|
-
}
|
1802
|
-
};
|
1803
|
-
Angulartics2Mixpanel.prototype.setAlias = function (alias) {
|
1804
|
-
try {
|
1805
|
-
mixpanel.alias(alias);
|
1806
|
-
}
|
1807
|
-
catch (e) {
|
1808
|
-
if (!(e instanceof ReferenceError)) {
|
1809
|
-
throw e;
|
1810
|
-
}
|
1811
|
-
}
|
1812
|
-
};
|
1813
|
-
return Angulartics2Mixpanel;
|
1814
|
-
}());
|
1815
|
-
Angulartics2Mixpanel.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Mixpanel_Factory() { return new Angulartics2Mixpanel(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Mixpanel, providedIn: "root" });
|
1816
|
-
Angulartics2Mixpanel.decorators = [
|
1817
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1818
|
-
];
|
1819
|
-
Angulartics2Mixpanel.ctorParameters = function () { return [
|
1820
|
-
{ type: Angulartics2 }
|
1821
|
-
]; };
|
1822
|
-
|
1823
|
-
var Angulartics2Pyze = /** @class */ (function () {
|
1824
|
-
function Angulartics2Pyze(angulartics2) {
|
1825
|
-
var _this = this;
|
1826
|
-
this.angulartics2 = angulartics2;
|
1827
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUserId(x); });
|
1828
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.postTraits(x); });
|
1829
|
-
}
|
1830
|
-
Angulartics2Pyze.prototype.startTracking = function () {
|
1831
|
-
var _this = this;
|
1832
|
-
this.angulartics2.pageTrack
|
1833
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1834
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1835
|
-
this.angulartics2.eventTrack
|
1836
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1837
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1838
|
-
};
|
1839
|
-
Angulartics2Pyze.prototype.pageTrack = function (path) {
|
1840
|
-
try {
|
1841
|
-
Pyze.postPageView('Page Viewed', { page: path });
|
1842
|
-
}
|
1843
|
-
catch (e) {
|
1844
|
-
if (!(e instanceof ReferenceError)) {
|
1845
|
-
throw e;
|
1846
|
-
}
|
1847
|
-
}
|
1848
|
-
};
|
1849
|
-
Angulartics2Pyze.prototype.eventTrack = function (action, properties) {
|
1850
|
-
try {
|
1851
|
-
PyzeEvents.postCustomEventWithAttributes(action, properties);
|
1852
|
-
}
|
1853
|
-
catch (e) {
|
1854
|
-
if (!(e instanceof ReferenceError)) {
|
1855
|
-
throw e;
|
1856
|
-
}
|
1857
|
-
}
|
1858
|
-
};
|
1859
|
-
Angulartics2Pyze.prototype.setUserId = function (userId) {
|
1860
|
-
try {
|
1861
|
-
PyzeIdentity.setUserIdentifier(userId);
|
1862
|
-
}
|
1863
|
-
catch (e) {
|
1864
|
-
if (!(e instanceof ReferenceError)) {
|
1865
|
-
throw e;
|
1866
|
-
}
|
1867
|
-
}
|
1868
|
-
};
|
1869
|
-
Angulartics2Pyze.prototype.postTraits = function (properties) {
|
1870
|
-
try {
|
1871
|
-
PyzeIdentity.postTraits(properties);
|
1872
|
-
}
|
1873
|
-
catch (e) {
|
1874
|
-
if (!(e instanceof ReferenceError)) {
|
1875
|
-
throw e;
|
1876
|
-
}
|
1877
|
-
}
|
1878
|
-
};
|
1879
|
-
return Angulartics2Pyze;
|
1880
|
-
}());
|
1881
|
-
Angulartics2Pyze.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Pyze_Factory() { return new Angulartics2Pyze(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Pyze, providedIn: "root" });
|
1882
|
-
Angulartics2Pyze.decorators = [
|
1883
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
1884
|
-
];
|
1885
|
-
Angulartics2Pyze.ctorParameters = function () { return [
|
1886
|
-
{ type: Angulartics2 }
|
1887
|
-
]; };
|
1888
|
-
|
1889
|
-
var Angulartics2Matomo = /** @class */ (function () {
|
1890
|
-
function Angulartics2Matomo(angulartics2) {
|
1891
|
-
var _this = this;
|
1892
|
-
this.angulartics2 = angulartics2;
|
1893
|
-
if (typeof _paq === 'undefined') {
|
1894
|
-
console.warn('Matomo not found');
|
1895
|
-
}
|
1896
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
1897
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
1898
|
-
}
|
1899
|
-
Angulartics2Matomo.prototype.startTracking = function () {
|
1900
|
-
var _this = this;
|
1901
|
-
this.angulartics2.pageTrack
|
1902
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1903
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
1904
|
-
this.angulartics2.eventTrack
|
1905
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
1906
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
1907
|
-
};
|
1908
|
-
Angulartics2Matomo.prototype.pageTrack = function (path, title) {
|
1909
|
-
try {
|
1910
|
-
if (!window.location.origin) {
|
1911
|
-
window.location.origin =
|
1912
|
-
window.location.protocol +
|
1913
|
-
'//' +
|
1914
|
-
window.location.hostname +
|
1915
|
-
(window.location.port ? ':' + window.location.port : '');
|
1916
|
-
}
|
1917
|
-
_paq.push(['setDocumentTitle', title || window.document.title]);
|
1918
|
-
_paq.push(['setCustomUrl', window.location.origin + path]);
|
1919
|
-
_paq.push(['trackPageView']);
|
1920
|
-
}
|
1921
|
-
catch (e) {
|
1922
|
-
if (!(e instanceof ReferenceError)) {
|
1923
|
-
throw e;
|
1924
|
-
}
|
1925
|
-
}
|
1926
|
-
};
|
1927
|
-
Angulartics2Matomo.prototype.resetUser = function () {
|
1928
|
-
try {
|
1929
|
-
_paq.push(['appendToTrackingUrl', 'new_visit=1']); // (1) forces a new visit
|
1930
|
-
_paq.push(['deleteCookies']); // (2) deletes existing tracking cookies to start the new visit
|
1931
|
-
}
|
1932
|
-
catch (e) {
|
1933
|
-
if (!(e instanceof ReferenceError)) {
|
1934
|
-
throw e;
|
1935
|
-
}
|
1936
|
-
}
|
1937
|
-
};
|
1938
|
-
/**
|
1939
|
-
* Track a basic event in Matomo, or send an ecommerce event.
|
1940
|
-
*
|
1941
|
-
* @param action A string corresponding to the type of event that needs to be tracked.
|
1942
|
-
* @param properties The properties that need to be logged with the event.
|
1943
|
-
*/
|
1944
|
-
Angulartics2Matomo.prototype.eventTrack = function (action, properties) {
|
1945
|
-
var params = [];
|
1946
|
-
switch (action) {
|
1947
|
-
/**
|
1948
|
-
* @description Sets the current page view as a product or category page view. When you call
|
1949
|
-
* setEcommerceView it must be followed by a call to trackPageView to record the product or
|
1950
|
-
* category page view.
|
1951
|
-
*
|
1952
|
-
* @link https://matomo.org/docs/ecommerce-analytics/#tracking-product-page-views-category-page-views-optional
|
1953
|
-
* @link https://developer.matomo.org/api-reference/tracking-javascript#ecommerce
|
1954
|
-
*
|
1955
|
-
* @property productSKU (required) SKU: Product unique identifier
|
1956
|
-
* @property productName (optional) Product name
|
1957
|
-
* @property categoryName (optional) Product category, or array of up to 5 categories
|
1958
|
-
* @property price (optional) Product Price as displayed on the page
|
1959
|
-
*/
|
1960
|
-
case 'setEcommerceView':
|
1961
|
-
params = [
|
1962
|
-
'setEcommerceView',
|
1963
|
-
properties.productSKU,
|
1964
|
-
properties.productName,
|
1965
|
-
properties.categoryName,
|
1966
|
-
properties.price,
|
1967
|
-
];
|
1968
|
-
break;
|
1969
|
-
/**
|
1970
|
-
* @description Adds a product into the ecommerce order. Must be called for each product in
|
1971
|
-
* the order.
|
1972
|
-
*
|
1973
|
-
* @link https://matomo.org/docs/ecommerce-analytics/#tracking-ecommerce-orders-items-purchased-required
|
1974
|
-
* @link https://developer.matomo.org/api-reference/tracking-javascript#ecommerce
|
1975
|
-
*
|
1976
|
-
* @property productSKU (required) SKU: Product unique identifier
|
1977
|
-
* @property productName (optional) Product name
|
1978
|
-
* @property categoryName (optional) Product category, or array of up to 5 categories
|
1979
|
-
* @property price (recommended) Product price
|
1980
|
-
* @property quantity (optional, default to 1) Product quantity
|
1981
|
-
*/
|
1982
|
-
case 'addEcommerceItem':
|
1983
|
-
params = [
|
1984
|
-
'addEcommerceItem',
|
1985
|
-
properties.productSKU,
|
1986
|
-
properties.productName,
|
1987
|
-
properties.productCategory,
|
1988
|
-
properties.price,
|
1989
|
-
properties.quantity,
|
1990
|
-
];
|
1991
|
-
break;
|
1992
|
-
/**
|
1993
|
-
* @description Tracks a shopping cart. Call this javascript function every time a user is
|
1994
|
-
* adding, updating or deleting a product from the cart.
|
1995
|
-
*
|
1996
|
-
* @link https://matomo.org/docs/ecommerce-analytics/#tracking-add-to-cart-items-added-to-the-cart-optional
|
1997
|
-
* @link https://developer.matomo.org/api-reference/tracking-javascript#ecommerce
|
1998
|
-
*
|
1999
|
-
* @property grandTotal (required) Cart amount
|
2000
|
-
*/
|
2001
|
-
case 'trackEcommerceCartUpdate':
|
2002
|
-
params = [
|
2003
|
-
'trackEcommerceCartUpdate',
|
2004
|
-
properties.grandTotal,
|
2005
|
-
];
|
2006
|
-
break;
|
2007
|
-
/**
|
2008
|
-
* @description Tracks an Ecommerce order, including any ecommerce item previously added to
|
2009
|
-
* the order. orderId and grandTotal (ie. revenue) are required parameters.
|
2010
|
-
*
|
2011
|
-
* @link https://matomo.org/docs/ecommerce-analytics/#tracking-ecommerce-orders-items-purchased-required
|
2012
|
-
* @link https://developer.matomo.org/api-reference/tracking-javascript#ecommerce
|
2013
|
-
*
|
2014
|
-
* @property orderId (required) Unique Order ID
|
2015
|
-
* @property grandTotal (required) Order Revenue grand total (includes tax, shipping, and subtracted discount)
|
2016
|
-
* @property subTotal (optional) Order sub total (excludes shipping)
|
2017
|
-
* @property tax (optional) Tax amount
|
2018
|
-
* @property shipping (optional) Shipping amount
|
2019
|
-
* @property discount (optional) Discount offered (set to false for unspecified parameter)
|
2020
|
-
*/
|
2021
|
-
case 'trackEcommerceOrder':
|
2022
|
-
params = [
|
2023
|
-
'trackEcommerceOrder',
|
2024
|
-
properties.orderId,
|
2025
|
-
properties.grandTotal,
|
2026
|
-
properties.subTotal,
|
2027
|
-
properties.tax,
|
2028
|
-
properties.shipping,
|
2029
|
-
properties.discount,
|
2030
|
-
];
|
2031
|
-
break;
|
2032
|
-
/**
|
2033
|
-
* @description To manually trigger an outlink
|
2034
|
-
*
|
2035
|
-
* @link https://matomo.org/docs/tracking-goals-web-analytics/
|
2036
|
-
* @link https://developer.matomo.org/guides/tracking-javascript-guide#tracking-a-click-as-an-outlink-via-css-or-javascript
|
2037
|
-
*
|
2038
|
-
* @property url (required) link url
|
2039
|
-
* @property linkType (optional) type of link
|
2040
|
-
*/
|
2041
|
-
case 'trackLink':
|
2042
|
-
params = [
|
2043
|
-
'trackLink',
|
2044
|
-
properties.url,
|
2045
|
-
properties.linkType,
|
2046
|
-
];
|
2047
|
-
break;
|
2048
|
-
/**
|
2049
|
-
* @description Tracks an Ecommerce goal
|
2050
|
-
*
|
2051
|
-
* @link https://matomo.org/docs/tracking-goals-web-analytics/
|
2052
|
-
* @link https://developer.matomo.org/guides/tracking-javascript-guide#manually-trigger-goal-conversions
|
2053
|
-
*
|
2054
|
-
* @property goalId (required) Unique Goal ID
|
2055
|
-
* @property value (optional) passed to goal tracking
|
2056
|
-
*/
|
2057
|
-
case 'trackGoal':
|
2058
|
-
params = [
|
2059
|
-
'trackGoal',
|
2060
|
-
properties.goalId,
|
2061
|
-
properties.value,
|
2062
|
-
];
|
2063
|
-
break;
|
2064
|
-
/**
|
2065
|
-
* @description Tracks a site search
|
2066
|
-
*
|
2067
|
-
* @link https://matomo.org/docs/site-search/
|
2068
|
-
* @link https://developer.matomo.org/guides/tracking-javascript-guide#internal-search-tracking
|
2069
|
-
*
|
2070
|
-
* @property keyword (required) Keyword searched for
|
2071
|
-
* @property category (optional) Search category
|
2072
|
-
* @property searchCount (optional) Number of results
|
2073
|
-
*/
|
2074
|
-
case 'trackSiteSearch':
|
2075
|
-
params = [
|
2076
|
-
'trackSiteSearch',
|
2077
|
-
properties.keyword,
|
2078
|
-
properties.category,
|
2079
|
-
properties.searchCount,
|
2080
|
-
];
|
2081
|
-
break;
|
2082
|
-
/**
|
2083
|
-
* @description Logs an event with an event category (Videos, Music, Games...), an event
|
2084
|
-
* action (Play, Pause, Duration, Add Playlist, Downloaded, Clicked...), and an optional
|
2085
|
-
* event name and optional numeric value.
|
2086
|
-
*
|
2087
|
-
* @link https://matomo.org/docs/event-tracking/
|
2088
|
-
* @link https://developer.matomo.org/api-reference/tracking-javascript#using-the-tracker-object
|
2089
|
-
*
|
2090
|
-
* @property category
|
2091
|
-
* @property action
|
2092
|
-
* @property name (optional, recommended)
|
2093
|
-
* @property value (optional)
|
2094
|
-
*/
|
2095
|
-
default:
|
2096
|
-
// PAQ requires that eventValue be an integer, see: http://matomo.org/docs/event-tracking
|
2097
|
-
if (properties.value) {
|
2098
|
-
var parsed = parseInt(properties.value, 10);
|
2099
|
-
properties.value = isNaN(parsed) ? 0 : parsed;
|
2100
|
-
}
|
2101
|
-
params = [
|
2102
|
-
'trackEvent',
|
2103
|
-
properties.category,
|
2104
|
-
action,
|
2105
|
-
properties.name ||
|
2106
|
-
properties.label,
|
2107
|
-
properties.value,
|
2108
|
-
];
|
2109
|
-
}
|
2110
|
-
try {
|
2111
|
-
_paq.push(params);
|
2112
|
-
}
|
2113
|
-
catch (e) {
|
2114
|
-
if (!(e instanceof ReferenceError)) {
|
2115
|
-
throw e;
|
2116
|
-
}
|
2117
|
-
}
|
2118
|
-
};
|
2119
|
-
Angulartics2Matomo.prototype.setUsername = function (userId) {
|
2120
|
-
try {
|
2121
|
-
_paq.push(['setUserId', userId]);
|
2122
|
-
}
|
2123
|
-
catch (e) {
|
2124
|
-
if (!(e instanceof ReferenceError)) {
|
2125
|
-
throw e;
|
2126
|
-
}
|
2127
|
-
}
|
2128
|
-
};
|
2129
|
-
/**
|
2130
|
-
* Sets custom dimensions if at least one property has the key "dimension<n>",
|
2131
|
-
* e.g. dimension10. If there are custom dimensions, any other property is ignored.
|
2132
|
-
*
|
2133
|
-
* If there are no custom dimensions in the given properties object, the properties
|
2134
|
-
* object is saved as a custom variable.
|
2135
|
-
*
|
2136
|
-
* If in doubt, prefer custom dimensions.
|
2137
|
-
* @link https://matomo.org/docs/custom-variables/
|
2138
|
-
*/
|
2139
|
-
Angulartics2Matomo.prototype.setUserProperties = function (properties) {
|
2140
|
-
var dimensions = this.setCustomDimensions(properties);
|
2141
|
-
try {
|
2142
|
-
if (dimensions.length === 0) {
|
2143
|
-
_paq.push([
|
2144
|
-
'setCustomVariable',
|
2145
|
-
properties.index,
|
2146
|
-
properties.name,
|
2147
|
-
properties.value,
|
2148
|
-
properties.scope,
|
2149
|
-
]);
|
2150
|
-
}
|
2151
|
-
}
|
2152
|
-
catch (e) {
|
2153
|
-
if (!(e instanceof ReferenceError)) {
|
2154
|
-
throw e;
|
2155
|
-
}
|
2156
|
-
}
|
2157
|
-
};
|
2158
|
-
/**
|
2159
|
-
* If you created a custom variable and then decide to remove this variable from
|
2160
|
-
* a visit or page view, you can use deleteCustomVariable.
|
2161
|
-
*
|
2162
|
-
* @link https://developer.matomo.org/guides/tracking-javascript-guide#deleting-a-custom-variable
|
2163
|
-
*/
|
2164
|
-
Angulartics2Matomo.prototype.deletedUserProperties = function (properties) {
|
2165
|
-
try {
|
2166
|
-
_paq.push(['deleteCustomVariable', properties.index, properties.scope]);
|
2167
|
-
}
|
2168
|
-
catch (e) {
|
2169
|
-
if (!(e instanceof ReferenceError)) {
|
2170
|
-
throw e;
|
2171
|
-
}
|
2172
|
-
}
|
2173
|
-
};
|
2174
|
-
Angulartics2Matomo.prototype.setCustomDimensions = function (properties) {
|
2175
|
-
var dimensionRegex = /dimension[1-9]\d*/;
|
2176
|
-
var dimensions = Object.keys(properties).filter(function (key) { return dimensionRegex.exec(key); });
|
2177
|
-
dimensions.forEach(function (dimension) {
|
2178
|
-
var number = Number(dimension.substr(9));
|
2179
|
-
_paq.push(['setCustomDimension', number, properties[dimension]]);
|
2180
|
-
});
|
2181
|
-
return dimensions;
|
2182
|
-
};
|
2183
|
-
return Angulartics2Matomo;
|
2184
|
-
}());
|
2185
|
-
Angulartics2Matomo.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Matomo_Factory() { return new Angulartics2Matomo(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Matomo, providedIn: "root" });
|
2186
|
-
Angulartics2Matomo.decorators = [
|
2187
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2188
|
-
];
|
2189
|
-
Angulartics2Matomo.ctorParameters = function () { return [
|
2190
|
-
{ type: Angulartics2 }
|
2191
|
-
]; };
|
2192
|
-
|
2193
|
-
var Angulartics2Segment = /** @class */ (function () {
|
2194
|
-
function Angulartics2Segment(angulartics2) {
|
2195
|
-
var _this = this;
|
2196
|
-
this.angulartics2 = angulartics2;
|
2197
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
2198
|
-
this.angulartics2.setUserPropertiesOnce.subscribe(function (x) { return _this.setUserProperties(x); });
|
2199
|
-
this.angulartics2.setAlias.subscribe(function (x) { return _this.setAlias(x); });
|
2200
|
-
}
|
2201
|
-
Angulartics2Segment.prototype.startTracking = function () {
|
2202
|
-
var _this = this;
|
2203
|
-
this.angulartics2.pageTrack
|
2204
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2205
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2206
|
-
this.angulartics2.eventTrack
|
2207
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2208
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2209
|
-
};
|
2210
|
-
/**
|
2211
|
-
* https://segment.com/docs/libraries/analytics.js/#page
|
2212
|
-
*
|
2213
|
-
* analytics.page([category], [name], [properties], [options], [callback]);
|
2214
|
-
*/
|
2215
|
-
Angulartics2Segment.prototype.pageTrack = function (path) {
|
2216
|
-
// TODO : Support optional parameters where the parameter order and type changes their meaning
|
2217
|
-
try {
|
2218
|
-
analytics.page(path);
|
2219
|
-
}
|
2220
|
-
catch (e) {
|
2221
|
-
if (!(e instanceof ReferenceError)) {
|
2222
|
-
throw e;
|
2223
|
-
}
|
2224
|
-
}
|
2225
|
-
};
|
2226
|
-
/**
|
2227
|
-
* https://segment.com/docs/libraries/analytics.js/#track
|
2228
|
-
*
|
2229
|
-
* analytics.track(event, [properties], [options], [callback]);
|
2230
|
-
*/
|
2231
|
-
Angulartics2Segment.prototype.eventTrack = function (action, properties) {
|
2232
|
-
try {
|
2233
|
-
analytics.track(action, properties);
|
2234
|
-
}
|
2235
|
-
catch (e) {
|
2236
|
-
if (!(e instanceof ReferenceError)) {
|
2237
|
-
throw e;
|
2238
|
-
}
|
2239
|
-
}
|
2240
|
-
};
|
2241
|
-
/**
|
2242
|
-
* https://segment.com/docs/libraries/analytics.js/#identify
|
2243
|
-
*
|
2244
|
-
* analytics.identify([userId], [traits], [options], [callback]);
|
2245
|
-
*/
|
2246
|
-
Angulartics2Segment.prototype.setUserProperties = function (properties) {
|
2247
|
-
try {
|
2248
|
-
if (properties.userId) {
|
2249
|
-
analytics.identify(properties.userId, properties);
|
2250
|
-
}
|
2251
|
-
else {
|
2252
|
-
analytics.identify(properties);
|
2253
|
-
}
|
2254
|
-
}
|
2255
|
-
catch (e) {
|
2256
|
-
if (!(e instanceof ReferenceError)) {
|
2257
|
-
throw e;
|
2258
|
-
}
|
2259
|
-
}
|
2260
|
-
};
|
2261
|
-
/**
|
2262
|
-
* https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#reset--logout
|
2263
|
-
*
|
2264
|
-
* analytics.reset();
|
2265
|
-
*/
|
2266
|
-
Angulartics2Segment.prototype.unsetUserProperties = function () {
|
2267
|
-
analytics.reset();
|
2268
|
-
};
|
2269
|
-
/**
|
2270
|
-
* https://segment.com/docs/libraries/analytics.js/#alias
|
2271
|
-
*
|
2272
|
-
* analytics.alias(userId, previousId, options, callback);
|
2273
|
-
*/
|
2274
|
-
Angulartics2Segment.prototype.setAlias = function (alias) {
|
2275
|
-
try {
|
2276
|
-
analytics.alias(alias);
|
2277
|
-
}
|
2278
|
-
catch (e) {
|
2279
|
-
if (!(e instanceof ReferenceError)) {
|
2280
|
-
throw e;
|
2281
|
-
}
|
2282
|
-
}
|
2283
|
-
};
|
2284
|
-
return Angulartics2Segment;
|
2285
|
-
}());
|
2286
|
-
Angulartics2Segment.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Segment_Factory() { return new Angulartics2Segment(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Segment, providedIn: "root" });
|
2287
|
-
Angulartics2Segment.decorators = [
|
2288
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2289
|
-
];
|
2290
|
-
Angulartics2Segment.ctorParameters = function () { return [
|
2291
|
-
{ type: Angulartics2 }
|
2292
|
-
]; };
|
2293
|
-
|
2294
|
-
var Angulartics2Intercom = /** @class */ (function () {
|
2295
|
-
function Angulartics2Intercom(angulartics2) {
|
2296
|
-
var _this = this;
|
2297
|
-
this.angulartics2 = angulartics2;
|
2298
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
2299
|
-
this.angulartics2.setUserPropertiesOnce.subscribe(function (x) { return _this.setUserProperties(x); });
|
2300
|
-
}
|
2301
|
-
Angulartics2Intercom.prototype.startTracking = function () {
|
2302
|
-
var _this = this;
|
2303
|
-
this.angulartics2.pageTrack
|
2304
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2305
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2306
|
-
this.angulartics2.eventTrack
|
2307
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2308
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2309
|
-
};
|
2310
|
-
Angulartics2Intercom.prototype.pageTrack = function (path) {
|
2311
|
-
try {
|
2312
|
-
this.eventTrack('Pageview', {
|
2313
|
-
url: path,
|
2314
|
-
});
|
2315
|
-
}
|
2316
|
-
catch (e) {
|
2317
|
-
if (!(e instanceof ReferenceError)) {
|
2318
|
-
throw e;
|
2319
|
-
}
|
2320
|
-
}
|
2321
|
-
};
|
2322
|
-
Angulartics2Intercom.prototype.eventTrack = function (action, properties) {
|
2323
|
-
try {
|
2324
|
-
Intercom('trackEvent', action, properties);
|
2325
|
-
}
|
2326
|
-
catch (e) {
|
2327
|
-
if (!(e instanceof ReferenceError)) {
|
2328
|
-
throw e;
|
2329
|
-
}
|
2330
|
-
}
|
2331
|
-
};
|
2332
|
-
Angulartics2Intercom.prototype.setUserProperties = function (properties) {
|
2333
|
-
try {
|
2334
|
-
if (properties.userId && !properties.user_id) {
|
2335
|
-
properties.user_id = properties.userId;
|
2336
|
-
}
|
2337
|
-
Intercom('boot', properties);
|
2338
|
-
}
|
2339
|
-
catch (e) {
|
2340
|
-
if (!(e instanceof ReferenceError)) {
|
2341
|
-
throw e;
|
2342
|
-
}
|
2343
|
-
}
|
2344
|
-
};
|
2345
|
-
return Angulartics2Intercom;
|
2346
|
-
}());
|
2347
|
-
Angulartics2Intercom.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Intercom_Factory() { return new Angulartics2Intercom(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Intercom, providedIn: "root" });
|
2348
|
-
Angulartics2Intercom.decorators = [
|
2349
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2350
|
-
];
|
2351
|
-
Angulartics2Intercom.ctorParameters = function () { return [
|
2352
|
-
{ type: Angulartics2 }
|
2353
|
-
]; };
|
2354
|
-
|
2355
|
-
var Angulartics2Woopra = /** @class */ (function () {
|
2356
|
-
function Angulartics2Woopra(angulartics2) {
|
2357
|
-
var _this = this;
|
2358
|
-
this.angulartics2 = angulartics2;
|
2359
|
-
if (typeof woopra === 'undefined') {
|
2360
|
-
console.warn('Woopra not found');
|
2361
|
-
}
|
2362
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
2363
|
-
}
|
2364
|
-
Angulartics2Woopra.prototype.startTracking = function () {
|
2365
|
-
var _this = this;
|
2366
|
-
this.angulartics2.pageTrack
|
2367
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2368
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2369
|
-
this.angulartics2.eventTrack
|
2370
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2371
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2372
|
-
};
|
2373
|
-
Angulartics2Woopra.prototype.pageTrack = function (path) {
|
2374
|
-
try {
|
2375
|
-
woopra.track('pv', {
|
2376
|
-
url: path,
|
2377
|
-
});
|
2378
|
-
}
|
2379
|
-
catch (e) {
|
2380
|
-
if (!(e instanceof ReferenceError)) {
|
2381
|
-
throw e;
|
2382
|
-
}
|
2383
|
-
}
|
2384
|
-
};
|
2385
|
-
Angulartics2Woopra.prototype.eventTrack = function (action, properties) {
|
2386
|
-
try {
|
2387
|
-
woopra.track(action, properties);
|
2388
|
-
}
|
2389
|
-
catch (e) {
|
2390
|
-
if (!(e instanceof ReferenceError)) {
|
2391
|
-
throw e;
|
2392
|
-
}
|
2393
|
-
}
|
2394
|
-
};
|
2395
|
-
Angulartics2Woopra.prototype.setUserProperties = function (properties) {
|
2396
|
-
try {
|
2397
|
-
if (properties.email) {
|
2398
|
-
woopra.identify(properties);
|
2399
|
-
}
|
2400
|
-
}
|
2401
|
-
catch (e) {
|
2402
|
-
if (!(e instanceof ReferenceError)) {
|
2403
|
-
throw e;
|
2404
|
-
}
|
2405
|
-
}
|
2406
|
-
};
|
2407
|
-
return Angulartics2Woopra;
|
2408
|
-
}());
|
2409
|
-
Angulartics2Woopra.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Woopra_Factory() { return new Angulartics2Woopra(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Woopra, providedIn: "root" });
|
2410
|
-
Angulartics2Woopra.decorators = [
|
2411
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2412
|
-
];
|
2413
|
-
Angulartics2Woopra.ctorParameters = function () { return [
|
2414
|
-
{ type: Angulartics2 }
|
2415
|
-
]; };
|
2416
|
-
|
2417
|
-
var Angulartics2Clicky = /** @class */ (function () {
|
2418
|
-
function Angulartics2Clicky(angulartics2, titleService) {
|
2419
|
-
this.angulartics2 = angulartics2;
|
2420
|
-
this.titleService = titleService;
|
2421
|
-
if (typeof clicky === 'undefined') {
|
2422
|
-
console.warn('Angulartics 2 Clicky Plugin: clicky global not found');
|
2423
|
-
}
|
2424
|
-
}
|
2425
|
-
Angulartics2Clicky.prototype.startTracking = function () {
|
2426
|
-
var _this = this;
|
2427
|
-
this.angulartics2.pageTrack
|
2428
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2429
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2430
|
-
this.angulartics2.eventTrack
|
2431
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2432
|
-
.subscribe(function (x) { return _this.eventOrGoalTrack(x.action, x.properties); });
|
2433
|
-
};
|
2434
|
-
/**
|
2435
|
-
* Track Page in Clicky
|
2436
|
-
*
|
2437
|
-
* @param path location
|
2438
|
-
*
|
2439
|
-
* @link https://clicky.com/help/custom/manual#log
|
2440
|
-
*/
|
2441
|
-
Angulartics2Clicky.prototype.pageTrack = function (path) {
|
2442
|
-
var title = this.titleService.getTitle();
|
2443
|
-
clicky.log(path, title, 'pageview');
|
2444
|
-
};
|
2445
|
-
/**
|
2446
|
-
* Track Event Or Goal in Clicky
|
2447
|
-
*
|
2448
|
-
* @param action Action name
|
2449
|
-
* @param properties Definition of 'properties.goal' determines goal vs event tracking
|
2450
|
-
*
|
2451
|
-
* @link https://clicky.com/help/custom/manual#log
|
2452
|
-
* @link https://clicky.com/help/custom/manual#goal
|
2453
|
-
*/
|
2454
|
-
Angulartics2Clicky.prototype.eventOrGoalTrack = function (action, properties) {
|
2455
|
-
if (typeof properties.goal === 'undefined') {
|
2456
|
-
var title = properties.title || null;
|
2457
|
-
var type = properties.type != null ? this.validateType(properties.type) : null;
|
2458
|
-
clicky.log(action, title, type);
|
2459
|
-
}
|
2460
|
-
else {
|
2461
|
-
var goalId = properties.goal;
|
2462
|
-
var revenue = properties.revenue;
|
2463
|
-
clicky.goal(goalId, revenue, !!properties.noQueue);
|
2464
|
-
}
|
2465
|
-
};
|
2466
|
-
Angulartics2Clicky.prototype.validateType = function (type) {
|
2467
|
-
var EventType = ['pageview', 'click', 'download', 'outbound'];
|
2468
|
-
return EventType.indexOf(type) > -1 ? type : 'pageview';
|
2469
|
-
};
|
2470
|
-
return Angulartics2Clicky;
|
2471
|
-
}());
|
2472
|
-
Angulartics2Clicky.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Clicky_Factory() { return new Angulartics2Clicky(i0__namespace.ɵɵinject(Angulartics2), i0__namespace.ɵɵinject(i2__namespace$1.Title)); }, token: Angulartics2Clicky, providedIn: "root" });
|
2473
|
-
Angulartics2Clicky.decorators = [
|
2474
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2475
|
-
];
|
2476
|
-
Angulartics2Clicky.ctorParameters = function () { return [
|
2477
|
-
{ type: Angulartics2 },
|
2478
|
-
{ type: i2$1.Title }
|
2479
|
-
]; };
|
2480
|
-
|
2481
|
-
var Angulartics2Amplitude = /** @class */ (function () {
|
2482
|
-
function Angulartics2Amplitude(angulartics2) {
|
2483
|
-
var _this = this;
|
2484
|
-
this.angulartics2 = angulartics2;
|
2485
|
-
this.angulartics2.setUsername.subscribe(function (x) { return _this.setUsername(x); });
|
2486
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
2487
|
-
this.angulartics2.setUserPropertiesOnce.subscribe(function (x) { return _this.setUserProperties(x); });
|
2488
|
-
}
|
2489
|
-
Angulartics2Amplitude.prototype.startTracking = function () {
|
2490
|
-
var _this = this;
|
2491
|
-
this.angulartics2.pageTrack
|
2492
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2493
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2494
|
-
this.angulartics2.eventTrack
|
2495
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2496
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2497
|
-
};
|
2498
|
-
Angulartics2Amplitude.prototype.pageTrack = function (path) {
|
2499
|
-
try {
|
2500
|
-
this.eventTrack('Pageview', {
|
2501
|
-
url: path,
|
2502
|
-
});
|
2503
|
-
}
|
2504
|
-
catch (e) {
|
2505
|
-
if (!(e instanceof ReferenceError)) {
|
2506
|
-
throw e;
|
2507
|
-
}
|
2508
|
-
}
|
2509
|
-
};
|
2510
|
-
Angulartics2Amplitude.prototype.eventTrack = function (action, properties) {
|
2511
|
-
try {
|
2512
|
-
amplitude.getInstance().logEvent(action, properties);
|
2513
|
-
}
|
2514
|
-
catch (e) {
|
2515
|
-
if (!(e instanceof ReferenceError)) {
|
2516
|
-
throw e;
|
2517
|
-
}
|
2518
|
-
}
|
2519
|
-
};
|
2520
|
-
Angulartics2Amplitude.prototype.setUsername = function (userId) {
|
2521
|
-
try {
|
2522
|
-
amplitude.getInstance().setUserId(userId);
|
2523
|
-
}
|
2524
|
-
catch (e) {
|
2525
|
-
if (!(e instanceof ReferenceError)) {
|
2526
|
-
throw e;
|
2527
|
-
}
|
2528
|
-
}
|
2529
|
-
};
|
2530
|
-
Angulartics2Amplitude.prototype.setUserProperties = function (properties) {
|
2531
|
-
try {
|
2532
|
-
amplitude.getInstance().setUserProperties(properties);
|
2533
|
-
}
|
2534
|
-
catch (e) {
|
2535
|
-
if (!(e instanceof ReferenceError)) {
|
2536
|
-
throw e;
|
2537
|
-
}
|
2538
|
-
}
|
2539
|
-
};
|
2540
|
-
return Angulartics2Amplitude;
|
2541
|
-
}());
|
2542
|
-
Angulartics2Amplitude.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Amplitude_Factory() { return new Angulartics2Amplitude(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Amplitude, providedIn: "root" });
|
2543
|
-
Angulartics2Amplitude.decorators = [
|
2544
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2545
|
-
];
|
2546
|
-
Angulartics2Amplitude.ctorParameters = function () { return [
|
2547
|
-
{ type: Angulartics2 }
|
2548
|
-
]; };
|
2549
|
-
|
2550
|
-
var Angulartics2Splunk = /** @class */ (function () {
|
2551
|
-
function Angulartics2Splunk(angulartics2) {
|
2552
|
-
this.angulartics2 = angulartics2;
|
2553
|
-
if (typeof sp === 'undefined') {
|
2554
|
-
console.warn('Splunk not found');
|
2555
|
-
}
|
2556
|
-
}
|
2557
|
-
Angulartics2Splunk.prototype.startTracking = function () {
|
2558
|
-
var _this = this;
|
2559
|
-
this.angulartics2.pageTrack
|
2560
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2561
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2562
|
-
this.angulartics2.eventTrack
|
2563
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2564
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2565
|
-
};
|
2566
|
-
Angulartics2Splunk.prototype.pageTrack = function (path) {
|
2567
|
-
try {
|
2568
|
-
sp.pageview(path);
|
2569
|
-
}
|
2570
|
-
catch (e) {
|
2571
|
-
if (!(e instanceof ReferenceError)) {
|
2572
|
-
throw e;
|
2573
|
-
}
|
2574
|
-
}
|
2575
|
-
};
|
2576
|
-
Angulartics2Splunk.prototype.eventTrack = function (action, properties) {
|
2577
|
-
try {
|
2578
|
-
sp.track(action, properties);
|
2579
|
-
}
|
2580
|
-
catch (e) {
|
2581
|
-
if (!(e instanceof ReferenceError)) {
|
2582
|
-
throw e;
|
2583
|
-
}
|
2584
|
-
}
|
2585
|
-
};
|
2586
|
-
return Angulartics2Splunk;
|
2587
|
-
}());
|
2588
|
-
Angulartics2Splunk.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2Splunk_Factory() { return new Angulartics2Splunk(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2Splunk, providedIn: "root" });
|
2589
|
-
Angulartics2Splunk.decorators = [
|
2590
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2591
|
-
];
|
2592
|
-
Angulartics2Splunk.ctorParameters = function () { return [
|
2593
|
-
{ type: Angulartics2 }
|
2594
|
-
]; };
|
2595
|
-
|
2596
|
-
var Angulartics2IBMDigitalAnalytics = /** @class */ (function () {
|
2597
|
-
function Angulartics2IBMDigitalAnalytics(angulartics2) {
|
2598
|
-
this.angulartics2 = angulartics2;
|
2599
|
-
if (typeof window['cmCreatePageviewTag'] !== 'function') {
|
2600
|
-
console.warn('Angulartics 2 IBM Digital Analytics Plugin: eluminate.js is not loaded');
|
2601
|
-
}
|
2602
|
-
}
|
2603
|
-
Angulartics2IBMDigitalAnalytics.prototype.startTracking = function () {
|
2604
|
-
var _this = this;
|
2605
|
-
this.angulartics2.pageTrack
|
2606
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2607
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2608
|
-
this.angulartics2.eventTrack
|
2609
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2610
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2611
|
-
};
|
2612
|
-
/**
|
2613
|
-
* Track Page in IBM Digital Analytics
|
2614
|
-
*
|
2615
|
-
* @param path location
|
2616
|
-
*
|
2617
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_pageviewtag.html
|
2618
|
-
*/
|
2619
|
-
Angulartics2IBMDigitalAnalytics.prototype.pageTrack = function (path) {
|
2620
|
-
var cmCreatePageviewTag = window['cmCreatePageviewTag'];
|
2621
|
-
cmCreatePageviewTag(path, null, null, null);
|
2622
|
-
};
|
2623
|
-
/**
|
2624
|
-
* Track an event in IBM Digital Analytics
|
2625
|
-
*
|
2626
|
-
* @param action A string corresponding to the type of event that needs to be tracked.
|
2627
|
-
* @param properties The properties that need to be logged with the event.
|
2628
|
-
*/
|
2629
|
-
Angulartics2IBMDigitalAnalytics.prototype.eventTrack = function (action, properties) {
|
2630
|
-
if (properties === void 0) { properties = {}; }
|
2631
|
-
var cmDisplayShops = window['cmDisplayShops'];
|
2632
|
-
switch (action) {
|
2633
|
-
/**
|
2634
|
-
* @description The Product View tag captures information about vdigitalDataiews of product detail pages.
|
2635
|
-
* The Product View tag should be called on the lowest level detail page for products, which is typically
|
2636
|
-
* the Product Details page. You can view example Product View tags below.
|
2637
|
-
*
|
2638
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_prodviewtag.html
|
2639
|
-
*/
|
2640
|
-
case 'cmCreateProductviewTag':
|
2641
|
-
var cmCreateProductviewTag = window['cmCreateProductviewTag'];
|
2642
|
-
cmCreateProductviewTag(properties.productId, properties.productName, properties.categoryId, properties.attrbute, properties.virtualCategory);
|
2643
|
-
break;
|
2644
|
-
/**
|
2645
|
-
* @description The Shop Action 5 tag captures data about selected products and which products are present in a shopping cart,
|
2646
|
-
* if any, when the cart is viewed.
|
2647
|
-
*
|
2648
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_shopact5tag.html
|
2649
|
-
*/
|
2650
|
-
case 'cmCreateShopAction5Tag':
|
2651
|
-
var cmCreateShopAction5Tag = window['cmCreateShopAction5Tag'];
|
2652
|
-
cmCreateShopAction5Tag(properties.productId, properties.productName, properties.quantity, properties.unitPrice, properties.categoryId, properties.attrbute, properties.extraFields, properties.virtualCategory);
|
2653
|
-
cmDisplayShops();
|
2654
|
-
break;
|
2655
|
-
/**
|
2656
|
-
* @description The Shop Action 9 tag captures data about what products were purchased by a customer.
|
2657
|
-
* Like the Shop Action 5 tag, one tag should be sent for each product line item purchased. These tags should be sent
|
2658
|
-
* on the receipt or other completion page confirming a successful order.
|
2659
|
-
*
|
2660
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_shopact9tag.html
|
2661
|
-
*/
|
2662
|
-
case 'cmCreateShopAction9Tag':
|
2663
|
-
var cmCreateShopAction9Tag = window['cmCreateShopAction9Tag'];
|
2664
|
-
cmCreateShopAction9Tag(properties.productId, properties.productName, properties.quantity, properties.unitPrice, properties.registrationId, properties.orderId, properties.orderSubtotal, properties.categoryId, properties.attrbute, properties.extraFields);
|
2665
|
-
cmDisplayShops();
|
2666
|
-
break;
|
2667
|
-
/**
|
2668
|
-
* @description The Order tag captures order header information such as Registration ID, order ID, order subtotal,
|
2669
|
-
* and shipping and handling. The Order tag should be sent on the receipt page confirming order completion.
|
2670
|
-
*
|
2671
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_ordertag.html
|
2672
|
-
*/
|
2673
|
-
case 'cmCreateOrderTag':
|
2674
|
-
var cmCreateOrderTag = window['cmCreateOrderTag'];
|
2675
|
-
cmCreateOrderTag(properties.orderId, properties.orderSubtotal, properties.orderShipping, properties.registrationId, properties.registrantCity, properties.registrantState, properties.registrantPostalCode, properties.attrbute, properties.extraFields);
|
2676
|
-
break;
|
2677
|
-
/**
|
2678
|
-
* @description The Registration tag creates a Lifetime Visitor Experience Profile (LIVE Profile) by associating a single
|
2679
|
-
* common Registration ID with the IBM® Digital Analytics permanent cookie set in every browser visiting the tagged site.
|
2680
|
-
*
|
2681
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_registrationtag.html
|
2682
|
-
*/
|
2683
|
-
case 'cmCreateRegistrationTag':
|
2684
|
-
var cmCreateRegistrationTag = window['cmCreateRegistrationTag'];
|
2685
|
-
cmCreateRegistrationTag(properties.registrationId, properties.registrantEmail, properties.registrantCity, properties.registrantState, properties.registrantPostalCode, properties.registrantCountry, properties.attrbute);
|
2686
|
-
break;
|
2687
|
-
/**
|
2688
|
-
* @description The Element tag is used to track intra-page content in IBM® Digital Analytics. Data collected by
|
2689
|
-
* the Element tag is used to populate values in the Element Categories and Top Viewed Elements reports.
|
2690
|
-
*
|
2691
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_elementtag.html
|
2692
|
-
*/
|
2693
|
-
case 'cmCreateElementTag':
|
2694
|
-
var cmCreateElementTag = window['cmCreateElementTag'];
|
2695
|
-
cmCreateElementTag(properties.elementId, properties.elementCategory, properties.attrbute);
|
2696
|
-
break;
|
2697
|
-
/**
|
2698
|
-
* @description The Conversion Event tag is employed for tracking of general non-commerce conversion events.
|
2699
|
-
* The Conversion Event tag is used to populate values in the Conversion Events Reports and to create Key Segments.
|
2700
|
-
* This tag and the reports it populates enable analysis of a wide variety of site activities.
|
2701
|
-
*
|
2702
|
-
* @link https://www.ibm.com/support/knowledgecenter/SSPG9M/Implementation/impl_conversioneventtag.html
|
2703
|
-
*/
|
2704
|
-
case 'cmCreateConversionEventTag':
|
2705
|
-
var cmCreateConversionEventTag = window['cmCreateConversionEventTag'];
|
2706
|
-
cmCreateConversionEventTag(properties.eventId, properties.actionType, properties.eventCategoryId, properties.points, properties.attrbute, properties.extraFields);
|
2707
|
-
break;
|
2708
|
-
default:
|
2709
|
-
console.warn('Unsupported Event Action');
|
2710
|
-
}
|
2711
|
-
};
|
2712
|
-
return Angulartics2IBMDigitalAnalytics;
|
2713
|
-
}());
|
2714
|
-
Angulartics2IBMDigitalAnalytics.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2IBMDigitalAnalytics_Factory() { return new Angulartics2IBMDigitalAnalytics(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2IBMDigitalAnalytics, providedIn: "root" });
|
2715
|
-
Angulartics2IBMDigitalAnalytics.decorators = [
|
2716
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2717
|
-
];
|
2718
|
-
Angulartics2IBMDigitalAnalytics.ctorParameters = function () { return [
|
2719
|
-
{ type: Angulartics2 }
|
2720
|
-
]; };
|
2721
|
-
|
2722
|
-
var Angulartics2GoSquared = /** @class */ (function () {
|
2723
|
-
function Angulartics2GoSquared(angulartics2) {
|
2724
|
-
var _this = this;
|
2725
|
-
this.angulartics2 = angulartics2;
|
2726
|
-
this.angulartics2.setUserProperties.subscribe(function (x) { return _this.setUserProperties(x); });
|
2727
|
-
this.angulartics2.setUserPropertiesOnce.subscribe(function (x) { return _this.setUserProperties(x); });
|
2728
|
-
}
|
2729
|
-
Angulartics2GoSquared.prototype.startTracking = function () {
|
2730
|
-
var _this = this;
|
2731
|
-
this.angulartics2.pageTrack
|
2732
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2733
|
-
.subscribe(function (x) { return _this.pageTrack(x.path); });
|
2734
|
-
this.angulartics2.eventTrack
|
2735
|
-
.pipe(this.angulartics2.filterDeveloperMode())
|
2736
|
-
.subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
|
2737
|
-
};
|
2738
|
-
Angulartics2GoSquared.prototype.pageTrack = function (path) {
|
2739
|
-
try {
|
2740
|
-
_gs('track', path);
|
2741
|
-
}
|
2742
|
-
catch (e) {
|
2743
|
-
if (!(e instanceof ReferenceError)) {
|
2744
|
-
throw e;
|
2745
|
-
}
|
2746
|
-
}
|
2747
|
-
};
|
2748
|
-
Angulartics2GoSquared.prototype.eventTrack = function (action, properties) {
|
2749
|
-
try {
|
2750
|
-
_gs('event', action, properties);
|
2751
|
-
}
|
2752
|
-
catch (e) {
|
2753
|
-
if (!(e instanceof ReferenceError)) {
|
2754
|
-
throw e;
|
2755
|
-
}
|
2756
|
-
}
|
2757
|
-
};
|
2758
|
-
Angulartics2GoSquared.prototype.setUserProperties = function (properties) {
|
2759
|
-
try {
|
2760
|
-
_gs('identify', properties);
|
2761
|
-
}
|
2762
|
-
catch (e) {
|
2763
|
-
if (!(e instanceof ReferenceError)) {
|
2764
|
-
throw e;
|
2765
|
-
}
|
2766
|
-
}
|
2767
|
-
};
|
2768
|
-
return Angulartics2GoSquared;
|
2769
|
-
}());
|
2770
|
-
Angulartics2GoSquared.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Angulartics2GoSquared_Factory() { return new Angulartics2GoSquared(i0__namespace.ɵɵinject(Angulartics2)); }, token: Angulartics2GoSquared, providedIn: "root" });
|
2771
|
-
Angulartics2GoSquared.decorators = [
|
2772
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2773
|
-
];
|
2774
|
-
Angulartics2GoSquared.ctorParameters = function () { return [
|
2775
|
-
{ type: Angulartics2 }
|
2776
|
-
]; };
|
2777
|
-
|
2778
|
-
/**
|
2779
|
-
* Generated bundle index. Do not edit.
|
2780
|
-
*/
|
2781
|
-
|
2782
|
-
exports.ANGULARTICS2_TOKEN = ANGULARTICS2_TOKEN;
|
2783
|
-
exports.AngularRouterTracking = AngularRouterTracking;
|
2784
|
-
exports.Angulartics2 = Angulartics2;
|
2785
|
-
exports.Angulartics2AdobeAnalytics = Angulartics2AdobeAnalytics;
|
2786
|
-
exports.Angulartics2Amplitude = Angulartics2Amplitude;
|
2787
|
-
exports.Angulartics2AppInsights = Angulartics2AppInsights;
|
2788
|
-
exports.Angulartics2BaiduAnalytics = Angulartics2BaiduAnalytics;
|
2789
|
-
exports.Angulartics2Clicky = Angulartics2Clicky;
|
2790
|
-
exports.Angulartics2Facebook = Angulartics2Facebook;
|
2791
|
-
exports.Angulartics2GoSquared = Angulartics2GoSquared;
|
2792
|
-
exports.Angulartics2GoogleAnalytics = Angulartics2GoogleAnalytics;
|
2793
|
-
exports.Angulartics2GoogleAnalyticsEnhancedEcommerce = Angulartics2GoogleAnalyticsEnhancedEcommerce;
|
2794
|
-
exports.Angulartics2GoogleGlobalSiteTag = Angulartics2GoogleGlobalSiteTag;
|
2795
|
-
exports.Angulartics2GoogleTagManager = Angulartics2GoogleTagManager;
|
2796
|
-
exports.Angulartics2Hubspot = Angulartics2Hubspot;
|
2797
|
-
exports.Angulartics2IBMDigitalAnalytics = Angulartics2IBMDigitalAnalytics;
|
2798
|
-
exports.Angulartics2Intercom = Angulartics2Intercom;
|
2799
|
-
exports.Angulartics2Kissmetrics = Angulartics2Kissmetrics;
|
2800
|
-
exports.Angulartics2LaunchByAdobe = Angulartics2LaunchByAdobe;
|
2801
|
-
exports.Angulartics2Matomo = Angulartics2Matomo;
|
2802
|
-
exports.Angulartics2Mixpanel = Angulartics2Mixpanel;
|
2803
|
-
exports.Angulartics2Module = Angulartics2Module;
|
2804
|
-
exports.Angulartics2On = Angulartics2On;
|
2805
|
-
exports.Angulartics2OnModule = Angulartics2OnModule;
|
2806
|
-
exports.Angulartics2Pyze = Angulartics2Pyze;
|
2807
|
-
exports.Angulartics2RouterlessModule = Angulartics2RouterlessModule;
|
2808
|
-
exports.Angulartics2Segment = Angulartics2Segment;
|
2809
|
-
exports.Angulartics2Splunk = Angulartics2Splunk;
|
2810
|
-
exports.Angulartics2Woopra = Angulartics2Woopra;
|
2811
|
-
exports.AppInsightsDefaults = AppInsightsDefaults;
|
2812
|
-
exports.DefaultConfig = DefaultConfig;
|
2813
|
-
exports.GoogleAnalyticsDefaults = GoogleAnalyticsDefaults;
|
2814
|
-
exports.GoogleGlobalSiteTagDefaults = GoogleGlobalSiteTagDefaults;
|
2815
|
-
exports.GoogleTagManagerDefaults = GoogleTagManagerDefaults;
|
2816
|
-
exports.RouterlessTracking = RouterlessTracking;
|
2817
|
-
|
2818
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
2819
|
-
|
2820
|
-
}));
|
2821
|
-
//# sourceMappingURL=angulartics2.umd.js.map
|