aesirx-analytics 2.2.11 → 2.2.12
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/README.md +2 -0
- package/dist/{Consent-57MTI7TD.js → Consent-QTHZTQUK.js} +14 -10
- package/dist/ConsentCustom-HQ6RMLQ6.js +1157 -0
- package/dist/analytics.js +1168 -378
- package/dist/{chunk-5VSCCPP6.js → chunk-PD33NAQI.js} +1036 -301
- package/dist/{chunk-N36VEWSG.js → chunk-R4T7FUMB.js} +412 -46
- package/dist/chunk-UJTYOAT7.js +464 -0
- package/dist/index.js +24 -470
- package/package.json +2 -2
- package/dist/ConsentCustom-EZS7JI2G.js +0 -934
@@ -0,0 +1,464 @@
|
|
1
|
+
// src/lib/envHelper.ts
|
2
|
+
var getHashKey = () => {
|
3
|
+
let value = null;
|
4
|
+
try {
|
5
|
+
if (typeof process.env != "undefined") {
|
6
|
+
value = process.env.SECURE_LOCAL_STORAGE_HASH_KEY || process.env.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY || process.env.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY || process.env.VITE_SECURE_LOCAL_STORAGE_HASH_KEY;
|
7
|
+
} else {
|
8
|
+
console.warn(`react-secure-storage : process is not defined! Just a warning!`);
|
9
|
+
}
|
10
|
+
} catch (ex) {
|
11
|
+
return null;
|
12
|
+
}
|
13
|
+
return value;
|
14
|
+
};
|
15
|
+
var getStoragePrefix = () => {
|
16
|
+
let value = null;
|
17
|
+
try {
|
18
|
+
if (typeof process.env != "undefined") {
|
19
|
+
value = process.env.SECURE_LOCAL_STORAGE_PREFIX || process.env.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX || process.env.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX || process.env.VITE_SECURE_LOCAL_STORAGE_PREFIX;
|
20
|
+
} else {
|
21
|
+
console.warn(`react-secure-storage : process is not defined! Just a warning!`);
|
22
|
+
}
|
23
|
+
} catch (ex) {
|
24
|
+
return null;
|
25
|
+
}
|
26
|
+
return value;
|
27
|
+
};
|
28
|
+
var getDisabledKeys = () => {
|
29
|
+
let value = null;
|
30
|
+
try {
|
31
|
+
if (typeof process.env != "undefined") {
|
32
|
+
value = process.env.SECURE_LOCAL_STORAGE_DISABLED_KEYS || process.env.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS || process.env.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS || process.env.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS;
|
33
|
+
} else {
|
34
|
+
console.warn(`react-secure-storage : process is not defined! Just a warning!`);
|
35
|
+
}
|
36
|
+
} catch (ex) {
|
37
|
+
return null;
|
38
|
+
}
|
39
|
+
return value;
|
40
|
+
};
|
41
|
+
var envHelper = {
|
42
|
+
getHashKey,
|
43
|
+
getStoragePrefix,
|
44
|
+
getDisabledKeys
|
45
|
+
};
|
46
|
+
var envHelper_default = envHelper;
|
47
|
+
|
48
|
+
// src/lib/fingerpint.lib.ts
|
49
|
+
import murmurhash3_32_gc from "murmurhash-js/murmurhash3_gc";
|
50
|
+
|
51
|
+
// src/lib/utils.ts
|
52
|
+
var FINGERPRINT_KEYS = {
|
53
|
+
USERAGENT: "UserAgent",
|
54
|
+
SCREEN_PRINT: "ScreenPrint",
|
55
|
+
PLUGINS: "Plugins",
|
56
|
+
FONTS: "Fonts",
|
57
|
+
LOCAL_STORAGE: "LocalStorage",
|
58
|
+
SESSION_STORAGE: "SessionStorage",
|
59
|
+
TIMEZONE: "TimeZone",
|
60
|
+
LANGUAGE: "Language",
|
61
|
+
SYSTEM_LANGUAGE: "SystemLanguage",
|
62
|
+
COOKIE: "Cookie",
|
63
|
+
CANVAS: "Canvas",
|
64
|
+
HOSTNAME: "Hostname"
|
65
|
+
};
|
66
|
+
var getDisabledKeys2 = () => {
|
67
|
+
const DISABLED_KEYS = envHelper_default.getDisabledKeys() || "";
|
68
|
+
if (DISABLED_KEYS === "")
|
69
|
+
return [];
|
70
|
+
const allOptions = [
|
71
|
+
FINGERPRINT_KEYS.USERAGENT,
|
72
|
+
FINGERPRINT_KEYS.SCREEN_PRINT,
|
73
|
+
FINGERPRINT_KEYS.PLUGINS,
|
74
|
+
FINGERPRINT_KEYS.FONTS,
|
75
|
+
FINGERPRINT_KEYS.LOCAL_STORAGE,
|
76
|
+
FINGERPRINT_KEYS.SESSION_STORAGE,
|
77
|
+
FINGERPRINT_KEYS.TIMEZONE,
|
78
|
+
FINGERPRINT_KEYS.LANGUAGE,
|
79
|
+
FINGERPRINT_KEYS.SYSTEM_LANGUAGE,
|
80
|
+
FINGERPRINT_KEYS.COOKIE,
|
81
|
+
FINGERPRINT_KEYS.CANVAS,
|
82
|
+
FINGERPRINT_KEYS.HOSTNAME
|
83
|
+
];
|
84
|
+
const response = [];
|
85
|
+
DISABLED_KEYS.split("|").forEach((key) => {
|
86
|
+
if (key === "") {
|
87
|
+
console.log("test");
|
88
|
+
} else if (allOptions.includes(key))
|
89
|
+
response.push(key);
|
90
|
+
else
|
91
|
+
console.warn(
|
92
|
+
`react-secure-storage : ${key} is not present in the available disabled keys options! Please go through the documentation`
|
93
|
+
);
|
94
|
+
});
|
95
|
+
return response;
|
96
|
+
};
|
97
|
+
|
98
|
+
// src/lib/fingerpint.lib.ts
|
99
|
+
var ClientJS = class {
|
100
|
+
//
|
101
|
+
// MAIN METHODS
|
102
|
+
//
|
103
|
+
// Get Fingerprint. Return a 32-bit integer representing the browsers fingerprint.
|
104
|
+
getFingerprint() {
|
105
|
+
const bar = "|";
|
106
|
+
const disabledKeys = getDisabledKeys2();
|
107
|
+
let key = "";
|
108
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.USERAGENT)) {
|
109
|
+
key += navigator.userAgent + bar;
|
110
|
+
}
|
111
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.HOSTNAME)) {
|
112
|
+
key += window.location.hostname + bar;
|
113
|
+
}
|
114
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.SCREEN_PRINT)) {
|
115
|
+
key += this.getScreenPrint() + bar;
|
116
|
+
}
|
117
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.PLUGINS)) {
|
118
|
+
key += this.getPlugins() + bar;
|
119
|
+
}
|
120
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.FONTS)) {
|
121
|
+
key += this.getFonts() + bar;
|
122
|
+
}
|
123
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.LOCAL_STORAGE)) {
|
124
|
+
key += this.isLocalStorage() + bar;
|
125
|
+
}
|
126
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.SESSION_STORAGE)) {
|
127
|
+
key += this.isSessionStorage() + bar;
|
128
|
+
}
|
129
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.TIMEZONE)) {
|
130
|
+
key += this.getTimeZone() + bar;
|
131
|
+
}
|
132
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.LANGUAGE)) {
|
133
|
+
key += this.getLanguage() + bar;
|
134
|
+
}
|
135
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.SYSTEM_LANGUAGE)) {
|
136
|
+
key += this.getSystemLanguage() + bar;
|
137
|
+
}
|
138
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.COOKIE)) {
|
139
|
+
key += this.isCookie() + bar;
|
140
|
+
}
|
141
|
+
if (!disabledKeys.includes(FINGERPRINT_KEYS.CANVAS)) {
|
142
|
+
key += this.getCanvasPrint();
|
143
|
+
}
|
144
|
+
if (key.endsWith(bar))
|
145
|
+
key = key.substring(0, key.length - 1);
|
146
|
+
const seed = 256;
|
147
|
+
return murmurhash3_32_gc(key, seed);
|
148
|
+
}
|
149
|
+
//
|
150
|
+
// SCREEN METHODS
|
151
|
+
//
|
152
|
+
// Get Screen Print. Return a string containing screen information.
|
153
|
+
getScreenPrint() {
|
154
|
+
return "Color Depth: " + this.getColorDepth() + ", Device XDPI: " + this.getDeviceXDPI() + ", Device YDPI: " + this.getDeviceYDPI();
|
155
|
+
}
|
156
|
+
// Get Color Depth. Return a string containing the color depth.
|
157
|
+
getColorDepth() {
|
158
|
+
return window.screen.colorDepth;
|
159
|
+
}
|
160
|
+
// Get Current Resolution. Return a string containing the current resolution.
|
161
|
+
getCurrentResolution() {
|
162
|
+
return window.screen.width + "x" + window.screen.height;
|
163
|
+
}
|
164
|
+
// Get Available Resolution. Return a string containing the available resolution.
|
165
|
+
getAvailableResolution() {
|
166
|
+
return window.screen.availWidth + "x" + window.screen.availHeight;
|
167
|
+
}
|
168
|
+
// Get Device XPDI. Return a string containing the device XPDI.
|
169
|
+
getDeviceXDPI() {
|
170
|
+
return "";
|
171
|
+
}
|
172
|
+
// Get Device YDPI. Return a string containing the device YDPI.
|
173
|
+
getDeviceYDPI() {
|
174
|
+
return "";
|
175
|
+
}
|
176
|
+
//
|
177
|
+
// PLUGIN METHODS
|
178
|
+
//
|
179
|
+
// Get Plugins. Return a string containing a list of installed plugins.
|
180
|
+
getPlugins() {
|
181
|
+
let pluginsList = "";
|
182
|
+
for (let i = 0; i < navigator.plugins.length; i++) {
|
183
|
+
if (i === navigator.plugins.length - 1) {
|
184
|
+
pluginsList += navigator.plugins[i].name;
|
185
|
+
} else {
|
186
|
+
pluginsList += navigator.plugins[i].name + ", ";
|
187
|
+
}
|
188
|
+
}
|
189
|
+
return pluginsList;
|
190
|
+
}
|
191
|
+
//
|
192
|
+
// FONT METHODS
|
193
|
+
//
|
194
|
+
// Get Fonts. Return a string containing a list of installed fonts.
|
195
|
+
getFonts() {
|
196
|
+
const fontString = "";
|
197
|
+
return fontString;
|
198
|
+
}
|
199
|
+
//
|
200
|
+
// STORAGE METHODS
|
201
|
+
//
|
202
|
+
// Is Local Storage. Check if local storage is enabled.
|
203
|
+
isLocalStorage() {
|
204
|
+
try {
|
205
|
+
return !!localStorage;
|
206
|
+
} catch (e) {
|
207
|
+
return true;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
// Is Session Storage. Check if session storage is enabled.
|
211
|
+
isSessionStorage() {
|
212
|
+
try {
|
213
|
+
return !!sessionStorage;
|
214
|
+
} catch (e) {
|
215
|
+
return true;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
// Is Cookie. Check if cookies are enabled.
|
219
|
+
isCookie() {
|
220
|
+
return navigator.cookieEnabled;
|
221
|
+
}
|
222
|
+
//
|
223
|
+
// TIME METHODS
|
224
|
+
//
|
225
|
+
// Get Time Zone. Return a string containing the time zone.
|
226
|
+
getTimeZone() {
|
227
|
+
const rightNow = /* @__PURE__ */ new Date();
|
228
|
+
let myNumber, formattedNumber, result;
|
229
|
+
myNumber = String(-(rightNow.getTimezoneOffset() / 60));
|
230
|
+
if (myNumber < 0) {
|
231
|
+
myNumber = myNumber * -1;
|
232
|
+
formattedNumber = ("0" + myNumber).slice(-2);
|
233
|
+
result = "-" + formattedNumber;
|
234
|
+
} else {
|
235
|
+
formattedNumber = ("0" + myNumber).slice(-2);
|
236
|
+
result = "+" + formattedNumber;
|
237
|
+
}
|
238
|
+
return result;
|
239
|
+
}
|
240
|
+
//
|
241
|
+
// LANGUAGE METHODS
|
242
|
+
//
|
243
|
+
// Get Language. Return a string containing the user language.
|
244
|
+
getLanguage() {
|
245
|
+
return navigator.language;
|
246
|
+
}
|
247
|
+
// Get System Language. Return a string containing the system language.
|
248
|
+
getSystemLanguage() {
|
249
|
+
return navigator.language || window.navigator.language;
|
250
|
+
}
|
251
|
+
// Get Canvas Print. Return a string containing the canvas URI data.
|
252
|
+
getCanvasPrint() {
|
253
|
+
const canvas = document.createElement("canvas");
|
254
|
+
let ctx;
|
255
|
+
try {
|
256
|
+
ctx = canvas.getContext("2d");
|
257
|
+
} catch (e) {
|
258
|
+
return "";
|
259
|
+
}
|
260
|
+
const txt = "ClientJS,org <canvas> 1.0";
|
261
|
+
ctx.textBaseline = "top";
|
262
|
+
ctx.font = "14px 'Arial'";
|
263
|
+
ctx.textBaseline = "alphabetic";
|
264
|
+
ctx.fillStyle = "#f60";
|
265
|
+
ctx.fillRect(125, 1, 62, 20);
|
266
|
+
ctx.fillStyle = "#069";
|
267
|
+
ctx.fillText(txt, 2, 15);
|
268
|
+
ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
|
269
|
+
ctx.fillText(txt, 4, 17);
|
270
|
+
return canvas.toDataURL();
|
271
|
+
}
|
272
|
+
};
|
273
|
+
var clientJS = new ClientJS();
|
274
|
+
var fingerpint_lib_default = clientJS;
|
275
|
+
|
276
|
+
// src/lib/fingerprint.ts
|
277
|
+
var HASH_KEY = "E86E2612010258B35137";
|
278
|
+
var getFingerprint = () => {
|
279
|
+
const HASH_KEY_CUSTOM = envHelper_default.getHashKey() || HASH_KEY;
|
280
|
+
if (typeof window === "undefined")
|
281
|
+
return HASH_KEY_CUSTOM;
|
282
|
+
return fingerpint_lib_default.getFingerprint() + HASH_KEY_CUSTOM;
|
283
|
+
};
|
284
|
+
var fingerprint_default = getFingerprint;
|
285
|
+
|
286
|
+
// src/utils/services.ts
|
287
|
+
var cache;
|
288
|
+
var assign = (a, b) => {
|
289
|
+
Object.keys(b).forEach((key) => {
|
290
|
+
if (b[key] !== void 0)
|
291
|
+
a[key] = b[key];
|
292
|
+
});
|
293
|
+
return a;
|
294
|
+
};
|
295
|
+
var trackerService = async (endpoint, payload) => {
|
296
|
+
const fetchData = await fetch(endpoint, {
|
297
|
+
method: "POST",
|
298
|
+
body: JSON.stringify(payload),
|
299
|
+
headers: assign({ "Content-Type": "application/json" }, { ["x-tracker-cache"]: cache })
|
300
|
+
});
|
301
|
+
const response = await fetchData.json();
|
302
|
+
if (response.error) {
|
303
|
+
throw response.error;
|
304
|
+
} else {
|
305
|
+
return response;
|
306
|
+
}
|
307
|
+
};
|
308
|
+
|
309
|
+
// src/utils/index.ts
|
310
|
+
import Bowser from "bowser";
|
311
|
+
var createRequest = (endpoint, task) => {
|
312
|
+
return `${endpoint}/visitor/v1/${task}`;
|
313
|
+
};
|
314
|
+
var createRequestV2 = (endpoint, task) => {
|
315
|
+
return `${endpoint}/visitor/v2/${task}`;
|
316
|
+
};
|
317
|
+
var rememberFlow = (endpoint, flow) => {
|
318
|
+
return `${endpoint}/remember_flow/${flow}`;
|
319
|
+
};
|
320
|
+
var startTracker = async (endpoint, url, referer, user_agent, attributesVisit) => {
|
321
|
+
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
322
|
+
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
323
|
+
if (allow === "0" || reject === "true") {
|
324
|
+
return null;
|
325
|
+
}
|
326
|
+
const { location, document: document2 } = window;
|
327
|
+
const { pathname, search, origin } = location;
|
328
|
+
url = `${origin}${pathname}${search}`;
|
329
|
+
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
330
|
+
user_agent = window.navigator.userAgent;
|
331
|
+
const browser = Bowser.parse(window.navigator.userAgent);
|
332
|
+
const browser_name = browser?.browser?.name;
|
333
|
+
const browser_version = browser?.browser?.version ?? "0";
|
334
|
+
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
335
|
+
const device = browser?.platform?.model ?? browser?.platform?.type;
|
336
|
+
const queryString = window.location.search;
|
337
|
+
const urlParams = new URLSearchParams(queryString);
|
338
|
+
const ip = "";
|
339
|
+
try {
|
340
|
+
const fingerprint = fingerprint_default();
|
341
|
+
const attributes = [];
|
342
|
+
for (const key of urlParams.keys()) {
|
343
|
+
if (key.startsWith("utm_")) {
|
344
|
+
urlParams.get(key) && attributes.push({ name: key, value: urlParams.get(key) });
|
345
|
+
}
|
346
|
+
}
|
347
|
+
if (attributesVisit?.length) {
|
348
|
+
attributesVisit?.forEach((element) => {
|
349
|
+
element?.name && attributes.push({ name: element?.name, value: element?.value });
|
350
|
+
});
|
351
|
+
}
|
352
|
+
const responseStart = await trackerService(createRequestV2(endpoint, "start"), {
|
353
|
+
fingerprint,
|
354
|
+
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
355
|
+
...referer && (referer !== url || document2.referrer) && {
|
356
|
+
referer: referer !== url ? referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1") : document2.referrer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
357
|
+
},
|
358
|
+
user_agent,
|
359
|
+
ip,
|
360
|
+
browser_name,
|
361
|
+
browser_version,
|
362
|
+
lang,
|
363
|
+
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
364
|
+
...attributes?.length && {
|
365
|
+
event_name: "visit",
|
366
|
+
event_type: "action",
|
367
|
+
attributes
|
368
|
+
}
|
369
|
+
});
|
370
|
+
if (window["aesirxTrackEcommerce"] === "true" && sessionStorage.getItem("aesirx-analytics-flow") !== (await responseStart)?.flow_uuid) {
|
371
|
+
sessionStorage.setItem("aesirx-analytics-flow", (await responseStart)?.flow_uuid);
|
372
|
+
try {
|
373
|
+
await trackerService(
|
374
|
+
rememberFlow(window.location.origin, (await responseStart)?.flow_uuid),
|
375
|
+
{}
|
376
|
+
);
|
377
|
+
} catch (error) {
|
378
|
+
console.log("Remember Flow Error", error);
|
379
|
+
}
|
380
|
+
}
|
381
|
+
return responseStart;
|
382
|
+
} catch (error) {
|
383
|
+
console.error("Analytics Error: ", error);
|
384
|
+
}
|
385
|
+
};
|
386
|
+
var trackEvent = async (endpoint, referer, data) => {
|
387
|
+
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
388
|
+
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
389
|
+
if (allow === "0" || reject === "true") {
|
390
|
+
return null;
|
391
|
+
}
|
392
|
+
const { location, document: document2 } = window;
|
393
|
+
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
394
|
+
const url = location.protocol + "//" + location.host + location.pathname;
|
395
|
+
const user_agent = window.navigator.userAgent;
|
396
|
+
const browser = Bowser.parse(window.navigator.userAgent);
|
397
|
+
const browser_name = browser?.browser?.name;
|
398
|
+
const browser_version = browser?.browser?.version ?? "0";
|
399
|
+
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
400
|
+
const device = browser?.platform?.model ?? browser?.platform?.type;
|
401
|
+
const ip = "";
|
402
|
+
const fingerprint = fingerprint_default();
|
403
|
+
const headers = { type: "application/json" };
|
404
|
+
const blobData = new Blob(
|
405
|
+
[
|
406
|
+
JSON.stringify({
|
407
|
+
fingerprint,
|
408
|
+
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
409
|
+
...referer !== "/" && referer && {
|
410
|
+
referer: referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
411
|
+
},
|
412
|
+
user_agent,
|
413
|
+
ip,
|
414
|
+
browser_name,
|
415
|
+
browser_version,
|
416
|
+
lang,
|
417
|
+
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
418
|
+
...data
|
419
|
+
})
|
420
|
+
],
|
421
|
+
headers
|
422
|
+
);
|
423
|
+
const responseStart = navigator.sendBeacon(createRequestV2(endpoint, "start"), blobData);
|
424
|
+
return responseStart;
|
425
|
+
};
|
426
|
+
var endTracker = (endPoint, event_uuid, visitor_uuid) => {
|
427
|
+
if (event_uuid && visitor_uuid) {
|
428
|
+
const body = {
|
429
|
+
event_uuid,
|
430
|
+
visitor_uuid
|
431
|
+
};
|
432
|
+
const headers = { type: "application/json" };
|
433
|
+
const blob = new Blob([JSON.stringify(body)], headers);
|
434
|
+
navigator.sendBeacon(createRequest(endPoint, "end"), blob);
|
435
|
+
}
|
436
|
+
};
|
437
|
+
var endTrackerVisibilityState = (endPoint) => {
|
438
|
+
document.addEventListener("visibilitychange", async () => {
|
439
|
+
if (document.visibilityState === "hidden") {
|
440
|
+
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
441
|
+
}
|
442
|
+
if (document.visibilityState === "visible") {
|
443
|
+
const response = await startTracker(endPoint, "", "", "", window["attributes"]);
|
444
|
+
window["event_uuid"] = response?.event_uuid;
|
445
|
+
}
|
446
|
+
});
|
447
|
+
window.addEventListener(
|
448
|
+
"pagehide",
|
449
|
+
(event) => {
|
450
|
+
if (event.persisted) {
|
451
|
+
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
452
|
+
}
|
453
|
+
},
|
454
|
+
false
|
455
|
+
);
|
456
|
+
};
|
457
|
+
|
458
|
+
export {
|
459
|
+
fingerprint_default,
|
460
|
+
startTracker,
|
461
|
+
trackEvent,
|
462
|
+
endTracker,
|
463
|
+
endTrackerVisibilityState
|
464
|
+
};
|