mixpanel-browser 2.50.0 → 2.51.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.
- package/.github/workflows/tests.yml +9 -10
- package/dist/mixpanel-js-wrapper.js +1 -1
- package/dist/mixpanel-js-wrapper.min.js +1 -1
- package/dist/mixpanel-jslib-snippet.min.js +1 -1
- package/dist/mixpanel-jslib-snippet.min.test.js +1 -1
- package/dist/mixpanel-recorder.js +1371 -812
- package/dist/mixpanel-recorder.min.js +24 -10
- package/dist/mixpanel.amd.js +71 -91
- package/dist/mixpanel.cjs.js +71 -91
- package/dist/mixpanel.globals.js +71 -91
- package/dist/mixpanel.min.js +89 -89
- package/dist/mixpanel.umd.js +71 -91
- package/package.json +2 -2
- package/src/config.js +1 -1
- package/src/loaders/mixpanel-jslib-snippet.js +1 -1
- package/src/mixpanel-core.js +56 -47
- package/src/mixpanel-persistence.js +14 -43
- package/src/recorder/index.js +4 -1
package/dist/mixpanel.amd.js
CHANGED
|
@@ -2,7 +2,7 @@ define((function () { 'use strict';
|
|
|
2
2
|
|
|
3
3
|
var Config = {
|
|
4
4
|
DEBUG: false,
|
|
5
|
-
LIB_VERSION: '2.
|
|
5
|
+
LIB_VERSION: '2.51.0'
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
/* eslint camelcase: "off", eqeqeq: "off" */
|
|
@@ -3712,7 +3712,7 @@ define((function () { 'use strict';
|
|
|
3712
3712
|
|
|
3713
3713
|
this.load();
|
|
3714
3714
|
this.update_config(config);
|
|
3715
|
-
this.upgrade(
|
|
3715
|
+
this.upgrade();
|
|
3716
3716
|
this.save();
|
|
3717
3717
|
};
|
|
3718
3718
|
|
|
@@ -3740,49 +3740,12 @@ define((function () { 'use strict';
|
|
|
3740
3740
|
}
|
|
3741
3741
|
};
|
|
3742
3742
|
|
|
3743
|
-
MixpanelPersistence.prototype.upgrade = function(
|
|
3744
|
-
var
|
|
3745
|
-
|
|
3746
|
-
old_cookie;
|
|
3747
|
-
|
|
3748
|
-
if (upgrade_from_old_lib) {
|
|
3749
|
-
old_cookie_name = 'mp_super_properties';
|
|
3750
|
-
// Case where they had a custom cookie name before.
|
|
3751
|
-
if (typeof(upgrade_from_old_lib) === 'string') {
|
|
3752
|
-
old_cookie_name = upgrade_from_old_lib;
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
old_cookie = this.storage.parse(old_cookie_name);
|
|
3756
|
-
|
|
3757
|
-
// remove the cookie
|
|
3758
|
-
this.storage.remove(old_cookie_name);
|
|
3759
|
-
this.storage.remove(old_cookie_name, true);
|
|
3760
|
-
|
|
3761
|
-
if (old_cookie) {
|
|
3762
|
-
this['props'] = _.extend(
|
|
3763
|
-
this['props'],
|
|
3764
|
-
old_cookie['all'],
|
|
3765
|
-
old_cookie['events']
|
|
3766
|
-
);
|
|
3767
|
-
}
|
|
3768
|
-
}
|
|
3769
|
-
|
|
3770
|
-
if (!config['cookie_name'] && config['name'] !== 'mixpanel') {
|
|
3771
|
-
// special case to handle people with cookies of the form
|
|
3772
|
-
// mp_TOKEN_INSTANCENAME from the first release of this library
|
|
3773
|
-
old_cookie_name = 'mp_' + config['token'] + '_' + config['name'];
|
|
3774
|
-
old_cookie = this.storage.parse(old_cookie_name);
|
|
3775
|
-
|
|
3776
|
-
if (old_cookie) {
|
|
3777
|
-
this.storage.remove(old_cookie_name);
|
|
3778
|
-
this.storage.remove(old_cookie_name, true);
|
|
3779
|
-
|
|
3780
|
-
// Save the prop values that were in the cookie from before -
|
|
3781
|
-
// this should only happen once as we delete the old one.
|
|
3782
|
-
this.register_once(old_cookie);
|
|
3783
|
-
}
|
|
3784
|
-
}
|
|
3743
|
+
MixpanelPersistence.prototype.upgrade = function() {
|
|
3744
|
+
var old_cookie,
|
|
3745
|
+
old_localstorage;
|
|
3785
3746
|
|
|
3747
|
+
// if transferring from cookie to localStorage or vice-versa, copy existing
|
|
3748
|
+
// super properties over to new storage mode
|
|
3786
3749
|
if (this.storage === _.localStorage) {
|
|
3787
3750
|
old_cookie = _.cookie.parse(this.name);
|
|
3788
3751
|
|
|
@@ -3792,6 +3755,14 @@ define((function () { 'use strict';
|
|
|
3792
3755
|
if (old_cookie) {
|
|
3793
3756
|
this.register_once(old_cookie);
|
|
3794
3757
|
}
|
|
3758
|
+
} else if (this.storage === _.cookie) {
|
|
3759
|
+
old_localstorage = _.localStorage.parse(this.name);
|
|
3760
|
+
|
|
3761
|
+
_.localStorage.remove(this.name);
|
|
3762
|
+
|
|
3763
|
+
if (old_localstorage) {
|
|
3764
|
+
this.register_once(old_localstorage);
|
|
3765
|
+
}
|
|
3795
3766
|
}
|
|
3796
3767
|
};
|
|
3797
3768
|
|
|
@@ -4201,7 +4172,7 @@ define((function () { 'use strict';
|
|
|
4201
4172
|
'track_pageview': false,
|
|
4202
4173
|
'skip_first_touch_marketing': false,
|
|
4203
4174
|
'store_google': true,
|
|
4204
|
-
'stop_utm_persistence':
|
|
4175
|
+
'stop_utm_persistence': true,
|
|
4205
4176
|
'save_referrer': true,
|
|
4206
4177
|
'test': false,
|
|
4207
4178
|
'verbose': false,
|
|
@@ -4227,10 +4198,13 @@ define((function () { 'use strict';
|
|
|
4227
4198
|
'batch_request_timeout_ms': 90000,
|
|
4228
4199
|
'batch_autostart': true,
|
|
4229
4200
|
'hooks': {},
|
|
4230
|
-
'
|
|
4201
|
+
'record_block_class': new RegExp('^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$'),
|
|
4202
|
+
'record_block_selector': 'img, video',
|
|
4231
4203
|
'record_idle_timeout_ms': 30 * 60 * 1000, // 30 minutes
|
|
4232
|
-
'
|
|
4204
|
+
'record_mask_text_class': new RegExp('^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$'),
|
|
4233
4205
|
'record_mask_text_selector': '*',
|
|
4206
|
+
'record_max_ms': MAX_RECORDING_MS,
|
|
4207
|
+
'record_sessions_percent': 0,
|
|
4234
4208
|
'recorder_src': 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js'
|
|
4235
4209
|
};
|
|
4236
4210
|
|
|
@@ -4481,6 +4455,17 @@ define((function () { 'use strict';
|
|
|
4481
4455
|
}
|
|
4482
4456
|
};
|
|
4483
4457
|
|
|
4458
|
+
MixpanelLib.prototype.get_session_recording_properties = function () {
|
|
4459
|
+
var props = {};
|
|
4460
|
+
if (this._recorder) {
|
|
4461
|
+
var replay_id = this._recorder['replayId'];
|
|
4462
|
+
if (replay_id) {
|
|
4463
|
+
props['$mp_replay_id'] = replay_id;
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
return props;
|
|
4467
|
+
};
|
|
4468
|
+
|
|
4484
4469
|
// Private methods
|
|
4485
4470
|
|
|
4486
4471
|
MixpanelLib.prototype._loaded = function() {
|
|
@@ -4488,9 +4473,8 @@ define((function () { 'use strict';
|
|
|
4488
4473
|
this._set_default_superprops();
|
|
4489
4474
|
this['people'].set_once(this['persistence'].get_referrer_info());
|
|
4490
4475
|
|
|
4491
|
-
//
|
|
4492
|
-
//
|
|
4493
|
-
// stop_utm_persistence is `false` by default now but will be default `true` in the future.
|
|
4476
|
+
// `store_google` is now deprecated and previously stored UTM parameters are cleared
|
|
4477
|
+
// from persistence by default.
|
|
4494
4478
|
if (this.get_config('store_google') && this.get_config('stop_utm_persistence')) {
|
|
4495
4479
|
var utm_params = _.info.campaignParams(null);
|
|
4496
4480
|
_.each(utm_params, function(_utm_value, utm_key) {
|
|
@@ -4504,6 +4488,7 @@ define((function () { 'use strict';
|
|
|
4504
4488
|
// update persistence with info on referrer, UTM params, etc
|
|
4505
4489
|
MixpanelLib.prototype._set_default_superprops = function() {
|
|
4506
4490
|
this['persistence'].update_search_keyword(document$1.referrer);
|
|
4491
|
+
// Registering super properties for UTM persistence by 'store_google' is deprecated.
|
|
4507
4492
|
if (this.get_config('store_google') && !this.get_config('stop_utm_persistence')) {
|
|
4508
4493
|
this.register(_.info.campaignParams());
|
|
4509
4494
|
}
|
|
@@ -5052,13 +5037,6 @@ define((function () { 'use strict';
|
|
|
5052
5037
|
? _.info.marketingParams()
|
|
5053
5038
|
: {};
|
|
5054
5039
|
|
|
5055
|
-
if (this._recorder) {
|
|
5056
|
-
var replay_id = this._recorder['replayId'];
|
|
5057
|
-
if (replay_id) {
|
|
5058
|
-
properties['$mp_replay_id'] = replay_id;
|
|
5059
|
-
}
|
|
5060
|
-
}
|
|
5061
|
-
|
|
5062
5040
|
// note: extend writes to the first object, so lets make sure we
|
|
5063
5041
|
// don't write to the persistence properties object and info
|
|
5064
5042
|
// properties object by passing in a new object
|
|
@@ -5070,6 +5048,7 @@ define((function () { 'use strict';
|
|
|
5070
5048
|
marketing_properties,
|
|
5071
5049
|
this['persistence'].properties(),
|
|
5072
5050
|
this.unpersisted_superprops,
|
|
5051
|
+
this.get_session_recording_properties(),
|
|
5073
5052
|
properties
|
|
5074
5053
|
);
|
|
5075
5054
|
|
|
@@ -6177,40 +6156,41 @@ define((function () { 'use strict';
|
|
|
6177
6156
|
// EXPORTS (for closure compiler)
|
|
6178
6157
|
|
|
6179
6158
|
// MixpanelLib Exports
|
|
6180
|
-
MixpanelLib.prototype['init']
|
|
6181
|
-
MixpanelLib.prototype['reset']
|
|
6182
|
-
MixpanelLib.prototype['disable']
|
|
6183
|
-
MixpanelLib.prototype['time_event']
|
|
6184
|
-
MixpanelLib.prototype['track']
|
|
6185
|
-
MixpanelLib.prototype['track_links']
|
|
6186
|
-
MixpanelLib.prototype['track_forms']
|
|
6187
|
-
MixpanelLib.prototype['track_pageview']
|
|
6188
|
-
MixpanelLib.prototype['register']
|
|
6189
|
-
MixpanelLib.prototype['register_once']
|
|
6190
|
-
MixpanelLib.prototype['unregister']
|
|
6191
|
-
MixpanelLib.prototype['identify']
|
|
6192
|
-
MixpanelLib.prototype['alias']
|
|
6193
|
-
MixpanelLib.prototype['name_tag']
|
|
6194
|
-
MixpanelLib.prototype['set_config']
|
|
6195
|
-
MixpanelLib.prototype['get_config']
|
|
6196
|
-
MixpanelLib.prototype['get_property']
|
|
6197
|
-
MixpanelLib.prototype['get_distinct_id']
|
|
6198
|
-
MixpanelLib.prototype['toString']
|
|
6199
|
-
MixpanelLib.prototype['opt_out_tracking']
|
|
6200
|
-
MixpanelLib.prototype['opt_in_tracking']
|
|
6201
|
-
MixpanelLib.prototype['has_opted_out_tracking']
|
|
6202
|
-
MixpanelLib.prototype['has_opted_in_tracking']
|
|
6203
|
-
MixpanelLib.prototype['clear_opt_in_out_tracking']
|
|
6204
|
-
MixpanelLib.prototype['get_group']
|
|
6205
|
-
MixpanelLib.prototype['set_group']
|
|
6206
|
-
MixpanelLib.prototype['add_group']
|
|
6207
|
-
MixpanelLib.prototype['remove_group']
|
|
6208
|
-
MixpanelLib.prototype['track_with_groups']
|
|
6209
|
-
MixpanelLib.prototype['start_batch_senders']
|
|
6210
|
-
MixpanelLib.prototype['stop_batch_senders']
|
|
6211
|
-
MixpanelLib.prototype['start_session_recording']
|
|
6212
|
-
MixpanelLib.prototype['stop_session_recording']
|
|
6213
|
-
MixpanelLib.prototype['
|
|
6159
|
+
MixpanelLib.prototype['init'] = MixpanelLib.prototype.init;
|
|
6160
|
+
MixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;
|
|
6161
|
+
MixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;
|
|
6162
|
+
MixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;
|
|
6163
|
+
MixpanelLib.prototype['track'] = MixpanelLib.prototype.track;
|
|
6164
|
+
MixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;
|
|
6165
|
+
MixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;
|
|
6166
|
+
MixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;
|
|
6167
|
+
MixpanelLib.prototype['register'] = MixpanelLib.prototype.register;
|
|
6168
|
+
MixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;
|
|
6169
|
+
MixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;
|
|
6170
|
+
MixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;
|
|
6171
|
+
MixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;
|
|
6172
|
+
MixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;
|
|
6173
|
+
MixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;
|
|
6174
|
+
MixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;
|
|
6175
|
+
MixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;
|
|
6176
|
+
MixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;
|
|
6177
|
+
MixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;
|
|
6178
|
+
MixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;
|
|
6179
|
+
MixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;
|
|
6180
|
+
MixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;
|
|
6181
|
+
MixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;
|
|
6182
|
+
MixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;
|
|
6183
|
+
MixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;
|
|
6184
|
+
MixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;
|
|
6185
|
+
MixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;
|
|
6186
|
+
MixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;
|
|
6187
|
+
MixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;
|
|
6188
|
+
MixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;
|
|
6189
|
+
MixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;
|
|
6190
|
+
MixpanelLib.prototype['start_session_recording'] = MixpanelLib.prototype.start_session_recording;
|
|
6191
|
+
MixpanelLib.prototype['stop_session_recording'] = MixpanelLib.prototype.stop_session_recording;
|
|
6192
|
+
MixpanelLib.prototype['get_session_recording_properties'] = MixpanelLib.prototype.get_session_recording_properties;
|
|
6193
|
+
MixpanelLib.prototype['DEFAULT_API_ROUTES'] = DEFAULT_API_ROUTES;
|
|
6214
6194
|
|
|
6215
6195
|
// MixpanelPersistence Exports
|
|
6216
6196
|
MixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;
|
package/dist/mixpanel.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var Config = {
|
|
4
4
|
DEBUG: false,
|
|
5
|
-
LIB_VERSION: '2.
|
|
5
|
+
LIB_VERSION: '2.51.0'
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
/* eslint camelcase: "off", eqeqeq: "off" */
|
|
@@ -3712,7 +3712,7 @@ var MixpanelPersistence = function(config) {
|
|
|
3712
3712
|
|
|
3713
3713
|
this.load();
|
|
3714
3714
|
this.update_config(config);
|
|
3715
|
-
this.upgrade(
|
|
3715
|
+
this.upgrade();
|
|
3716
3716
|
this.save();
|
|
3717
3717
|
};
|
|
3718
3718
|
|
|
@@ -3740,49 +3740,12 @@ MixpanelPersistence.prototype.load = function() {
|
|
|
3740
3740
|
}
|
|
3741
3741
|
};
|
|
3742
3742
|
|
|
3743
|
-
MixpanelPersistence.prototype.upgrade = function(
|
|
3744
|
-
var
|
|
3745
|
-
|
|
3746
|
-
old_cookie;
|
|
3747
|
-
|
|
3748
|
-
if (upgrade_from_old_lib) {
|
|
3749
|
-
old_cookie_name = 'mp_super_properties';
|
|
3750
|
-
// Case where they had a custom cookie name before.
|
|
3751
|
-
if (typeof(upgrade_from_old_lib) === 'string') {
|
|
3752
|
-
old_cookie_name = upgrade_from_old_lib;
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
old_cookie = this.storage.parse(old_cookie_name);
|
|
3756
|
-
|
|
3757
|
-
// remove the cookie
|
|
3758
|
-
this.storage.remove(old_cookie_name);
|
|
3759
|
-
this.storage.remove(old_cookie_name, true);
|
|
3760
|
-
|
|
3761
|
-
if (old_cookie) {
|
|
3762
|
-
this['props'] = _.extend(
|
|
3763
|
-
this['props'],
|
|
3764
|
-
old_cookie['all'],
|
|
3765
|
-
old_cookie['events']
|
|
3766
|
-
);
|
|
3767
|
-
}
|
|
3768
|
-
}
|
|
3769
|
-
|
|
3770
|
-
if (!config['cookie_name'] && config['name'] !== 'mixpanel') {
|
|
3771
|
-
// special case to handle people with cookies of the form
|
|
3772
|
-
// mp_TOKEN_INSTANCENAME from the first release of this library
|
|
3773
|
-
old_cookie_name = 'mp_' + config['token'] + '_' + config['name'];
|
|
3774
|
-
old_cookie = this.storage.parse(old_cookie_name);
|
|
3775
|
-
|
|
3776
|
-
if (old_cookie) {
|
|
3777
|
-
this.storage.remove(old_cookie_name);
|
|
3778
|
-
this.storage.remove(old_cookie_name, true);
|
|
3779
|
-
|
|
3780
|
-
// Save the prop values that were in the cookie from before -
|
|
3781
|
-
// this should only happen once as we delete the old one.
|
|
3782
|
-
this.register_once(old_cookie);
|
|
3783
|
-
}
|
|
3784
|
-
}
|
|
3743
|
+
MixpanelPersistence.prototype.upgrade = function() {
|
|
3744
|
+
var old_cookie,
|
|
3745
|
+
old_localstorage;
|
|
3785
3746
|
|
|
3747
|
+
// if transferring from cookie to localStorage or vice-versa, copy existing
|
|
3748
|
+
// super properties over to new storage mode
|
|
3786
3749
|
if (this.storage === _.localStorage) {
|
|
3787
3750
|
old_cookie = _.cookie.parse(this.name);
|
|
3788
3751
|
|
|
@@ -3792,6 +3755,14 @@ MixpanelPersistence.prototype.upgrade = function(config) {
|
|
|
3792
3755
|
if (old_cookie) {
|
|
3793
3756
|
this.register_once(old_cookie);
|
|
3794
3757
|
}
|
|
3758
|
+
} else if (this.storage === _.cookie) {
|
|
3759
|
+
old_localstorage = _.localStorage.parse(this.name);
|
|
3760
|
+
|
|
3761
|
+
_.localStorage.remove(this.name);
|
|
3762
|
+
|
|
3763
|
+
if (old_localstorage) {
|
|
3764
|
+
this.register_once(old_localstorage);
|
|
3765
|
+
}
|
|
3795
3766
|
}
|
|
3796
3767
|
};
|
|
3797
3768
|
|
|
@@ -4201,7 +4172,7 @@ var DEFAULT_CONFIG = {
|
|
|
4201
4172
|
'track_pageview': false,
|
|
4202
4173
|
'skip_first_touch_marketing': false,
|
|
4203
4174
|
'store_google': true,
|
|
4204
|
-
'stop_utm_persistence':
|
|
4175
|
+
'stop_utm_persistence': true,
|
|
4205
4176
|
'save_referrer': true,
|
|
4206
4177
|
'test': false,
|
|
4207
4178
|
'verbose': false,
|
|
@@ -4227,10 +4198,13 @@ var DEFAULT_CONFIG = {
|
|
|
4227
4198
|
'batch_request_timeout_ms': 90000,
|
|
4228
4199
|
'batch_autostart': true,
|
|
4229
4200
|
'hooks': {},
|
|
4230
|
-
'
|
|
4201
|
+
'record_block_class': new RegExp('^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$'),
|
|
4202
|
+
'record_block_selector': 'img, video',
|
|
4231
4203
|
'record_idle_timeout_ms': 30 * 60 * 1000, // 30 minutes
|
|
4232
|
-
'
|
|
4204
|
+
'record_mask_text_class': new RegExp('^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$'),
|
|
4233
4205
|
'record_mask_text_selector': '*',
|
|
4206
|
+
'record_max_ms': MAX_RECORDING_MS,
|
|
4207
|
+
'record_sessions_percent': 0,
|
|
4234
4208
|
'recorder_src': 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js'
|
|
4235
4209
|
};
|
|
4236
4210
|
|
|
@@ -4481,6 +4455,17 @@ MixpanelLib.prototype.stop_session_recording = function () {
|
|
|
4481
4455
|
}
|
|
4482
4456
|
};
|
|
4483
4457
|
|
|
4458
|
+
MixpanelLib.prototype.get_session_recording_properties = function () {
|
|
4459
|
+
var props = {};
|
|
4460
|
+
if (this._recorder) {
|
|
4461
|
+
var replay_id = this._recorder['replayId'];
|
|
4462
|
+
if (replay_id) {
|
|
4463
|
+
props['$mp_replay_id'] = replay_id;
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
return props;
|
|
4467
|
+
};
|
|
4468
|
+
|
|
4484
4469
|
// Private methods
|
|
4485
4470
|
|
|
4486
4471
|
MixpanelLib.prototype._loaded = function() {
|
|
@@ -4488,9 +4473,8 @@ MixpanelLib.prototype._loaded = function() {
|
|
|
4488
4473
|
this._set_default_superprops();
|
|
4489
4474
|
this['people'].set_once(this['persistence'].get_referrer_info());
|
|
4490
4475
|
|
|
4491
|
-
//
|
|
4492
|
-
//
|
|
4493
|
-
// stop_utm_persistence is `false` by default now but will be default `true` in the future.
|
|
4476
|
+
// `store_google` is now deprecated and previously stored UTM parameters are cleared
|
|
4477
|
+
// from persistence by default.
|
|
4494
4478
|
if (this.get_config('store_google') && this.get_config('stop_utm_persistence')) {
|
|
4495
4479
|
var utm_params = _.info.campaignParams(null);
|
|
4496
4480
|
_.each(utm_params, function(_utm_value, utm_key) {
|
|
@@ -4504,6 +4488,7 @@ MixpanelLib.prototype._loaded = function() {
|
|
|
4504
4488
|
// update persistence with info on referrer, UTM params, etc
|
|
4505
4489
|
MixpanelLib.prototype._set_default_superprops = function() {
|
|
4506
4490
|
this['persistence'].update_search_keyword(document$1.referrer);
|
|
4491
|
+
// Registering super properties for UTM persistence by 'store_google' is deprecated.
|
|
4507
4492
|
if (this.get_config('store_google') && !this.get_config('stop_utm_persistence')) {
|
|
4508
4493
|
this.register(_.info.campaignParams());
|
|
4509
4494
|
}
|
|
@@ -5052,13 +5037,6 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
|
|
|
5052
5037
|
? _.info.marketingParams()
|
|
5053
5038
|
: {};
|
|
5054
5039
|
|
|
5055
|
-
if (this._recorder) {
|
|
5056
|
-
var replay_id = this._recorder['replayId'];
|
|
5057
|
-
if (replay_id) {
|
|
5058
|
-
properties['$mp_replay_id'] = replay_id;
|
|
5059
|
-
}
|
|
5060
|
-
}
|
|
5061
|
-
|
|
5062
5040
|
// note: extend writes to the first object, so lets make sure we
|
|
5063
5041
|
// don't write to the persistence properties object and info
|
|
5064
5042
|
// properties object by passing in a new object
|
|
@@ -5070,6 +5048,7 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
|
|
|
5070
5048
|
marketing_properties,
|
|
5071
5049
|
this['persistence'].properties(),
|
|
5072
5050
|
this.unpersisted_superprops,
|
|
5051
|
+
this.get_session_recording_properties(),
|
|
5073
5052
|
properties
|
|
5074
5053
|
);
|
|
5075
5054
|
|
|
@@ -6177,40 +6156,41 @@ MixpanelLib.prototype.report_error = function(msg, err) {
|
|
|
6177
6156
|
// EXPORTS (for closure compiler)
|
|
6178
6157
|
|
|
6179
6158
|
// MixpanelLib Exports
|
|
6180
|
-
MixpanelLib.prototype['init']
|
|
6181
|
-
MixpanelLib.prototype['reset']
|
|
6182
|
-
MixpanelLib.prototype['disable']
|
|
6183
|
-
MixpanelLib.prototype['time_event']
|
|
6184
|
-
MixpanelLib.prototype['track']
|
|
6185
|
-
MixpanelLib.prototype['track_links']
|
|
6186
|
-
MixpanelLib.prototype['track_forms']
|
|
6187
|
-
MixpanelLib.prototype['track_pageview']
|
|
6188
|
-
MixpanelLib.prototype['register']
|
|
6189
|
-
MixpanelLib.prototype['register_once']
|
|
6190
|
-
MixpanelLib.prototype['unregister']
|
|
6191
|
-
MixpanelLib.prototype['identify']
|
|
6192
|
-
MixpanelLib.prototype['alias']
|
|
6193
|
-
MixpanelLib.prototype['name_tag']
|
|
6194
|
-
MixpanelLib.prototype['set_config']
|
|
6195
|
-
MixpanelLib.prototype['get_config']
|
|
6196
|
-
MixpanelLib.prototype['get_property']
|
|
6197
|
-
MixpanelLib.prototype['get_distinct_id']
|
|
6198
|
-
MixpanelLib.prototype['toString']
|
|
6199
|
-
MixpanelLib.prototype['opt_out_tracking']
|
|
6200
|
-
MixpanelLib.prototype['opt_in_tracking']
|
|
6201
|
-
MixpanelLib.prototype['has_opted_out_tracking']
|
|
6202
|
-
MixpanelLib.prototype['has_opted_in_tracking']
|
|
6203
|
-
MixpanelLib.prototype['clear_opt_in_out_tracking']
|
|
6204
|
-
MixpanelLib.prototype['get_group']
|
|
6205
|
-
MixpanelLib.prototype['set_group']
|
|
6206
|
-
MixpanelLib.prototype['add_group']
|
|
6207
|
-
MixpanelLib.prototype['remove_group']
|
|
6208
|
-
MixpanelLib.prototype['track_with_groups']
|
|
6209
|
-
MixpanelLib.prototype['start_batch_senders']
|
|
6210
|
-
MixpanelLib.prototype['stop_batch_senders']
|
|
6211
|
-
MixpanelLib.prototype['start_session_recording']
|
|
6212
|
-
MixpanelLib.prototype['stop_session_recording']
|
|
6213
|
-
MixpanelLib.prototype['
|
|
6159
|
+
MixpanelLib.prototype['init'] = MixpanelLib.prototype.init;
|
|
6160
|
+
MixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;
|
|
6161
|
+
MixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;
|
|
6162
|
+
MixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;
|
|
6163
|
+
MixpanelLib.prototype['track'] = MixpanelLib.prototype.track;
|
|
6164
|
+
MixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;
|
|
6165
|
+
MixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;
|
|
6166
|
+
MixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;
|
|
6167
|
+
MixpanelLib.prototype['register'] = MixpanelLib.prototype.register;
|
|
6168
|
+
MixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;
|
|
6169
|
+
MixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;
|
|
6170
|
+
MixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;
|
|
6171
|
+
MixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;
|
|
6172
|
+
MixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;
|
|
6173
|
+
MixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;
|
|
6174
|
+
MixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;
|
|
6175
|
+
MixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;
|
|
6176
|
+
MixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;
|
|
6177
|
+
MixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;
|
|
6178
|
+
MixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;
|
|
6179
|
+
MixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;
|
|
6180
|
+
MixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;
|
|
6181
|
+
MixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;
|
|
6182
|
+
MixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;
|
|
6183
|
+
MixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;
|
|
6184
|
+
MixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;
|
|
6185
|
+
MixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;
|
|
6186
|
+
MixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;
|
|
6187
|
+
MixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;
|
|
6188
|
+
MixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;
|
|
6189
|
+
MixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;
|
|
6190
|
+
MixpanelLib.prototype['start_session_recording'] = MixpanelLib.prototype.start_session_recording;
|
|
6191
|
+
MixpanelLib.prototype['stop_session_recording'] = MixpanelLib.prototype.stop_session_recording;
|
|
6192
|
+
MixpanelLib.prototype['get_session_recording_properties'] = MixpanelLib.prototype.get_session_recording_properties;
|
|
6193
|
+
MixpanelLib.prototype['DEFAULT_API_ROUTES'] = DEFAULT_API_ROUTES;
|
|
6214
6194
|
|
|
6215
6195
|
// MixpanelPersistence Exports
|
|
6216
6196
|
MixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;
|