@aranova/tracking-react 0.16.0 → 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
@@ -1969,6 +1969,7 @@ function attachFormStart(client, config) {
1969
1969
  }
1970
1970
 
1971
1971
  // ../tracking-core/src/triggers/page-exit.ts
1972
+ var MIN_SEGMENT_MS = 50;
1972
1973
  function attachPageExit(client) {
1973
1974
  if (typeof window === "undefined" || typeof document === "undefined") {
1974
1975
  return () => {
@@ -2006,7 +2007,7 @@ function attachPageExit(client) {
2006
2007
  }
2007
2008
  function emitSegment(path, flush) {
2008
2009
  const dwell = settledDwellMs();
2009
- if (dwell === 0) return;
2010
+ if (dwell < MIN_SEGMENT_MS) return;
2010
2011
  client.trackEvent({
2011
2012
  eventType: "page_exit",
2012
2013
  metadata: {
@@ -2021,7 +2022,7 @@ function attachPageExit(client) {
2021
2022
  client.flushBeacon();
2022
2023
  }
2023
2024
  accumulatedMs = 0;
2024
- activeSince = document.visibilityState === "visible" ? Date.now() : null;
2025
+ activeSince = null;
2025
2026
  }
2026
2027
  function onNavigate() {
2027
2028
  const newPath = window.location.pathname;
@@ -2809,7 +2810,7 @@ function GoogleAdsTracking(props) {
2809
2810
  var import_react6 = require("react");
2810
2811
 
2811
2812
  // package.json
2812
- var version = "0.16.0";
2813
+ var version = "0.16.2";
2813
2814
 
2814
2815
  // ../tracking-core/src/phone-react.tsx
2815
2816
  var import_react5 = require("react");