featurely-site-manager 1.1.6 → 1.1.8

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/index.js CHANGED
@@ -423,6 +423,7 @@ var _SiteManager = class _SiteManager {
423
423
  this.currentPagePath = window.location.pathname;
424
424
  this.pageEntryTime = Date.now();
425
425
  this.trackPageView();
426
+ setTimeout(() => this.flushAnalytics(), 2e3);
426
427
  const originalPushState = history.pushState.bind(history);
427
428
  const originalReplaceState = history.replaceState.bind(history);
428
429
  const self = this;
@@ -476,7 +477,10 @@ var _SiteManager = class _SiteManager {
476
477
  }
477
478
  this.currentPagePath = newPath;
478
479
  this.pageEntryTime = Date.now();
479
- setTimeout(() => this.trackPageView(), 100);
480
+ setTimeout(() => {
481
+ this.trackPageView();
482
+ this.flushAnalytics();
483
+ }, 100);
480
484
  }
481
485
  generateSessionId() {
482
486
  if (typeof crypto !== "undefined" && crypto.getRandomValues) {
package/dist/index.mjs CHANGED
@@ -388,6 +388,7 @@ var _SiteManager = class _SiteManager {
388
388
  this.currentPagePath = window.location.pathname;
389
389
  this.pageEntryTime = Date.now();
390
390
  this.trackPageView();
391
+ setTimeout(() => this.flushAnalytics(), 2e3);
391
392
  const originalPushState = history.pushState.bind(history);
392
393
  const originalReplaceState = history.replaceState.bind(history);
393
394
  const self = this;
@@ -441,7 +442,10 @@ var _SiteManager = class _SiteManager {
441
442
  }
442
443
  this.currentPagePath = newPath;
443
444
  this.pageEntryTime = Date.now();
444
- setTimeout(() => this.trackPageView(), 100);
445
+ setTimeout(() => {
446
+ this.trackPageView();
447
+ this.flushAnalytics();
448
+ }, 100);
445
449
  }
446
450
  generateSessionId() {
447
451
  if (typeof crypto !== "undefined" && crypto.getRandomValues) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "featurely-site-manager",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Complete site management SDK for maintenance mode, status messages, feature flags, version checking, and analytics",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",