@aranova/tracking-next 0.16.1 → 0.16.2

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
@@ -1750,6 +1750,7 @@ function attachFormStart(client, config) {
1750
1750
  }
1751
1751
 
1752
1752
  // ../tracking-core/src/triggers/page-exit.ts
1753
+ var MIN_SEGMENT_MS = 50;
1753
1754
  function attachPageExit(client) {
1754
1755
  if (typeof window === "undefined" || typeof document === "undefined") {
1755
1756
  return () => {
@@ -1787,7 +1788,7 @@ function attachPageExit(client) {
1787
1788
  }
1788
1789
  function emitSegment(path, flush) {
1789
1790
  const dwell = settledDwellMs();
1790
- if (dwell === 0) return;
1791
+ if (dwell < MIN_SEGMENT_MS) return;
1791
1792
  client.trackEvent({
1792
1793
  eventType: "page_exit",
1793
1794
  metadata: {
@@ -1802,7 +1803,7 @@ function attachPageExit(client) {
1802
1803
  client.flushBeacon();
1803
1804
  }
1804
1805
  accumulatedMs = 0;
1805
- activeSince = document.visibilityState === "visible" ? Date.now() : null;
1806
+ activeSince = null;
1806
1807
  }
1807
1808
  function onNavigate() {
1808
1809
  const newPath = window.location.pathname;
@@ -2604,7 +2605,7 @@ function GoogleAdsTracking(props) {
2604
2605
  var import_navigation = require("next/navigation");
2605
2606
 
2606
2607
  // package.json
2607
- var version = "0.16.1";
2608
+ var version = "0.16.2";
2608
2609
 
2609
2610
  // src/factory.tsx
2610
2611
  var import_react4 = require("react");