mixpanel-browser 2.55.0 → 2.55.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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/mixpanel-core.cjs.js +21 -6
- package/dist/mixpanel-recorder.js +55 -19
- package/dist/mixpanel-recorder.min.js +9 -9
- package/dist/mixpanel-with-async-recorder.cjs.js +21 -6
- package/dist/mixpanel.amd.js +56 -19
- package/dist/mixpanel.cjs.js +56 -19
- package/dist/mixpanel.globals.js +21 -6
- package/dist/mixpanel.min.js +98 -97
- package/dist/mixpanel.module.js +56 -19
- package/dist/mixpanel.umd.js +56 -19
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/mixpanel-core.js +1 -0
- package/src/recorder/index.js +34 -14
- package/src/request-batcher.js +7 -2
- package/src/utils.js +26 -13
package/src/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ if (typeof(window) === 'undefined') {
|
|
|
8
8
|
hostname: ''
|
|
9
9
|
};
|
|
10
10
|
win = {
|
|
11
|
-
navigator: { userAgent: '' },
|
|
11
|
+
navigator: { userAgent: '', onLine: true },
|
|
12
12
|
document: {
|
|
13
13
|
location: loc,
|
|
14
14
|
referrer: ''
|
|
@@ -22,6 +22,8 @@ if (typeof(window) === 'undefined') {
|
|
|
22
22
|
|
|
23
23
|
// Maximum allowed session recording length
|
|
24
24
|
var MAX_RECORDING_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
25
|
+
// Maximum allowed value for minimum session recording length
|
|
26
|
+
var MAX_VALUE_FOR_MIN_RECORDING_MS = 8 * 1000; // 8 seconds
|
|
25
27
|
|
|
26
28
|
/*
|
|
27
29
|
* Saved references to long variable names, so that closure compiler can
|
|
@@ -962,7 +964,7 @@ _.HTTPBuildQuery = function(formdata, arg_separator) {
|
|
|
962
964
|
_.getQueryParam = function(url, param) {
|
|
963
965
|
// Expects a raw URL
|
|
964
966
|
|
|
965
|
-
param = param.replace(/[[]
|
|
967
|
+
param = param.replace(/[[]/g, '\\[').replace(/[\]]/g, '\\]');
|
|
966
968
|
var regexS = '[\\?&]' + param + '=([^&#]*)',
|
|
967
969
|
regex = new RegExp(regexS),
|
|
968
970
|
results = regex.exec(url);
|
|
@@ -1419,8 +1421,8 @@ _.dom_query = (function() {
|
|
|
1419
1421
|
};
|
|
1420
1422
|
})();
|
|
1421
1423
|
|
|
1422
|
-
var CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
|
|
1423
|
-
var CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'ttclid', 'twclid', 'wbraid'];
|
|
1424
|
+
var CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'utm_id', 'utm_source_platform','utm_campaign_id', 'utm_creative_format', 'utm_marketing_tactic'];
|
|
1425
|
+
var CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'sccid', 'ttclid', 'twclid', 'wbraid'];
|
|
1424
1426
|
|
|
1425
1427
|
_.info = {
|
|
1426
1428
|
campaignParams: function(default_value) {
|
|
@@ -1702,6 +1704,15 @@ var extract_domain = function(hostname) {
|
|
|
1702
1704
|
return matches ? matches[0] : '';
|
|
1703
1705
|
};
|
|
1704
1706
|
|
|
1707
|
+
/**
|
|
1708
|
+
* Check whether we have network connection. default to true for browsers that don't support navigator.onLine (IE)
|
|
1709
|
+
* @returns {boolean}
|
|
1710
|
+
*/
|
|
1711
|
+
var isOnline = function() {
|
|
1712
|
+
var onLine = win.navigator['onLine'];
|
|
1713
|
+
return _.isUndefined(onLine) || onLine;
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1705
1716
|
var JSONStringify = null, JSONParse = null;
|
|
1706
1717
|
if (typeof JSON !== 'undefined') {
|
|
1707
1718
|
JSONStringify = JSON.stringify;
|
|
@@ -1724,18 +1735,20 @@ _['info']['browserVersion'] = _.info.browserVersion;
|
|
|
1724
1735
|
_['info']['properties'] = _.info.properties;
|
|
1725
1736
|
|
|
1726
1737
|
export {
|
|
1727
|
-
MAX_RECORDING_MS,
|
|
1728
1738
|
_,
|
|
1729
|
-
userAgent,
|
|
1730
|
-
console,
|
|
1731
|
-
win as window,
|
|
1732
|
-
document,
|
|
1733
|
-
navigator,
|
|
1734
1739
|
cheap_guid,
|
|
1735
1740
|
console_with_prefix,
|
|
1741
|
+
console,
|
|
1742
|
+
document,
|
|
1736
1743
|
extract_domain,
|
|
1737
|
-
localStorageSupported,
|
|
1738
|
-
JSONStringify,
|
|
1739
1744
|
JSONParse,
|
|
1740
|
-
|
|
1745
|
+
JSONStringify,
|
|
1746
|
+
isOnline,
|
|
1747
|
+
localStorageSupported,
|
|
1748
|
+
MAX_RECORDING_MS,
|
|
1749
|
+
MAX_VALUE_FOR_MIN_RECORDING_MS,
|
|
1750
|
+
navigator,
|
|
1751
|
+
slice,
|
|
1752
|
+
userAgent,
|
|
1753
|
+
win as window
|
|
1741
1754
|
};
|