mixpanel-browser 2.47.0 → 2.48.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/CHANGELOG.md +9 -1
- package/dist/mixpanel.amd.js +114 -75
- package/dist/mixpanel.cjs.js +114 -75
- package/dist/mixpanel.globals.js +114 -75
- package/dist/mixpanel.min.js +103 -102
- package/dist/mixpanel.umd.js +114 -75
- package/doc/readme.io/javascript-full-api-reference.md +31 -1
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/mixpanel-core.js +82 -43
- package/src/mixpanel-group.js +1 -1
- package/src/mixpanel-people.js +9 -7
- package/src/mixpanel-persistence.js +20 -23
- package/src/utils.js +1 -0
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.48.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
|
|
@@ -904,6 +904,7 @@ var BLOCKED_UA_STRS = [
|
|
|
904
904
|
'baiduspider',
|
|
905
905
|
'bingbot',
|
|
906
906
|
'bingpreview',
|
|
907
|
+
'chrome-lighthouse',
|
|
907
908
|
'facebookexternal',
|
|
908
909
|
'petalbot',
|
|
909
910
|
'pinterest',
|
|
@@ -3132,7 +3133,7 @@ MixpanelGroup.prototype._send_request = function(data, callback) {
|
|
|
3132
3133
|
return this._mixpanel._track_or_batch({
|
|
3133
3134
|
type: 'groups',
|
|
3134
3135
|
data: date_encoded_data,
|
|
3135
|
-
endpoint: this._get_config('api_host') + '/groups
|
|
3136
|
+
endpoint: this._get_config('api_host') + '/' + this._get_config('api_routes')['groups'],
|
|
3136
3137
|
batcher: this._mixpanel.request_batchers.groups
|
|
3137
3138
|
}, callback);
|
|
3138
3139
|
};
|
|
@@ -3493,7 +3494,7 @@ MixpanelPeople.prototype._send_request = function(data, callback) {
|
|
|
3493
3494
|
return this._mixpanel._track_or_batch({
|
|
3494
3495
|
type: 'people',
|
|
3495
3496
|
data: date_encoded_data,
|
|
3496
|
-
endpoint: this._get_config('api_host') + '/engage
|
|
3497
|
+
endpoint: this._get_config('api_host') + '/' + this._get_config('api_routes')['engage'],
|
|
3497
3498
|
batcher: this._mixpanel.request_batchers.people
|
|
3498
3499
|
}, callback);
|
|
3499
3500
|
};
|
|
@@ -3529,11 +3530,12 @@ MixpanelPeople.prototype._enqueue = function(data) {
|
|
|
3529
3530
|
|
|
3530
3531
|
MixpanelPeople.prototype._flush_one_queue = function(action, action_method, callback, queue_to_params_fn) {
|
|
3531
3532
|
var _this = this;
|
|
3532
|
-
var queued_data = _.extend({}, this._mixpanel['persistence'].
|
|
3533
|
+
var queued_data = _.extend({}, this._mixpanel['persistence'].load_queue(action));
|
|
3533
3534
|
var action_params = queued_data;
|
|
3534
3535
|
|
|
3535
3536
|
if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) {
|
|
3536
3537
|
_this._mixpanel['persistence']._pop_from_people_queue(action, queued_data);
|
|
3538
|
+
_this._mixpanel['persistence'].save();
|
|
3537
3539
|
if (queue_to_params_fn) {
|
|
3538
3540
|
action_params = queue_to_params_fn(queued_data);
|
|
3539
3541
|
}
|
|
@@ -3555,8 +3557,6 @@ MixpanelPeople.prototype._flush = function(
|
|
|
3555
3557
|
_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback
|
|
3556
3558
|
) {
|
|
3557
3559
|
var _this = this;
|
|
3558
|
-
var $append_queue = this._mixpanel['persistence']._get_queue(APPEND_ACTION);
|
|
3559
|
-
var $remove_queue = this._mixpanel['persistence']._get_queue(REMOVE_ACTION);
|
|
3560
3560
|
|
|
3561
3561
|
this._flush_one_queue(SET_ACTION, this.set, _set_callback);
|
|
3562
3562
|
this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback);
|
|
@@ -3566,6 +3566,7 @@ MixpanelPeople.prototype._flush = function(
|
|
|
3566
3566
|
|
|
3567
3567
|
// we have to fire off each $append individually since there is
|
|
3568
3568
|
// no concat method server side
|
|
3569
|
+
var $append_queue = this._mixpanel['persistence'].load_queue(APPEND_ACTION);
|
|
3569
3570
|
if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {
|
|
3570
3571
|
var $append_item;
|
|
3571
3572
|
var append_callback = function(response, data) {
|
|
@@ -3577,16 +3578,17 @@ MixpanelPeople.prototype._flush = function(
|
|
|
3577
3578
|
}
|
|
3578
3579
|
};
|
|
3579
3580
|
for (var i = $append_queue.length - 1; i >= 0; i--) {
|
|
3581
|
+
$append_queue = this._mixpanel['persistence'].load_queue(APPEND_ACTION);
|
|
3580
3582
|
$append_item = $append_queue.pop();
|
|
3583
|
+
_this._mixpanel['persistence'].save();
|
|
3581
3584
|
if (!_.isEmptyObject($append_item)) {
|
|
3582
3585
|
_this.append($append_item, append_callback);
|
|
3583
3586
|
}
|
|
3584
3587
|
}
|
|
3585
|
-
// Save the shortened append queue
|
|
3586
|
-
_this._mixpanel['persistence'].save();
|
|
3587
3588
|
}
|
|
3588
3589
|
|
|
3589
3590
|
// same for $remove
|
|
3591
|
+
var $remove_queue = this._mixpanel['persistence'].load_queue(REMOVE_ACTION);
|
|
3590
3592
|
if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) {
|
|
3591
3593
|
var $remove_item;
|
|
3592
3594
|
var remove_callback = function(response, data) {
|
|
@@ -3598,12 +3600,13 @@ MixpanelPeople.prototype._flush = function(
|
|
|
3598
3600
|
}
|
|
3599
3601
|
};
|
|
3600
3602
|
for (var j = $remove_queue.length - 1; j >= 0; j--) {
|
|
3603
|
+
$remove_queue = this._mixpanel['persistence'].load_queue(REMOVE_ACTION);
|
|
3601
3604
|
$remove_item = $remove_queue.pop();
|
|
3605
|
+
_this._mixpanel['persistence'].save();
|
|
3602
3606
|
if (!_.isEmptyObject($remove_item)) {
|
|
3603
3607
|
_this.remove($remove_item, remove_callback);
|
|
3604
3608
|
}
|
|
3605
3609
|
}
|
|
3606
|
-
_this._mixpanel['persistence'].save();
|
|
3607
3610
|
}
|
|
3608
3611
|
};
|
|
3609
3612
|
|
|
@@ -3685,6 +3688,9 @@ var MixpanelPersistence = function(config) {
|
|
|
3685
3688
|
|
|
3686
3689
|
MixpanelPersistence.prototype.properties = function() {
|
|
3687
3690
|
var p = {};
|
|
3691
|
+
|
|
3692
|
+
this.load();
|
|
3693
|
+
|
|
3688
3694
|
// Filter out reserved properties
|
|
3689
3695
|
_.each(this['props'], function(v, k) {
|
|
3690
3696
|
if (!_.include(RESERVED_PROPERTIES, k)) {
|
|
@@ -3761,6 +3767,7 @@ MixpanelPersistence.prototype.upgrade = function(config) {
|
|
|
3761
3767
|
|
|
3762
3768
|
MixpanelPersistence.prototype.save = function() {
|
|
3763
3769
|
if (this.disabled) { return; }
|
|
3770
|
+
|
|
3764
3771
|
this.storage.set(
|
|
3765
3772
|
this.name,
|
|
3766
3773
|
_.JSONEncode(this['props']),
|
|
@@ -3772,6 +3779,11 @@ MixpanelPersistence.prototype.save = function() {
|
|
|
3772
3779
|
);
|
|
3773
3780
|
};
|
|
3774
3781
|
|
|
3782
|
+
MixpanelPersistence.prototype.load_prop = function(key) {
|
|
3783
|
+
this.load();
|
|
3784
|
+
return this['props'][key];
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3775
3787
|
MixpanelPersistence.prototype.remove = function() {
|
|
3776
3788
|
// remove both domain and subdomain cookies
|
|
3777
3789
|
this.storage.remove(this.name, false, this.cookie_domain);
|
|
@@ -3795,6 +3807,8 @@ MixpanelPersistence.prototype.register_once = function(props, default_value, day
|
|
|
3795
3807
|
if (typeof(default_value) === 'undefined') { default_value = 'None'; }
|
|
3796
3808
|
this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;
|
|
3797
3809
|
|
|
3810
|
+
this.load();
|
|
3811
|
+
|
|
3798
3812
|
_.each(props, function(val, prop) {
|
|
3799
3813
|
if (!this['props'].hasOwnProperty(prop) || this['props'][prop] === default_value) {
|
|
3800
3814
|
this['props'][prop] = val;
|
|
@@ -3816,8 +3830,8 @@ MixpanelPersistence.prototype.register = function(props, days) {
|
|
|
3816
3830
|
if (_.isObject(props)) {
|
|
3817
3831
|
this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;
|
|
3818
3832
|
|
|
3833
|
+
this.load();
|
|
3819
3834
|
_.extend(this['props'], props);
|
|
3820
|
-
|
|
3821
3835
|
this.save();
|
|
3822
3836
|
|
|
3823
3837
|
return true;
|
|
@@ -3826,6 +3840,7 @@ MixpanelPersistence.prototype.register = function(props, days) {
|
|
|
3826
3840
|
};
|
|
3827
3841
|
|
|
3828
3842
|
MixpanelPersistence.prototype.unregister = function(prop) {
|
|
3843
|
+
this.load();
|
|
3829
3844
|
if (prop in this['props']) {
|
|
3830
3845
|
delete this['props'][prop];
|
|
3831
3846
|
this.save();
|
|
@@ -3852,19 +3867,6 @@ MixpanelPersistence.prototype.get_referrer_info = function() {
|
|
|
3852
3867
|
});
|
|
3853
3868
|
};
|
|
3854
3869
|
|
|
3855
|
-
// safely fills the passed in object with stored properties,
|
|
3856
|
-
// does not override any properties defined in both
|
|
3857
|
-
// returns the passed in object
|
|
3858
|
-
MixpanelPersistence.prototype.safe_merge = function(props) {
|
|
3859
|
-
_.each(this['props'], function(val, prop) {
|
|
3860
|
-
if (!(prop in props)) {
|
|
3861
|
-
props[prop] = val;
|
|
3862
|
-
}
|
|
3863
|
-
});
|
|
3864
|
-
|
|
3865
|
-
return props;
|
|
3866
|
-
};
|
|
3867
|
-
|
|
3868
3870
|
MixpanelPersistence.prototype.update_config = function(config) {
|
|
3869
3871
|
this.default_expiry = this.expire_days = config['cookie_expiration'];
|
|
3870
3872
|
this.set_disabled(config['disable_persistence']);
|
|
@@ -4008,7 +4010,7 @@ MixpanelPersistence.prototype._add_to_people_queue = function(queue, data) {
|
|
|
4008
4010
|
};
|
|
4009
4011
|
|
|
4010
4012
|
MixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {
|
|
4011
|
-
var q = this.
|
|
4013
|
+
var q = this['props'][this._get_queue_key(queue)];
|
|
4012
4014
|
if (!_.isUndefined(q)) {
|
|
4013
4015
|
_.each(data, function(v, k) {
|
|
4014
4016
|
if (queue === APPEND_ACTION || queue === REMOVE_ACTION) {
|
|
@@ -4024,11 +4026,13 @@ MixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {
|
|
|
4024
4026
|
delete q[k];
|
|
4025
4027
|
}
|
|
4026
4028
|
}, this);
|
|
4027
|
-
|
|
4028
|
-
this.save();
|
|
4029
4029
|
}
|
|
4030
4030
|
};
|
|
4031
4031
|
|
|
4032
|
+
MixpanelPersistence.prototype.load_queue = function(queue) {
|
|
4033
|
+
return this.load_prop(this._get_queue_key(queue));
|
|
4034
|
+
};
|
|
4035
|
+
|
|
4032
4036
|
MixpanelPersistence.prototype._get_queue_key = function(queue) {
|
|
4033
4037
|
if (queue === SET_ACTION) {
|
|
4034
4038
|
return SET_QUEUE_KEY;
|
|
@@ -4049,25 +4053,21 @@ MixpanelPersistence.prototype._get_queue_key = function(queue) {
|
|
|
4049
4053
|
}
|
|
4050
4054
|
};
|
|
4051
4055
|
|
|
4052
|
-
MixpanelPersistence.prototype._get_queue = function(queue) {
|
|
4053
|
-
return this['props'][this._get_queue_key(queue)];
|
|
4054
|
-
};
|
|
4055
4056
|
MixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) {
|
|
4056
4057
|
var key = this._get_queue_key(queue);
|
|
4057
4058
|
default_val = _.isUndefined(default_val) ? {} : default_val;
|
|
4058
|
-
|
|
4059
4059
|
return this['props'][key] || (this['props'][key] = default_val);
|
|
4060
4060
|
};
|
|
4061
4061
|
|
|
4062
4062
|
MixpanelPersistence.prototype.set_event_timer = function(event_name, timestamp) {
|
|
4063
|
-
var timers = this
|
|
4063
|
+
var timers = this.load_prop(EVENT_TIMERS_KEY) || {};
|
|
4064
4064
|
timers[event_name] = timestamp;
|
|
4065
4065
|
this['props'][EVENT_TIMERS_KEY] = timers;
|
|
4066
4066
|
this.save();
|
|
4067
4067
|
};
|
|
4068
4068
|
|
|
4069
4069
|
MixpanelPersistence.prototype.remove_event_timer = function(event_name) {
|
|
4070
|
-
var timers = this
|
|
4070
|
+
var timers = this.load_prop(EVENT_TIMERS_KEY) || {};
|
|
4071
4071
|
var timestamp = timers[event_name];
|
|
4072
4072
|
if (!_.isUndefined(timestamp)) {
|
|
4073
4073
|
delete this['props'][EVENT_TIMERS_KEY][event_name];
|
|
@@ -4138,11 +4138,18 @@ if (navigator['sendBeacon']) {
|
|
|
4138
4138
|
};
|
|
4139
4139
|
}
|
|
4140
4140
|
|
|
4141
|
+
var DEFAULT_API_ROUTES = {
|
|
4142
|
+
'track': 'track/',
|
|
4143
|
+
'engage': 'engage/',
|
|
4144
|
+
'groups': 'groups/'
|
|
4145
|
+
};
|
|
4146
|
+
|
|
4141
4147
|
/*
|
|
4142
4148
|
* Module-level globals
|
|
4143
4149
|
*/
|
|
4144
4150
|
var DEFAULT_CONFIG = {
|
|
4145
4151
|
'api_host': 'https://api-js.mixpanel.com',
|
|
4152
|
+
'api_routes': DEFAULT_API_ROUTES,
|
|
4146
4153
|
'api_method': 'POST',
|
|
4147
4154
|
'api_transport': 'XHR',
|
|
4148
4155
|
'api_payload_format': PAYLOAD_TYPE_BASE64,
|
|
@@ -4341,6 +4348,10 @@ MixpanelLib.prototype._init = function(token, config, name) {
|
|
|
4341
4348
|
if (!_.localStorage.is_supported(true) || !USE_XHR) {
|
|
4342
4349
|
this._batch_requests = false;
|
|
4343
4350
|
console.log('Turning off Mixpanel request-queueing; needs XHR and localStorage support');
|
|
4351
|
+
_.each(this.get_batcher_configs(), function(batcher_config) {
|
|
4352
|
+
console.log('Clearing batch queue ' + batcher_config.queue_key);
|
|
4353
|
+
_.localStorage.remove(batcher_config.queue_key);
|
|
4354
|
+
});
|
|
4344
4355
|
} else {
|
|
4345
4356
|
this.init_batchers();
|
|
4346
4357
|
if (sendBeacon && window$1.addEventListener) {
|
|
@@ -4688,12 +4699,22 @@ MixpanelLib.prototype.are_batchers_initialized = function() {
|
|
|
4688
4699
|
return !!this.request_batchers.events;
|
|
4689
4700
|
};
|
|
4690
4701
|
|
|
4702
|
+
MixpanelLib.prototype.get_batcher_configs = function() {
|
|
4703
|
+
var queue_prefix = '__mpq_' + this.get_config('token');
|
|
4704
|
+
var api_routes = this.get_config('api_routes');
|
|
4705
|
+
this._batcher_configs = this._batcher_configs || {
|
|
4706
|
+
events: {type: 'events', endpoint: '/' + api_routes['track'], queue_key: queue_prefix + '_ev'},
|
|
4707
|
+
people: {type: 'people', endpoint: '/' + api_routes['engage'], queue_key: queue_prefix + '_pp'},
|
|
4708
|
+
groups: {type: 'groups', endpoint: '/' + api_routes['groups'], queue_key: queue_prefix + '_gr'}
|
|
4709
|
+
};
|
|
4710
|
+
return this._batcher_configs;
|
|
4711
|
+
};
|
|
4712
|
+
|
|
4691
4713
|
MixpanelLib.prototype.init_batchers = function() {
|
|
4692
|
-
var token = this.get_config('token');
|
|
4693
4714
|
if (!this.are_batchers_initialized()) {
|
|
4694
4715
|
var batcher_for = _.bind(function(attrs) {
|
|
4695
4716
|
return new RequestBatcher(
|
|
4696
|
-
|
|
4717
|
+
attrs.queue_key,
|
|
4697
4718
|
{
|
|
4698
4719
|
libConfig: this['config'],
|
|
4699
4720
|
sendRequestFunc: _.bind(function(data, options, cb) {
|
|
@@ -4712,10 +4733,11 @@ MixpanelLib.prototype.init_batchers = function() {
|
|
|
4712
4733
|
}
|
|
4713
4734
|
);
|
|
4714
4735
|
}, this);
|
|
4736
|
+
var batcher_configs = this.get_batcher_configs();
|
|
4715
4737
|
this.request_batchers = {
|
|
4716
|
-
events: batcher_for(
|
|
4717
|
-
people: batcher_for(
|
|
4718
|
-
groups: batcher_for(
|
|
4738
|
+
events: batcher_for(batcher_configs.events),
|
|
4739
|
+
people: batcher_for(batcher_configs.people),
|
|
4740
|
+
groups: batcher_for(batcher_configs.groups)
|
|
4719
4741
|
};
|
|
4720
4742
|
}
|
|
4721
4743
|
if (this.get_config('batch_autostart')) {
|
|
@@ -4724,6 +4746,7 @@ MixpanelLib.prototype.init_batchers = function() {
|
|
|
4724
4746
|
};
|
|
4725
4747
|
|
|
4726
4748
|
MixpanelLib.prototype.start_batch_senders = function() {
|
|
4749
|
+
this._batchers_were_started = true;
|
|
4727
4750
|
if (this.are_batchers_initialized()) {
|
|
4728
4751
|
this._batch_requests = true;
|
|
4729
4752
|
_.each(this.request_batchers, function(batcher) {
|
|
@@ -4875,7 +4898,7 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
|
|
|
4875
4898
|
}
|
|
4876
4899
|
|
|
4877
4900
|
// set defaults
|
|
4878
|
-
properties =
|
|
4901
|
+
properties = _.extend({}, properties);
|
|
4879
4902
|
properties['token'] = this.get_config('token');
|
|
4880
4903
|
|
|
4881
4904
|
// set $duration if time_event was previously called for this event
|
|
@@ -4921,7 +4944,7 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
|
|
|
4921
4944
|
var ret = this._track_or_batch({
|
|
4922
4945
|
type: 'events',
|
|
4923
4946
|
data: data,
|
|
4924
|
-
endpoint: this.get_config('api_host') + '/track
|
|
4947
|
+
endpoint: this.get_config('api_host') + '/' + this.get_config('api_routes')['track'],
|
|
4925
4948
|
batcher: this.request_batchers.events,
|
|
4926
4949
|
should_send_immediately: should_send_immediately,
|
|
4927
4950
|
send_request_options: options
|
|
@@ -4967,13 +4990,14 @@ MixpanelLib.prototype.set_group = addOptOutCheckMixpanelLib(function(group_key,
|
|
|
4967
4990
|
*/
|
|
4968
4991
|
MixpanelLib.prototype.add_group = addOptOutCheckMixpanelLib(function(group_key, group_id, callback) {
|
|
4969
4992
|
var old_values = this.get_property(group_key);
|
|
4993
|
+
var prop = {};
|
|
4970
4994
|
if (old_values === undefined) {
|
|
4971
|
-
var prop = {};
|
|
4972
4995
|
prop[group_key] = [group_id];
|
|
4973
4996
|
this.register(prop);
|
|
4974
4997
|
} else {
|
|
4975
4998
|
if (old_values.indexOf(group_id) === -1) {
|
|
4976
4999
|
old_values.push(group_id);
|
|
5000
|
+
prop[group_key] = old_values;
|
|
4977
5001
|
this.register(prop);
|
|
4978
5002
|
}
|
|
4979
5003
|
}
|
|
@@ -5518,6 +5542,16 @@ MixpanelLib.prototype.name_tag = function(name_tag) {
|
|
|
5518
5542
|
* The default config is:
|
|
5519
5543
|
*
|
|
5520
5544
|
* {
|
|
5545
|
+
* // host for requests (customizable for e.g. a local proxy)
|
|
5546
|
+
* api_host: 'https://api-js.mixpanel.com',
|
|
5547
|
+
*
|
|
5548
|
+
* // endpoints for different types of requests
|
|
5549
|
+
* api_routes: {
|
|
5550
|
+
* track: 'track/',
|
|
5551
|
+
* engage: 'engage/',
|
|
5552
|
+
* groups: 'groups/',
|
|
5553
|
+
* }
|
|
5554
|
+
*
|
|
5521
5555
|
* // HTTP method for tracking requests
|
|
5522
5556
|
* api_method: 'POST'
|
|
5523
5557
|
*
|
|
@@ -5701,7 +5735,7 @@ MixpanelLib.prototype._run_hook = function(hook_name) {
|
|
|
5701
5735
|
* @param {String} property_name The name of the super property you want to retrieve
|
|
5702
5736
|
*/
|
|
5703
5737
|
MixpanelLib.prototype.get_property = function(property_name) {
|
|
5704
|
-
return this['persistence'][
|
|
5738
|
+
return this['persistence'].load_prop([property_name]);
|
|
5705
5739
|
};
|
|
5706
5740
|
|
|
5707
5741
|
MixpanelLib.prototype.toString = function() {
|
|
@@ -5774,9 +5808,13 @@ MixpanelLib.prototype._gdpr_update_persistence = function(options) {
|
|
|
5774
5808
|
}
|
|
5775
5809
|
|
|
5776
5810
|
if (disabled) {
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5811
|
+
this.stop_batch_senders();
|
|
5812
|
+
} else {
|
|
5813
|
+
// only start batchers after opt-in if they have previously been started
|
|
5814
|
+
// in order to avoid unintentionally starting up batching for the first time
|
|
5815
|
+
if (this._batchers_were_started) {
|
|
5816
|
+
this.start_batch_senders();
|
|
5817
|
+
}
|
|
5780
5818
|
}
|
|
5781
5819
|
};
|
|
5782
5820
|
|
|
@@ -5978,37 +6016,38 @@ MixpanelLib.prototype.report_error = function(msg, err) {
|
|
|
5978
6016
|
// EXPORTS (for closure compiler)
|
|
5979
6017
|
|
|
5980
6018
|
// MixpanelLib Exports
|
|
5981
|
-
MixpanelLib.prototype['init']
|
|
5982
|
-
MixpanelLib.prototype['reset']
|
|
5983
|
-
MixpanelLib.prototype['disable']
|
|
5984
|
-
MixpanelLib.prototype['time_event']
|
|
5985
|
-
MixpanelLib.prototype['track']
|
|
5986
|
-
MixpanelLib.prototype['track_links']
|
|
5987
|
-
MixpanelLib.prototype['track_forms']
|
|
5988
|
-
MixpanelLib.prototype['track_pageview']
|
|
5989
|
-
MixpanelLib.prototype['register']
|
|
5990
|
-
MixpanelLib.prototype['register_once']
|
|
5991
|
-
MixpanelLib.prototype['unregister']
|
|
5992
|
-
MixpanelLib.prototype['identify']
|
|
5993
|
-
MixpanelLib.prototype['alias']
|
|
5994
|
-
MixpanelLib.prototype['name_tag']
|
|
5995
|
-
MixpanelLib.prototype['set_config']
|
|
5996
|
-
MixpanelLib.prototype['get_config']
|
|
5997
|
-
MixpanelLib.prototype['get_property']
|
|
5998
|
-
MixpanelLib.prototype['get_distinct_id']
|
|
5999
|
-
MixpanelLib.prototype['toString']
|
|
6000
|
-
MixpanelLib.prototype['opt_out_tracking']
|
|
6001
|
-
MixpanelLib.prototype['opt_in_tracking']
|
|
6002
|
-
MixpanelLib.prototype['has_opted_out_tracking']
|
|
6003
|
-
MixpanelLib.prototype['has_opted_in_tracking']
|
|
6004
|
-
MixpanelLib.prototype['clear_opt_in_out_tracking']
|
|
6005
|
-
MixpanelLib.prototype['get_group']
|
|
6006
|
-
MixpanelLib.prototype['set_group']
|
|
6007
|
-
MixpanelLib.prototype['add_group']
|
|
6008
|
-
MixpanelLib.prototype['remove_group']
|
|
6009
|
-
MixpanelLib.prototype['track_with_groups']
|
|
6010
|
-
MixpanelLib.prototype['start_batch_senders']
|
|
6011
|
-
MixpanelLib.prototype['stop_batch_senders']
|
|
6019
|
+
MixpanelLib.prototype['init'] = MixpanelLib.prototype.init;
|
|
6020
|
+
MixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;
|
|
6021
|
+
MixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;
|
|
6022
|
+
MixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;
|
|
6023
|
+
MixpanelLib.prototype['track'] = MixpanelLib.prototype.track;
|
|
6024
|
+
MixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;
|
|
6025
|
+
MixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;
|
|
6026
|
+
MixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;
|
|
6027
|
+
MixpanelLib.prototype['register'] = MixpanelLib.prototype.register;
|
|
6028
|
+
MixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;
|
|
6029
|
+
MixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;
|
|
6030
|
+
MixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;
|
|
6031
|
+
MixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;
|
|
6032
|
+
MixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;
|
|
6033
|
+
MixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;
|
|
6034
|
+
MixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;
|
|
6035
|
+
MixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;
|
|
6036
|
+
MixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;
|
|
6037
|
+
MixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;
|
|
6038
|
+
MixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;
|
|
6039
|
+
MixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;
|
|
6040
|
+
MixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;
|
|
6041
|
+
MixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;
|
|
6042
|
+
MixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;
|
|
6043
|
+
MixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;
|
|
6044
|
+
MixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;
|
|
6045
|
+
MixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;
|
|
6046
|
+
MixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;
|
|
6047
|
+
MixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;
|
|
6048
|
+
MixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;
|
|
6049
|
+
MixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;
|
|
6050
|
+
MixpanelLib.prototype['DEFAULT_API_ROUTES'] = DEFAULT_API_ROUTES;
|
|
6012
6051
|
|
|
6013
6052
|
// MixpanelPersistence Exports
|
|
6014
6053
|
MixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;
|