mixpanel-browser 2.64.0 → 2.65.0

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.64.0'
5
+ LIB_VERSION: '2.65.0'
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
@@ -1870,6 +1870,9 @@ _.info = {
1870
1870
  return 'Microsoft Edge';
1871
1871
  } else if (_.includes(user_agent, 'FBIOS')) {
1872
1872
  return 'Facebook Mobile';
1873
+ } else if (_.includes(user_agent, 'Whale/')) {
1874
+ // https://user-agents.net/browsers/whale-browser
1875
+ return 'Whale Browser';
1873
1876
  } else if (_.includes(user_agent, 'Chrome')) {
1874
1877
  return 'Chrome';
1875
1878
  } else if (_.includes(user_agent, 'CriOS')) {
@@ -1921,7 +1924,8 @@ _.info = {
1921
1924
  'Android Mobile': /android\s(\d+(\.\d+)?)/,
1922
1925
  'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
1923
1926
  'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
1924
- 'Mozilla': /rv:(\d+(\.\d+)?)/
1927
+ 'Mozilla': /rv:(\d+(\.\d+)?)/,
1928
+ 'Whale Browser': /Whale\/(\d+(\.\d+)?)/
1925
1929
  };
1926
1930
  var regex = versionRegexs[browser];
1927
1931
  if (regex === undefined) {
@@ -2299,7 +2303,9 @@ function getPropsForDOMEvent(ev, config) {
2299
2303
  '$elements': elementsJson,
2300
2304
  '$el_attr__href': href,
2301
2305
  '$viewportHeight': Math.max(docElement['clientHeight'], win['innerHeight'] || 0),
2302
- '$viewportWidth': Math.max(docElement['clientWidth'], win['innerWidth'] || 0)
2306
+ '$viewportWidth': Math.max(docElement['clientWidth'], win['innerWidth'] || 0),
2307
+ '$pageHeight': document$1['body']['offsetHeight'] || 0,
2308
+ '$pageWidth': document$1['body']['offsetWidth'] || 0,
2303
2309
  };
2304
2310
  _.each(captureExtraAttrs, function(attr) {
2305
2311
  if (!blockAttrsSet[attr] && target.hasAttribute(attr)) {
@@ -3030,19 +3036,19 @@ FeatureFlagManager.prototype.getConfig = function(key) {
3030
3036
  return this.getFullConfig()[key];
3031
3037
  };
3032
3038
 
3033
- FeatureFlagManager.prototype.isEnabled = function() {
3039
+ FeatureFlagManager.prototype.isSystemEnabled = function() {
3034
3040
  return !!this.getMpConfig(FLAGS_CONFIG_KEY);
3035
3041
  };
3036
3042
 
3037
- FeatureFlagManager.prototype.areFeaturesReady = function() {
3038
- if (!this.isEnabled()) {
3043
+ FeatureFlagManager.prototype.areFlagsReady = function() {
3044
+ if (!this.isSystemEnabled()) {
3039
3045
  logger$3.error('Feature Flags not enabled');
3040
3046
  }
3041
3047
  return !!this.flags;
3042
3048
  };
3043
3049
 
3044
3050
  FeatureFlagManager.prototype.fetchFlags = function() {
3045
- if (!this.isEnabled()) {
3051
+ if (!this.isSystemEnabled()) {
3046
3052
  return;
3047
3053
  }
3048
3054
 
@@ -3068,7 +3074,7 @@ FeatureFlagManager.prototype.fetchFlags = function() {
3068
3074
  _.each(responseFlags, function(data, key) {
3069
3075
  flags.set(key, {
3070
3076
  'key': data['variant_key'],
3071
- 'data': data['variant_value']
3077
+ 'value': data['variant_value']
3072
3078
  });
3073
3079
  });
3074
3080
  this.flags = flags;
@@ -3078,7 +3084,7 @@ FeatureFlagManager.prototype.fetchFlags = function() {
3078
3084
  }.bind(this)).catch(function() {});
3079
3085
  };
3080
3086
 
3081
- FeatureFlagManager.prototype.getFeature = function(featureName, fallback) {
3087
+ FeatureFlagManager.prototype.getVariant = function(featureName, fallback) {
3082
3088
  if (!this.fetchPromise) {
3083
3089
  return new Promise(function(resolve) {
3084
3090
  logger$3.critical('Feature Flags not initialized');
@@ -3087,15 +3093,15 @@ FeatureFlagManager.prototype.getFeature = function(featureName, fallback) {
3087
3093
  }
3088
3094
 
3089
3095
  return this.fetchPromise.then(function() {
3090
- return this.getFeatureSync(featureName, fallback);
3096
+ return this.getVariantSync(featureName, fallback);
3091
3097
  }.bind(this)).catch(function(error) {
3092
3098
  logger$3.error(error);
3093
3099
  return fallback;
3094
3100
  });
3095
3101
  };
3096
3102
 
3097
- FeatureFlagManager.prototype.getFeatureSync = function(featureName, fallback) {
3098
- if (!this.areFeaturesReady()) {
3103
+ FeatureFlagManager.prototype.getVariantSync = function(featureName, fallback) {
3104
+ if (!this.areFlagsReady()) {
3099
3105
  logger$3.log('Flags not loaded yet');
3100
3106
  return fallback;
3101
3107
  }
@@ -3108,31 +3114,37 @@ FeatureFlagManager.prototype.getFeatureSync = function(featureName, fallback) {
3108
3114
  return feature;
3109
3115
  };
3110
3116
 
3111
- FeatureFlagManager.prototype.getFeatureData = function(featureName, fallbackValue) {
3112
- return this.getFeature(featureName, {'data': fallbackValue}).then(function(feature) {
3113
- return feature['data'];
3117
+ FeatureFlagManager.prototype.getVariantValue = function(featureName, fallbackValue) {
3118
+ return this.getVariant(featureName, {'value': fallbackValue}).then(function(feature) {
3119
+ return feature['value'];
3114
3120
  }).catch(function(error) {
3115
3121
  logger$3.error(error);
3116
3122
  return fallbackValue;
3117
3123
  });
3118
3124
  };
3119
3125
 
3120
- FeatureFlagManager.prototype.getFeatureDataSync = function(featureName, fallbackValue) {
3121
- return this.getFeatureSync(featureName, {'data': fallbackValue})['data'];
3126
+ // TODO remove deprecated method
3127
+ FeatureFlagManager.prototype.getFeatureData = function(featureName, fallbackValue) {
3128
+ logger$3.critical('mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead.');
3129
+ return this.getVariantValue(featureName, fallbackValue);
3130
+ };
3131
+
3132
+ FeatureFlagManager.prototype.getVariantValueSync = function(featureName, fallbackValue) {
3133
+ return this.getVariantSync(featureName, {'value': fallbackValue})['value'];
3122
3134
  };
3123
3135
 
3124
- FeatureFlagManager.prototype.isFeatureEnabled = function(featureName, fallbackValue) {
3125
- return this.getFeatureData(featureName).then(function() {
3126
- return this.isFeatureEnabledSync(featureName, fallbackValue);
3136
+ FeatureFlagManager.prototype.isEnabled = function(featureName, fallbackValue) {
3137
+ return this.getVariantValue(featureName).then(function() {
3138
+ return this.isEnabledSync(featureName, fallbackValue);
3127
3139
  }.bind(this)).catch(function(error) {
3128
3140
  logger$3.error(error);
3129
3141
  return fallbackValue;
3130
3142
  });
3131
3143
  };
3132
3144
 
3133
- FeatureFlagManager.prototype.isFeatureEnabledSync = function(featureName, fallbackValue) {
3145
+ FeatureFlagManager.prototype.isEnabledSync = function(featureName, fallbackValue) {
3134
3146
  fallbackValue = fallbackValue || false;
3135
- var val = this.getFeatureDataSync(featureName, fallbackValue);
3147
+ var val = this.getVariantValueSync(featureName, fallbackValue);
3136
3148
  if (val !== true && val !== false) {
3137
3149
  logger$3.error('Feature flag "' + featureName + '" value: ' + val + ' is not a boolean; returning fallback value: ' + fallbackValue);
3138
3150
  val = fallbackValue;
@@ -3161,13 +3173,16 @@ function minApisSupported() {
3161
3173
 
3162
3174
  safewrapClass(FeatureFlagManager);
3163
3175
 
3164
- FeatureFlagManager.prototype['are_features_ready'] = FeatureFlagManager.prototype.areFeaturesReady;
3165
- FeatureFlagManager.prototype['get_feature'] = FeatureFlagManager.prototype.getFeature;
3176
+ FeatureFlagManager.prototype['are_flags_ready'] = FeatureFlagManager.prototype.areFlagsReady;
3177
+ FeatureFlagManager.prototype['get_variant'] = FeatureFlagManager.prototype.getVariant;
3178
+ FeatureFlagManager.prototype['get_variant_sync'] = FeatureFlagManager.prototype.getVariantSync;
3179
+ FeatureFlagManager.prototype['get_variant_value'] = FeatureFlagManager.prototype.getVariantValue;
3180
+ FeatureFlagManager.prototype['get_variant_value_sync'] = FeatureFlagManager.prototype.getVariantValueSync;
3181
+ FeatureFlagManager.prototype['is_enabled'] = FeatureFlagManager.prototype.isEnabled;
3182
+ FeatureFlagManager.prototype['is_enabled_sync'] = FeatureFlagManager.prototype.isEnabledSync;
3183
+
3184
+ // Deprecated method
3166
3185
  FeatureFlagManager.prototype['get_feature_data'] = FeatureFlagManager.prototype.getFeatureData;
3167
- FeatureFlagManager.prototype['get_feature_data_sync'] = FeatureFlagManager.prototype.getFeatureDataSync;
3168
- FeatureFlagManager.prototype['get_feature_sync'] = FeatureFlagManager.prototype.getFeatureSync;
3169
- FeatureFlagManager.prototype['is_feature_enabled'] = FeatureFlagManager.prototype.isFeatureEnabled;
3170
- FeatureFlagManager.prototype['is_feature_enabled_sync'] = FeatureFlagManager.prototype.isFeatureEnabledSync;
3171
3186
 
3172
3187
  /* eslint camelcase: "off" */
3173
3188
 
@@ -5051,18 +5066,8 @@ MixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name
5051
5066
  * @param {Function} [callback] If provided, the callback will be called when the server responds
5052
5067
  * @deprecated
5053
5068
  */
5054
- MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {
5055
- if (!_.isNumber(amount)) {
5056
- amount = parseFloat(amount);
5057
- if (isNaN(amount)) {
5058
- console.error('Invalid value passed to mixpanel.people.track_charge - must be a number');
5059
- return;
5060
- }
5061
- }
5062
-
5063
- return this.append('$transactions', _.extend({
5064
- '$amount': amount
5065
- }, properties), callback);
5069
+ MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function() {
5070
+ console.error('mixpanel.people.track_charge() is deprecated and no longer has any effect.');
5066
5071
  });
5067
5072
 
5068
5073
  /*
@@ -5897,6 +5902,7 @@ var DEFAULT_API_ROUTES = {
5897
5902
  var DEFAULT_CONFIG = {
5898
5903
  'api_host': 'https://api-js.mixpanel.com',
5899
5904
  'api_routes': DEFAULT_API_ROUTES,
5905
+ 'api_extra_query_params': {},
5900
5906
  'api_method': 'POST',
5901
5907
  'api_transport': 'XHR',
5902
5908
  'api_payload_format': PAYLOAD_TYPE_BASE64,
@@ -6484,6 +6490,8 @@ MixpanelLib.prototype._send_request = function(url, data, options, callback) {
6484
6490
  delete data['data'];
6485
6491
  }
6486
6492
 
6493
+ _.extend(data, this.get_config('api_extra_query_params'));
6494
+
6487
6495
  url += '?' + _.HTTPBuildQuery(data);
6488
6496
 
6489
6497
  var lib = this;
@@ -7400,6 +7408,8 @@ MixpanelLib.prototype.reset = function() {
7400
7408
  'distinct_id': DEVICE_ID_PREFIX + uuid,
7401
7409
  '$device_id': uuid
7402
7410
  }, '');
7411
+ this.stop_session_recording();
7412
+ this._check_and_start_session_recording();
7403
7413
  };
7404
7414
 
7405
7415
  /**
@@ -13945,7 +13945,7 @@
13945
13945
 
13946
13946
  var Config = {
13947
13947
  DEBUG: false,
13948
- LIB_VERSION: '2.64.0'
13948
+ LIB_VERSION: '2.65.0'
13949
13949
  };
13950
13950
 
13951
13951
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -15430,6 +15430,9 @@
15430
15430
  return 'Microsoft Edge';
15431
15431
  } else if (_.includes(user_agent, 'FBIOS')) {
15432
15432
  return 'Facebook Mobile';
15433
+ } else if (_.includes(user_agent, 'Whale/')) {
15434
+ // https://user-agents.net/browsers/whale-browser
15435
+ return 'Whale Browser';
15433
15436
  } else if (_.includes(user_agent, 'Chrome')) {
15434
15437
  return 'Chrome';
15435
15438
  } else if (_.includes(user_agent, 'CriOS')) {
@@ -15481,7 +15484,8 @@
15481
15484
  'Android Mobile': /android\s(\d+(\.\d+)?)/,
15482
15485
  'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
15483
15486
  'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
15484
- 'Mozilla': /rv:(\d+(\.\d+)?)/
15487
+ 'Mozilla': /rv:(\d+(\.\d+)?)/,
15488
+ 'Whale Browser': /Whale\/(\d+(\.\d+)?)/
15485
15489
  };
15486
15490
  var regex = versionRegexs[browser];
15487
15491
  if (regex === undefined) {
@@ -17843,7 +17847,9 @@
17843
17847
  '$elements': elementsJson,
17844
17848
  '$el_attr__href': href,
17845
17849
  '$viewportHeight': Math.max(docElement['clientHeight'], win['innerHeight'] || 0),
17846
- '$viewportWidth': Math.max(docElement['clientWidth'], win['innerWidth'] || 0)
17850
+ '$viewportWidth': Math.max(docElement['clientWidth'], win['innerWidth'] || 0),
17851
+ '$pageHeight': document$1['body']['offsetHeight'] || 0,
17852
+ '$pageWidth': document$1['body']['offsetWidth'] || 0,
17847
17853
  };
17848
17854
  _.each(captureExtraAttrs, function(attr) {
17849
17855
  if (!blockAttrsSet[attr] && target.hasAttribute(attr)) {
@@ -18574,19 +18580,19 @@
18574
18580
  return this.getFullConfig()[key];
18575
18581
  };
18576
18582
 
18577
- FeatureFlagManager.prototype.isEnabled = function() {
18583
+ FeatureFlagManager.prototype.isSystemEnabled = function() {
18578
18584
  return !!this.getMpConfig(FLAGS_CONFIG_KEY);
18579
18585
  };
18580
18586
 
18581
- FeatureFlagManager.prototype.areFeaturesReady = function() {
18582
- if (!this.isEnabled()) {
18587
+ FeatureFlagManager.prototype.areFlagsReady = function() {
18588
+ if (!this.isSystemEnabled()) {
18583
18589
  logger.error('Feature Flags not enabled');
18584
18590
  }
18585
18591
  return !!this.flags;
18586
18592
  };
18587
18593
 
18588
18594
  FeatureFlagManager.prototype.fetchFlags = function() {
18589
- if (!this.isEnabled()) {
18595
+ if (!this.isSystemEnabled()) {
18590
18596
  return;
18591
18597
  }
18592
18598
 
@@ -18612,7 +18618,7 @@
18612
18618
  _.each(responseFlags, function(data, key) {
18613
18619
  flags.set(key, {
18614
18620
  'key': data['variant_key'],
18615
- 'data': data['variant_value']
18621
+ 'value': data['variant_value']
18616
18622
  });
18617
18623
  });
18618
18624
  this.flags = flags;
@@ -18622,7 +18628,7 @@
18622
18628
  }.bind(this)).catch(function() {});
18623
18629
  };
18624
18630
 
18625
- FeatureFlagManager.prototype.getFeature = function(featureName, fallback) {
18631
+ FeatureFlagManager.prototype.getVariant = function(featureName, fallback) {
18626
18632
  if (!this.fetchPromise) {
18627
18633
  return new Promise(function(resolve) {
18628
18634
  logger.critical('Feature Flags not initialized');
@@ -18631,15 +18637,15 @@
18631
18637
  }
18632
18638
 
18633
18639
  return this.fetchPromise.then(function() {
18634
- return this.getFeatureSync(featureName, fallback);
18640
+ return this.getVariantSync(featureName, fallback);
18635
18641
  }.bind(this)).catch(function(error) {
18636
18642
  logger.error(error);
18637
18643
  return fallback;
18638
18644
  });
18639
18645
  };
18640
18646
 
18641
- FeatureFlagManager.prototype.getFeatureSync = function(featureName, fallback) {
18642
- if (!this.areFeaturesReady()) {
18647
+ FeatureFlagManager.prototype.getVariantSync = function(featureName, fallback) {
18648
+ if (!this.areFlagsReady()) {
18643
18649
  logger.log('Flags not loaded yet');
18644
18650
  return fallback;
18645
18651
  }
@@ -18652,31 +18658,37 @@
18652
18658
  return feature;
18653
18659
  };
18654
18660
 
18655
- FeatureFlagManager.prototype.getFeatureData = function(featureName, fallbackValue) {
18656
- return this.getFeature(featureName, {'data': fallbackValue}).then(function(feature) {
18657
- return feature['data'];
18661
+ FeatureFlagManager.prototype.getVariantValue = function(featureName, fallbackValue) {
18662
+ return this.getVariant(featureName, {'value': fallbackValue}).then(function(feature) {
18663
+ return feature['value'];
18658
18664
  }).catch(function(error) {
18659
18665
  logger.error(error);
18660
18666
  return fallbackValue;
18661
18667
  });
18662
18668
  };
18663
18669
 
18664
- FeatureFlagManager.prototype.getFeatureDataSync = function(featureName, fallbackValue) {
18665
- return this.getFeatureSync(featureName, {'data': fallbackValue})['data'];
18670
+ // TODO remove deprecated method
18671
+ FeatureFlagManager.prototype.getFeatureData = function(featureName, fallbackValue) {
18672
+ logger.critical('mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead.');
18673
+ return this.getVariantValue(featureName, fallbackValue);
18674
+ };
18675
+
18676
+ FeatureFlagManager.prototype.getVariantValueSync = function(featureName, fallbackValue) {
18677
+ return this.getVariantSync(featureName, {'value': fallbackValue})['value'];
18666
18678
  };
18667
18679
 
18668
- FeatureFlagManager.prototype.isFeatureEnabled = function(featureName, fallbackValue) {
18669
- return this.getFeatureData(featureName).then(function() {
18670
- return this.isFeatureEnabledSync(featureName, fallbackValue);
18680
+ FeatureFlagManager.prototype.isEnabled = function(featureName, fallbackValue) {
18681
+ return this.getVariantValue(featureName).then(function() {
18682
+ return this.isEnabledSync(featureName, fallbackValue);
18671
18683
  }.bind(this)).catch(function(error) {
18672
18684
  logger.error(error);
18673
18685
  return fallbackValue;
18674
18686
  });
18675
18687
  };
18676
18688
 
18677
- FeatureFlagManager.prototype.isFeatureEnabledSync = function(featureName, fallbackValue) {
18689
+ FeatureFlagManager.prototype.isEnabledSync = function(featureName, fallbackValue) {
18678
18690
  fallbackValue = fallbackValue || false;
18679
- var val = this.getFeatureDataSync(featureName, fallbackValue);
18691
+ var val = this.getVariantValueSync(featureName, fallbackValue);
18680
18692
  if (val !== true && val !== false) {
18681
18693
  logger.error('Feature flag "' + featureName + '" value: ' + val + ' is not a boolean; returning fallback value: ' + fallbackValue);
18682
18694
  val = fallbackValue;
@@ -18705,13 +18717,16 @@
18705
18717
 
18706
18718
  safewrapClass(FeatureFlagManager);
18707
18719
 
18708
- FeatureFlagManager.prototype['are_features_ready'] = FeatureFlagManager.prototype.areFeaturesReady;
18709
- FeatureFlagManager.prototype['get_feature'] = FeatureFlagManager.prototype.getFeature;
18720
+ FeatureFlagManager.prototype['are_flags_ready'] = FeatureFlagManager.prototype.areFlagsReady;
18721
+ FeatureFlagManager.prototype['get_variant'] = FeatureFlagManager.prototype.getVariant;
18722
+ FeatureFlagManager.prototype['get_variant_sync'] = FeatureFlagManager.prototype.getVariantSync;
18723
+ FeatureFlagManager.prototype['get_variant_value'] = FeatureFlagManager.prototype.getVariantValue;
18724
+ FeatureFlagManager.prototype['get_variant_value_sync'] = FeatureFlagManager.prototype.getVariantValueSync;
18725
+ FeatureFlagManager.prototype['is_enabled'] = FeatureFlagManager.prototype.isEnabled;
18726
+ FeatureFlagManager.prototype['is_enabled_sync'] = FeatureFlagManager.prototype.isEnabledSync;
18727
+
18728
+ // Deprecated method
18710
18729
  FeatureFlagManager.prototype['get_feature_data'] = FeatureFlagManager.prototype.getFeatureData;
18711
- FeatureFlagManager.prototype['get_feature_data_sync'] = FeatureFlagManager.prototype.getFeatureDataSync;
18712
- FeatureFlagManager.prototype['get_feature_sync'] = FeatureFlagManager.prototype.getFeatureSync;
18713
- FeatureFlagManager.prototype['is_feature_enabled'] = FeatureFlagManager.prototype.isFeatureEnabled;
18714
- FeatureFlagManager.prototype['is_feature_enabled_sync'] = FeatureFlagManager.prototype.isFeatureEnabledSync;
18715
18730
 
18716
18731
  /* eslint camelcase: "off" */
18717
18732
 
@@ -19407,18 +19422,8 @@
19407
19422
  * @param {Function} [callback] If provided, the callback will be called when the server responds
19408
19423
  * @deprecated
19409
19424
  */
19410
- MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {
19411
- if (!_.isNumber(amount)) {
19412
- amount = parseFloat(amount);
19413
- if (isNaN(amount)) {
19414
- console$1.error('Invalid value passed to mixpanel.people.track_charge - must be a number');
19415
- return;
19416
- }
19417
- }
19418
-
19419
- return this.append('$transactions', _.extend({
19420
- '$amount': amount
19421
- }, properties), callback);
19425
+ MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function() {
19426
+ console$1.error('mixpanel.people.track_charge() is deprecated and no longer has any effect.');
19422
19427
  });
19423
19428
 
19424
19429
  /*
@@ -20130,6 +20135,7 @@
20130
20135
  var DEFAULT_CONFIG = {
20131
20136
  'api_host': 'https://api-js.mixpanel.com',
20132
20137
  'api_routes': DEFAULT_API_ROUTES,
20138
+ 'api_extra_query_params': {},
20133
20139
  'api_method': 'POST',
20134
20140
  'api_transport': 'XHR',
20135
20141
  'api_payload_format': PAYLOAD_TYPE_BASE64,
@@ -20717,6 +20723,8 @@
20717
20723
  delete data['data'];
20718
20724
  }
20719
20725
 
20726
+ _.extend(data, this.get_config('api_extra_query_params'));
20727
+
20720
20728
  url += '?' + _.HTTPBuildQuery(data);
20721
20729
 
20722
20730
  var lib = this;
@@ -21633,6 +21641,8 @@
21633
21641
  'distinct_id': DEVICE_ID_PREFIX + uuid,
21634
21642
  '$device_id': uuid
21635
21643
  }, '');
21644
+ this.stop_session_recording();
21645
+ this._check_and_start_session_recording();
21636
21646
  };
21637
21647
 
21638
21648
  /**