userlens-analytics-sdk 0.1.58 → 0.1.59
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/dist/main.cjs.js +1 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/dist/userlens.umd.js +1 -1
- package/dist/userlens.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/EventCollector/index.ts +1 -10
- package/src/utils.ts +1 -1
package/package.json
CHANGED
|
@@ -87,8 +87,7 @@ export default class EventCollector {
|
|
|
87
87
|
this.callback = callback;
|
|
88
88
|
this.intervalTime = intervalTime;
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
this.events = eventsFromStorage ? JSON.parse(eventsFromStorage) : [];
|
|
90
|
+
this.events = [];
|
|
92
91
|
|
|
93
92
|
this.#initializeCollector();
|
|
94
93
|
this.#initializeSender();
|
|
@@ -113,7 +112,6 @@ export default class EventCollector {
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
this.events.push(eventToPush);
|
|
116
|
-
window.localStorage.setItem("userlensEvents", JSON.stringify(this.events));
|
|
117
115
|
}
|
|
118
116
|
|
|
119
117
|
public updateUserTraits(newUserTraits: Record<string, any>) {
|
|
@@ -225,11 +223,6 @@ export default class EventCollector {
|
|
|
225
223
|
if (this.events.length > 100) {
|
|
226
224
|
this.events = this.events.slice(-100);
|
|
227
225
|
}
|
|
228
|
-
|
|
229
|
-
window.localStorage.setItem(
|
|
230
|
-
"userlensEvents",
|
|
231
|
-
JSON.stringify(this.events)
|
|
232
|
-
);
|
|
233
226
|
} catch (err) {
|
|
234
227
|
console.warn(
|
|
235
228
|
"Userlens EventCollector error: click event handling failed",
|
|
@@ -392,7 +385,6 @@ export default class EventCollector {
|
|
|
392
385
|
}
|
|
393
386
|
|
|
394
387
|
this.events.push(pageViewEvent);
|
|
395
|
-
window.localStorage.setItem("userlensEvents", JSON.stringify(this.events));
|
|
396
388
|
}
|
|
397
389
|
|
|
398
390
|
#sendEvents = () => {
|
|
@@ -422,7 +414,6 @@ export default class EventCollector {
|
|
|
422
414
|
|
|
423
415
|
#clearEvents() {
|
|
424
416
|
this.events = [];
|
|
425
|
-
window.localStorage.setItem("userlensEvents", JSON.stringify(this.events));
|
|
426
417
|
}
|
|
427
418
|
|
|
428
419
|
#destroyCollector() {
|