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.
@@ -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
  };
@@ -14044,7 +14044,7 @@
14044
14044
 
14045
14045
  var Config = {
14046
14046
  DEBUG: false,
14047
- LIB_VERSION: '2.71.0'
14047
+ LIB_VERSION: '2.71.1'
14048
14048
  };
14049
14049
 
14050
14050
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -19226,6 +19226,11 @@
19226
19226
  // User has navigated away already ending their impression.
19227
19227
  return;
19228
19228
  }
19229
+
19230
+ if (!this.getConfig(CONFIG_TRACK_PAGE_LEAVE) && !this.mp.is_recording_heatmap_data()) {
19231
+ return;
19232
+ }
19233
+
19229
19234
  this.hasTrackedScrollSession = true;
19230
19235
  var viewportHeight = Math.max(document$1.documentElement.clientHeight, win.innerHeight || 0);
19231
19236
  var scrollPercentage = Math.round(Math.max(this.maxScrollViewDepth - viewportHeight, 0) / (currentScrollHeight - viewportHeight) * 100);
@@ -19245,12 +19250,9 @@
19245
19250
  '$current_url': currentUrl || _.info.currentUrl(),
19246
19251
  '$viewportHeight': viewportHeight, // This is the fold line
19247
19252
  '$viewportWidth': Math.max(document$1.documentElement.clientWidth, win.innerWidth || 0),
19253
+ '$captured_for_heatmap': this.mp.is_recording_heatmap_data()
19248
19254
  }, DEFAULT_PROPS);
19249
19255
 
19250
- if (this.mp.is_recording_heatmap_data() && !this.getConfig(CONFIG_TRACK_PAGE_LEAVE)) {
19251
- props['$captured_for_heatmap'] = true;
19252
- }
19253
-
19254
19256
  // Send with beacon transport to ensure event is sent before unload
19255
19257
  this.mp.track(MP_EV_PAGE_LEAVE, props, {transport: 'sendBeacon'});
19256
19258
  };