mixpanel-browser 2.71.0 → 2.71.1

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(mkdir:*)"
5
+ ],
6
+ "deny": [],
7
+ "ask": []
8
+ }
9
+ }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **2.71.1** (30 Oct 2025)
2
+ - fixes issue with $mp_page_leave events getting tracked when `record_heatmap_data` is on and there was no session recording taking place.
3
+
1
4
  **2.71.0** (2 Oct 2025)
2
5
  - adds Dead Click ($mp_dead_click) autocapture event: when a click occurs but there is no DOM mutation afterwards
3
6
  - adds Page Leave ($mp_page_leave) autocapture event: when a page is "left" either by navigation or leaving the tab
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.71.0'
5
+ LIB_VERSION: '2.71.1'
6
6
  };
7
7
 
8
8
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -3509,6 +3509,11 @@ Autocapture.prototype._trackPageLeave = function(ev, currentUrl, currentScrollHe
3509
3509
  // User has navigated away already ending their impression.
3510
3510
  return;
3511
3511
  }
3512
+
3513
+ if (!this.getConfig(CONFIG_TRACK_PAGE_LEAVE) && !this.mp.is_recording_heatmap_data()) {
3514
+ return;
3515
+ }
3516
+
3512
3517
  this.hasTrackedScrollSession = true;
3513
3518
  var viewportHeight = Math.max(document$1.documentElement.clientHeight, win.innerHeight || 0);
3514
3519
  var scrollPercentage = Math.round(Math.max(this.maxScrollViewDepth - viewportHeight, 0) / (currentScrollHeight - viewportHeight) * 100);
@@ -3528,12 +3533,9 @@ Autocapture.prototype._trackPageLeave = function(ev, currentUrl, currentScrollHe
3528
3533
  '$current_url': currentUrl || _.info.currentUrl(),
3529
3534
  '$viewportHeight': viewportHeight, // This is the fold line
3530
3535
  '$viewportWidth': Math.max(document$1.documentElement.clientWidth, win.innerWidth || 0),
3536
+ '$captured_for_heatmap': this.mp.is_recording_heatmap_data()
3531
3537
  }, DEFAULT_PROPS);
3532
3538
 
3533
- if (this.mp.is_recording_heatmap_data() && !this.getConfig(CONFIG_TRACK_PAGE_LEAVE)) {
3534
- props['$captured_for_heatmap'] = true;
3535
- }
3536
-
3537
3539
  // Send with beacon transport to ensure event is sent before unload
3538
3540
  this.mp.track(MP_EV_PAGE_LEAVE, props, {transport: 'sendBeacon'});
3539
3541
  };
@@ -14043,7 +14043,7 @@
14043
14043
  }
14044
14044
 
14045
14045
  var Config = {
14046
- LIB_VERSION: '2.71.0'
14046
+ LIB_VERSION: '2.71.1'
14047
14047
  };
14048
14048
 
14049
14049
  /* eslint camelcase: "off", eqeqeq: "off" */