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.
@@ -249,6 +249,11 @@ Autocapture.prototype._trackPageLeave = function(ev, currentUrl, currentScrollHe
249
249
  // User has navigated away already ending their impression.
250
250
  return;
251
251
  }
252
+
253
+ if (!this.getConfig(CONFIG_TRACK_PAGE_LEAVE) && !this.mp.is_recording_heatmap_data()) {
254
+ return;
255
+ }
256
+
252
257
  this.hasTrackedScrollSession = true;
253
258
  var viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
254
259
  var scrollPercentage = Math.round(Math.max(this.maxScrollViewDepth - viewportHeight, 0) / (currentScrollHeight - viewportHeight) * 100);
@@ -268,12 +273,9 @@ Autocapture.prototype._trackPageLeave = function(ev, currentUrl, currentScrollHe
268
273
  '$current_url': currentUrl || _.info.currentUrl(),
269
274
  '$viewportHeight': viewportHeight, // This is the fold line
270
275
  '$viewportWidth': Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
276
+ '$captured_for_heatmap': this.mp.is_recording_heatmap_data()
271
277
  }, DEFAULT_PROPS);
272
278
 
273
- if (this.mp.is_recording_heatmap_data() && !this.getConfig(CONFIG_TRACK_PAGE_LEAVE)) {
274
- props['$captured_for_heatmap'] = true;
275
- }
276
-
277
279
  // Send with beacon transport to ensure event is sent before unload
278
280
  this.mp.track(MP_EV_PAGE_LEAVE, props, {transport: 'sendBeacon'});
279
281
  };
package/src/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Config = {
2
2
  DEBUG: false,
3
- LIB_VERSION: '2.71.0'
3
+ LIB_VERSION: '2.71.1'
4
4
  };
5
5
 
6
6
  export default Config;