@amplitude/analytics-browser 2.31.4 → 2.32.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/README.md CHANGED
@@ -53,7 +53,7 @@ This SDK is also available through CDN. Copy the script loader below and paste b
53
53
  <!-- README_SNIPPET_BLOCK -->
54
54
  ```html
55
55
  <script type="text/javascript">
56
- !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};!function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})}(e,t,Array.prototype.slice.call(arguments))}},o=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<y.length;r++)i(e,y[r],!0)};r.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-kTFm1dxq39lii4g6VPQEaLZpE5MljaaaxzE5OMraW8ig6xL6umJ3QDFL/9kLsPw6",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-2.31.4-min.js.gz",a.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(a,c);for(var u=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],p=0;p<l.length;p++)n(u,l[p]);r.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],v=0;v<f.length;v++)n(d,f[v]);r.Revenue=d;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];o(r),r.createInstance=function(e){return r._iq[e]={_q:[]},o(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
56
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};!function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})}(e,t,Array.prototype.slice.call(arguments))}},o=function(e){for(var t=0;t<y.length;t++)i(e,y[t],!1);for(var r=0;r<g.length;r++)i(e,g[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-hZ3s3uB8PfU4QYbgXXtU9kEy7lt8i7kRKIWzbVjnS//GQSyv42iEVDEniwLASsSh",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.32.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var a=t.getElementsByTagName("script")[0];a.parentNode.insertBefore(c,a);for(var u=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],p=0;p<l.length;p++)n(u,l[p]);r.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],v=0;v<f.length;v++)n(d,f[v]);r.Revenue=d;var y=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];o(r),r.createInstance=function(e){return r._iq[e]={_q:[]},o(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
57
57
 
58
58
  amplitude.init("<YOUR_API_KEY>");
59
59
  </script>
@@ -36,7 +36,7 @@ export declare class BrowserConfig extends Config implements IBrowserConfig {
36
36
  diagnosticsSampleRate: number;
37
37
  diagnosticsClient?: IDiagnosticsClient | undefined;
38
38
  remoteConfig?: RemoteConfigOptions | undefined;
39
- readonly version = "2.31.4";
39
+ readonly version = "2.32.0";
40
40
  protected _cookieStorage: Storage<UserSession>;
41
41
  protected _deviceId?: string;
42
42
  protected _lastEventId?: number;
@@ -5,6 +5,19 @@ var analytics_core_1 = require("@amplitude/analytics-core");
5
5
  var amplitude = tslib_1.__importStar(require("./index"));
6
6
  var browser_client_factory_1 = require("./browser-client-factory");
7
7
  var snippet_helper_1 = require("./utils/snippet-helper");
8
+ (0, analytics_core_1.registerSdkLoaderMetadata)({
9
+ scriptUrl: resolveCurrentScriptUrl(),
10
+ });
11
+ function resolveCurrentScriptUrl() {
12
+ if (typeof document === 'undefined') {
13
+ return undefined;
14
+ }
15
+ var currentScript = document.currentScript;
16
+ if (currentScript === null || currentScript === void 0 ? void 0 : currentScript.src) {
17
+ return currentScript.src;
18
+ }
19
+ return undefined;
20
+ }
8
21
  // https://developer.mozilla.org/en-US/docs/Glossary/IIFE
9
22
  (function () {
10
23
  var GlobalScope = (0, analytics_core_1.getGlobalScope)();
@@ -1 +1 @@
1
- {"version":3,"file":"snippet-index.js","sourceRoot":"","sources":["../../src/snippet-index.ts"],"names":[],"mappings":";;;AAAA,4DAA2D;AAC3D,yDAAqC;AACrC,mEAA0D;AAC1D,yDAA4D;AAE5D,yDAAyD;AACzD,CAAC;IACC,IAAM,WAAW,GAAG,IAAA,+BAAc,GAAE,CAAC;IAErC,IAAI,CAAC,WAAW,EAAE;QAChB,OA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QAAQ,CAAC,EAAE,CAAC;YAC1B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;YACjB,IAAA,mCAAkB,EAAC,QAAQ,EAAE,OAAK,CAAC,CAAC;SACrC;KACF;AACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import { getGlobalScope } from '@amplitude/analytics-core';\nimport * as amplitude from './index';\nimport { createInstance } from './browser-client-factory';\nimport { runQueuedFunctions } from './utils/snippet-helper';\n\n// https://developer.mozilla.org/en-US/docs/Glossary/IIFE\n(function () {\n const GlobalScope = getGlobalScope();\n\n if (!GlobalScope) {\n console.error('[Amplitude] Error: GlobalScope is not defined');\n return;\n }\n\n const createNamedInstance = (instanceName?: string) => {\n const instance = createInstance();\n const GlobalScope = getGlobalScope();\n if (GlobalScope && GlobalScope.amplitude && GlobalScope.amplitude._iq && instanceName) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n GlobalScope.amplitude._iq[instanceName] = instance;\n }\n return instance;\n };\n\n GlobalScope.amplitude = Object.assign(GlobalScope.amplitude || {}, amplitude, {\n createInstance: createNamedInstance,\n });\n\n if (GlobalScope.amplitude.invoked) {\n const queue = GlobalScope.amplitude._q;\n GlobalScope.amplitude._q = [];\n runQueuedFunctions(amplitude, queue);\n\n const instanceNames = Object.keys(GlobalScope.amplitude._iq) || [];\n for (let i = 0; i < instanceNames.length; i++) {\n const instanceName = instanceNames[i];\n const instance = Object.assign(GlobalScope.amplitude._iq[instanceName], createNamedInstance(instanceName));\n const queue = instance._q;\n instance._q = [];\n runQueuedFunctions(instance, queue);\n }\n }\n})();\n"]}
1
+ {"version":3,"file":"snippet-index.js","sourceRoot":"","sources":["../../src/snippet-index.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AACtF,yDAAqC;AACrC,mEAA0D;AAC1D,yDAA4D;AAE5D,IAAA,0CAAyB,EAAC;IACxB,SAAS,EAAE,uBAAuB,EAAE;CACrC,CAAC,CAAC;AAEH,SAAS,uBAAuB;IA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WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;YACtC,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3G,IAAM,OAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;YAC1B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;YACjB,IAAA,mCAAkB,EAAC,QAAQ,EAAE,OAAK,CAAC,CAAC;SACrC;KACF;AACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import { getGlobalScope, registerSdkLoaderMetadata } from '@amplitude/analytics-core';\nimport * as amplitude from './index';\nimport { createInstance } from './browser-client-factory';\nimport { runQueuedFunctions } from './utils/snippet-helper';\n\nregisterSdkLoaderMetadata({\n scriptUrl: resolveCurrentScriptUrl(),\n});\n\nfunction resolveCurrentScriptUrl(): string | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const currentScript = document.currentScript as HTMLScriptElement | null;\n if (currentScript?.src) {\n return currentScript.src;\n }\n\n return undefined;\n}\n\n// https://developer.mozilla.org/en-US/docs/Glossary/IIFE\n(function () {\n const GlobalScope = getGlobalScope();\n\n if (!GlobalScope) {\n console.error('[Amplitude] Error: GlobalScope is not defined');\n return;\n }\n\n const createNamedInstance = (instanceName?: string) => {\n const instance = createInstance();\n const GlobalScope = getGlobalScope();\n if (GlobalScope && GlobalScope.amplitude && GlobalScope.amplitude._iq && instanceName) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n GlobalScope.amplitude._iq[instanceName] = instance;\n }\n return instance;\n };\n\n GlobalScope.amplitude = Object.assign(GlobalScope.amplitude || {}, amplitude, {\n createInstance: createNamedInstance,\n });\n\n if (GlobalScope.amplitude.invoked) {\n const queue = GlobalScope.amplitude._q;\n GlobalScope.amplitude._q = [];\n runQueuedFunctions(amplitude, queue);\n\n const instanceNames = Object.keys(GlobalScope.amplitude._iq) || [];\n for (let i = 0; i < instanceNames.length; i++) {\n const instanceName = instanceNames[i];\n const instance = Object.assign(GlobalScope.amplitude._iq[instanceName], createNamedInstance(instanceName));\n const queue = instance._q;\n instance._q = [];\n runQueuedFunctions(instance, queue);\n }\n }\n})();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.31.4";
1
+ export declare const VERSION = "2.32.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.31.4';
4
+ exports.VERSION = '2.32.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '2.31.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '2.32.0';\n"]}
@@ -36,7 +36,7 @@ export declare class BrowserConfig extends Config implements IBrowserConfig {
36
36
  diagnosticsSampleRate: number;
37
37
  diagnosticsClient?: IDiagnosticsClient | undefined;
38
38
  remoteConfig?: RemoteConfigOptions | undefined;
39
- readonly version = "2.31.4";
39
+ readonly version = "2.32.0";
40
40
  protected _cookieStorage: Storage<UserSession>;
41
41
  protected _deviceId?: string;
42
42
  protected _lastEventId?: number;
@@ -1,7 +1,20 @@
1
- import { getGlobalScope } from '@amplitude/analytics-core';
1
+ import { getGlobalScope, registerSdkLoaderMetadata } from '@amplitude/analytics-core';
2
2
  import * as amplitude from './index';
3
3
  import { createInstance } from './browser-client-factory';
4
4
  import { runQueuedFunctions } from './utils/snippet-helper';
5
+ registerSdkLoaderMetadata({
6
+ scriptUrl: resolveCurrentScriptUrl(),
7
+ });
8
+ function resolveCurrentScriptUrl() {
9
+ if (typeof document === 'undefined') {
10
+ return undefined;
11
+ }
12
+ var currentScript = document.currentScript;
13
+ if (currentScript === null || currentScript === void 0 ? void 0 : currentScript.src) {
14
+ return currentScript.src;
15
+ }
16
+ return undefined;
17
+ }
5
18
  // https://developer.mozilla.org/en-US/docs/Glossary/IIFE
6
19
  (function () {
7
20
  var GlobalScope = getGlobalScope();
@@ -1 +1 @@
1
- {"version":3,"file":"snippet-index.js","sourceRoot":"","sources":["../../src/snippet-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,yDAAyD;AACzD,CAAC;IACC,IAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAC/D,OAAO;KACR;IAED,IAAM,mBAAmB,GAAG,UAAC,YAAqB;QAChD,IAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;QAClC,IAAM,WAAW,GAAG,cAAc,EAAE,CAAC;QACrC,IAAI,WAAW,IAAI,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,YAAY,EAAE;YACrF,6DAA6D;YAC7D,aAAa;YACb,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;SACpD;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;IAEF,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,EAAE,SAAS,EAAE;QAC5E,cAAc,EAAE,mBAAmB;KACpC,CAAC,CAAC;IAEH,IAAI,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE;QACjC,IAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;QAC9B,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAErC,IAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;YACtC,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3G,IAAM,OAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;YAC1B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;YACjB,kBAAkB,CAAC,QAAQ,EAAE,OAAK,CAAC,CAAC;SACrC;KACF;AACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import { getGlobalScope } from '@amplitude/analytics-core';\nimport * as amplitude from './index';\nimport { createInstance } from './browser-client-factory';\nimport { runQueuedFunctions } from './utils/snippet-helper';\n\n// https://developer.mozilla.org/en-US/docs/Glossary/IIFE\n(function () {\n const GlobalScope = getGlobalScope();\n\n if (!GlobalScope) {\n console.error('[Amplitude] Error: GlobalScope is not defined');\n return;\n }\n\n const createNamedInstance = (instanceName?: string) => {\n const instance = createInstance();\n const GlobalScope = getGlobalScope();\n if (GlobalScope && GlobalScope.amplitude && GlobalScope.amplitude._iq && instanceName) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n GlobalScope.amplitude._iq[instanceName] = instance;\n }\n return instance;\n };\n\n GlobalScope.amplitude = Object.assign(GlobalScope.amplitude || {}, amplitude, {\n createInstance: createNamedInstance,\n });\n\n if (GlobalScope.amplitude.invoked) {\n const queue = GlobalScope.amplitude._q;\n GlobalScope.amplitude._q = [];\n runQueuedFunctions(amplitude, queue);\n\n const instanceNames = Object.keys(GlobalScope.amplitude._iq) || [];\n for (let i = 0; i < instanceNames.length; i++) {\n const instanceName = instanceNames[i];\n const instance = Object.assign(GlobalScope.amplitude._iq[instanceName], createNamedInstance(instanceName));\n const queue = instance._q;\n instance._q = [];\n runQueuedFunctions(instance, queue);\n }\n }\n})();\n"]}
1
+ {"version":3,"file":"snippet-index.js","sourceRoot":"","sources":["../../src/snippet-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,yBAAyB,CAAC;IACxB,SAAS,EAAE,uBAAuB,EAAE;CACrC,CAAC,CAAC;AAEH,SAAS,uBAAuB;IAC9B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnC,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,aAAa,GAAG,QAAQ,CAAC,aAAyC,CAAC;IACzE,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,GAAG,EAAE;QACtB,OAAO,aAAa,CAAC,GAAG,CAAC;KAC1B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,yDAAyD;AACzD,CA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BAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3G,IAAM,OAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;YAC1B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;YACjB,kBAAkB,CAAC,QAAQ,EAAE,OAAK,CAAC,CAAC;SACrC;KACF;AACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import { getGlobalScope, registerSdkLoaderMetadata } from '@amplitude/analytics-core';\nimport * as amplitude from './index';\nimport { createInstance } from './browser-client-factory';\nimport { runQueuedFunctions } from './utils/snippet-helper';\n\nregisterSdkLoaderMetadata({\n scriptUrl: resolveCurrentScriptUrl(),\n});\n\nfunction resolveCurrentScriptUrl(): string | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const currentScript = document.currentScript as HTMLScriptElement | null;\n if (currentScript?.src) {\n return currentScript.src;\n }\n\n return undefined;\n}\n\n// https://developer.mozilla.org/en-US/docs/Glossary/IIFE\n(function () {\n const GlobalScope = getGlobalScope();\n\n if (!GlobalScope) {\n console.error('[Amplitude] Error: GlobalScope is not defined');\n return;\n }\n\n const createNamedInstance = (instanceName?: string) => {\n const instance = createInstance();\n const GlobalScope = getGlobalScope();\n if (GlobalScope && GlobalScope.amplitude && GlobalScope.amplitude._iq && instanceName) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n GlobalScope.amplitude._iq[instanceName] = instance;\n }\n return instance;\n };\n\n GlobalScope.amplitude = Object.assign(GlobalScope.amplitude || {}, amplitude, {\n createInstance: createNamedInstance,\n });\n\n if (GlobalScope.amplitude.invoked) {\n const queue = GlobalScope.amplitude._q;\n GlobalScope.amplitude._q = [];\n runQueuedFunctions(amplitude, queue);\n\n const instanceNames = Object.keys(GlobalScope.amplitude._iq) || [];\n for (let i = 0; i < instanceNames.length; i++) {\n const instanceName = instanceNames[i];\n const instance = Object.assign(GlobalScope.amplitude._iq[instanceName], createNamedInstance(instanceName));\n const queue = instance._q;\n instance._q = [];\n runQueuedFunctions(instance, queue);\n }\n }\n})();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.31.4";
1
+ export declare const VERSION = "2.32.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export var VERSION = '2.31.4';
1
+ export var VERSION = '2.32.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '2.31.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '2.32.0';\n"]}
@@ -1 +1 @@
1
- !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},i=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(i(e,t,Array.prototype.slice.call(arguments)))}}},s=function(e){for(var t=0;t<v.length;t++)o(e,v[t],!1);for(var r=0;r<y.length;r++)o(e,y[r],!0)};r.invoked=!0;var a=t.getElementsByTagName("script")[0],u=t.createElement("script");u.src="https://cdn.amplitude.com/libs/plugin-autocapture-browser-0.9.0-min.js.gz",u.async=!1,a.parentNode.insertBefore(u,a);var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-kTFm1dxq39lii4g6VPQEaLZpE5MljaaaxzE5OMraW8ig6xL6umJ3QDFL/9kLsPw6",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.31.4-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),e.amplitude.init("YOUR_API_KEY","YOUR_USER_ID",{instanceName:"amplitude-bookmarklet",serverZone:"YOUR_SERVER_ZONE",ingestionMetadata:{sourceName:"browser-typescript-bookmarklet",sourceVersion:"1.0.0"},optOut:!1}),amplitudeAutocapturePlugin&&amplitudeAutocapturePlugin.autocapturePlugin&&"function"==typeof amplitudeAutocapturePlugin.autocapturePlugin&&e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin()),alert("Amplitude is now tracking events!")},a.parentNode.insertBefore(c,a);for(var p=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<l.length;d++)n(p,l[d]);r.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],f=0;f<g.length;f++)n(m,g[f]);r.Revenue=m;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];s(r),r.createInstance=function(e){return r._iq[e]={_q:[]},s(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
1
+ !function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:{}};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var r=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},i=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},s=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(i(e,t,Array.prototype.slice.call(arguments)))}}},o=function(e){for(var t=0;t<v.length;t++)s(e,v[t],!1);for(var n=0;n<y.length;n++)s(e,y[n],!0)};n.invoked=!0;var u=t.getElementsByTagName("script")[0],a=t.createElement("script");a.src="https://cdn.amplitude.com/libs/plugin-autocapture-browser-0.9.0-min.js.gz",a.async=!1,u.parentNode.insertBefore(a,u);var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-hZ3s3uB8PfU4QYbgXXtU9kEy7lt8i7kRKIWzbVjnS//GQSyv42iEVDEniwLASsSh",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.32.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),e.amplitude.init("YOUR_API_KEY","YOUR_USER_ID",{instanceName:"amplitude-bookmarklet",serverZone:"YOUR_SERVER_ZONE",ingestionMetadata:{sourceName:"browser-typescript-bookmarklet",sourceVersion:"1.0.0"},optOut:!1}),amplitudeAutocapturePlugin&&amplitudeAutocapturePlugin.autocapturePlugin&&"function"==typeof amplitudeAutocapturePlugin.autocapturePlugin&&e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin()),alert("Amplitude is now tracking events!")},u.parentNode.insertBefore(c,u);for(var p=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<l.length;d++)r(p,l[d]);n.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],f=0;f<g.length;f++)r(m,g[f]);n.Revenue=m;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];o(n),n.createInstance=function(e){return n._iq[e]={_q:[]},o(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
@@ -1 +1 @@
1
- javascript:!function()%7B%22use%20strict%22%3B!function(e%2Ct)%7Bvar%20r%3De.amplitude%7C%7C%7B_q%3A%5B%5D%2C_iq%3A%7B%7D%7D%3Bif(r.invoked)e.console%26%26console.error%26%26console.error(%22Amplitude%20snippet%20has%20been%20loaded.%22)%3Belse%7Bvar%20n%3Dfunction(e%2Ct)%7Be.prototype%5Bt%5D%3Dfunction()%7Breturn%20this._q.push(%7Bname%3At%2Cargs%3AArray.prototype.slice.call(arguments%2C0)%7D)%2Cthis%7D%7D%2Ci%3Dfunction(e%2Ct%2Cr)%7Breturn%20function(n)%7Be._q.push(%7Bname%3At%2Cargs%3AArray.prototype.slice.call(r%2C0)%2Cresolve%3An%7D)%7D%7D%2Co%3Dfunction(e%2Ct%2Cr)%7Be%5Bt%5D%3Dfunction()%7Bif(r)return%7Bpromise%3Anew%20Promise(i(e%2Ct%2CArray.prototype.slice.call(arguments)))%7D%7D%7D%2Cs%3Dfunction(e)%7Bfor(var%20t%3D0%3Bt%3Cv.length%3Bt%2B%2B)o(e%2Cv%5Bt%5D%2C!1)%3Bfor(var%20r%3D0%3Br%3Cy.length%3Br%2B%2B)o(e%2Cy%5Br%5D%2C!0)%7D%3Br.invoked%3D!0%3Bvar%20a%3Dt.getElementsByTagName(%22script%22)%5B0%5D%2Cu%3Dt.createElement(%22script%22)%3Bu.src%3D%22https%3A%2F%2Fcdn.amplitude.com%2Flibs%2Fplugin-autocapture-browser-0.9.0-min.js.gz%22%2Cu.async%3D!1%2Ca.parentNode.insertBefore(u%2Ca)%3Bvar%20c%3Dt.createElement(%22script%22)%3Bc.type%3D%22text%2Fjavascript%22%2Cc.integrity%3D%22sha384-kTFm1dxq39lii4g6VPQEaLZpE5MljaaaxzE5OMraW8ig6xL6umJ3QDFL%2F9kLsPw6%22%2Cc.crossOrigin%3D%22anonymous%22%2Cc.async%3D!1%2Cc.src%3D%22https%3A%2F%2Fcdn.amplitude.com%2Flibs%2Fanalytics-browser-2.31.4-min.js.gz%22%2Cc.onload%3Dfunction()%7Be.amplitude.runQueuedFunctions%7C%7Cconsole.log(%22%5BAmplitude%5D%20Error%3A%20could%20not%20load%20SDK%22)%2Ce.amplitude.init(%22YOUR_API_KEY%22%2C%22YOUR_USER_ID%22%2C%7BinstanceName%3A%22amplitude-bookmarklet%22%2CserverZone%3A%22YOUR_SERVER_ZONE%22%2CingestionMetadata%3A%7BsourceName%3A%22browser-typescript-bookmarklet%22%2CsourceVersion%3A%221.0.0%22%7D%2CoptOut%3A!1%7D)%2CamplitudeAutocapturePlugin%26%26amplitudeAutocapturePlugin.autocapturePlugin%26%26%22function%22%3D%3Dtypeof%20amplitudeAutocapturePlugin.autocapturePlugin%26%26e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin())%2Calert(%22Amplitude%20is%20now%20tracking%20events!%22)%7D%2Ca.parentNode.insertBefore(c%2Ca)%3Bfor(var%20p%3Dfunction()%7Breturn%20this._q%3D%5B%5D%2Cthis%7D%2Cl%3D%5B%22add%22%2C%22append%22%2C%22clearAll%22%2C%22prepend%22%2C%22set%22%2C%22setOnce%22%2C%22unset%22%2C%22preInsert%22%2C%22postInsert%22%2C%22remove%22%2C%22getUserProperties%22%5D%2Cd%3D0%3Bd%3Cl.length%3Bd%2B%2B)n(p%2Cl%5Bd%5D)%3Br.Identify%3Dp%3Bfor(var%20m%3Dfunction()%7Breturn%20this._q%3D%5B%5D%2Cthis%7D%2Cg%3D%5B%22getEventProperties%22%2C%22setProductId%22%2C%22setQuantity%22%2C%22setPrice%22%2C%22setRevenue%22%2C%22setRevenueType%22%2C%22setReceipt%22%2C%22setReceiptSig%22%2C%22setCurrency%22%2C%22setEventProperties%22%5D%2Cf%3D0%3Bf%3Cg.length%3Bf%2B%2B)n(m%2Cg%5Bf%5D)%3Br.Revenue%3Dm%3Bvar%20v%3D%5B%22getDeviceId%22%2C%22setDeviceId%22%2C%22getSessionId%22%2C%22setSessionId%22%2C%22getUserId%22%2C%22setUserId%22%2C%22setOptOut%22%2C%22setTransport%22%2C%22reset%22%2C%22extendSession%22%5D%2Cy%3D%5B%22init%22%2C%22add%22%2C%22remove%22%2C%22track%22%2C%22logEvent%22%2C%22identify%22%2C%22groupIdentify%22%2C%22setGroup%22%2C%22revenue%22%2C%22flush%22%5D%3Bs(r)%2Cr.createInstance%3Dfunction(e)%7Breturn%20r._iq%5Be%5D%3D%7B_q%3A%5B%5D%7D%2Cs(r._iq%5Be%5D)%2Cr._iq%5Be%5D%7D%2Ce.amplitude%3Dr%7D%7D(window%2Cdocument)%7D()%3B%0A
1
+ javascript:!function()%7B%22use%20strict%22%3B!function(e%2Ct)%7Bvar%20n%3De.amplitude%7C%7C%7B_q%3A%5B%5D%2C_iq%3A%7B%7D%7D%3Bif(n.invoked)e.console%26%26console.error%26%26console.error(%22Amplitude%20snippet%20has%20been%20loaded.%22)%3Belse%7Bvar%20r%3Dfunction(e%2Ct)%7Be.prototype%5Bt%5D%3Dfunction()%7Breturn%20this._q.push(%7Bname%3At%2Cargs%3AArray.prototype.slice.call(arguments%2C0)%7D)%2Cthis%7D%7D%2Ci%3Dfunction(e%2Ct%2Cn)%7Breturn%20function(r)%7Be._q.push(%7Bname%3At%2Cargs%3AArray.prototype.slice.call(n%2C0)%2Cresolve%3Ar%7D)%7D%7D%2Cs%3Dfunction(e%2Ct%2Cn)%7Be%5Bt%5D%3Dfunction()%7Bif(n)return%7Bpromise%3Anew%20Promise(i(e%2Ct%2CArray.prototype.slice.call(arguments)))%7D%7D%7D%2Co%3Dfunction(e)%7Bfor(var%20t%3D0%3Bt%3Cv.length%3Bt%2B%2B)s(e%2Cv%5Bt%5D%2C!1)%3Bfor(var%20n%3D0%3Bn%3Cy.length%3Bn%2B%2B)s(e%2Cy%5Bn%5D%2C!0)%7D%3Bn.invoked%3D!0%3Bvar%20u%3Dt.getElementsByTagName(%22script%22)%5B0%5D%2Ca%3Dt.createElement(%22script%22)%3Ba.src%3D%22https%3A%2F%2Fcdn.amplitude.com%2Flibs%2Fplugin-autocapture-browser-0.9.0-min.js.gz%22%2Ca.async%3D!1%2Cu.parentNode.insertBefore(a%2Cu)%3Bvar%20c%3Dt.createElement(%22script%22)%3Bc.type%3D%22text%2Fjavascript%22%2Cc.integrity%3D%22sha384-hZ3s3uB8PfU4QYbgXXtU9kEy7lt8i7kRKIWzbVjnS%2F%2FGQSyv42iEVDEniwLASsSh%22%2Cc.crossOrigin%3D%22anonymous%22%2Cc.async%3D!1%2Cc.src%3D%22https%3A%2F%2Fcdn.amplitude.com%2Flibs%2Fanalytics-browser-2.32.0-min.js.gz%22%2Cc.onload%3Dfunction()%7Be.amplitude.runQueuedFunctions%7C%7Cconsole.log(%22%5BAmplitude%5D%20Error%3A%20could%20not%20load%20SDK%22)%2Ce.amplitude.init(%22YOUR_API_KEY%22%2C%22YOUR_USER_ID%22%2C%7BinstanceName%3A%22amplitude-bookmarklet%22%2CserverZone%3A%22YOUR_SERVER_ZONE%22%2CingestionMetadata%3A%7BsourceName%3A%22browser-typescript-bookmarklet%22%2CsourceVersion%3A%221.0.0%22%7D%2CoptOut%3A!1%7D)%2CamplitudeAutocapturePlugin%26%26amplitudeAutocapturePlugin.autocapturePlugin%26%26%22function%22%3D%3Dtypeof%20amplitudeAutocapturePlugin.autocapturePlugin%26%26e.amplitude.add(amplitudeAutocapturePlugin.autocapturePlugin())%2Calert(%22Amplitude%20is%20now%20tracking%20events!%22)%7D%2Cu.parentNode.insertBefore(c%2Cu)%3Bfor(var%20p%3Dfunction()%7Breturn%20this._q%3D%5B%5D%2Cthis%7D%2Cl%3D%5B%22add%22%2C%22append%22%2C%22clearAll%22%2C%22prepend%22%2C%22set%22%2C%22setOnce%22%2C%22unset%22%2C%22preInsert%22%2C%22postInsert%22%2C%22remove%22%2C%22getUserProperties%22%5D%2Cd%3D0%3Bd%3Cl.length%3Bd%2B%2B)r(p%2Cl%5Bd%5D)%3Bn.Identify%3Dp%3Bfor(var%20m%3Dfunction()%7Breturn%20this._q%3D%5B%5D%2Cthis%7D%2Cg%3D%5B%22getEventProperties%22%2C%22setProductId%22%2C%22setQuantity%22%2C%22setPrice%22%2C%22setRevenue%22%2C%22setRevenueType%22%2C%22setReceipt%22%2C%22setReceiptSig%22%2C%22setCurrency%22%2C%22setEventProperties%22%5D%2Cf%3D0%3Bf%3Cg.length%3Bf%2B%2B)r(m%2Cg%5Bf%5D)%3Bn.Revenue%3Dm%3Bvar%20v%3D%5B%22getDeviceId%22%2C%22setDeviceId%22%2C%22getSessionId%22%2C%22setSessionId%22%2C%22getUserId%22%2C%22setUserId%22%2C%22setOptOut%22%2C%22setTransport%22%2C%22reset%22%2C%22extendSession%22%5D%2Cy%3D%5B%22init%22%2C%22add%22%2C%22remove%22%2C%22track%22%2C%22logEvent%22%2C%22identify%22%2C%22groupIdentify%22%2C%22setGroup%22%2C%22revenue%22%2C%22flush%22%5D%3Bo(n)%2Cn.createInstance%3Dfunction(e)%7Breturn%20n._iq%5Be%5D%3D%7B_q%3A%5B%5D%7D%2Co(n._iq%5Be%5D)%2Cn._iq%5Be%5D%7D%2Ce.amplitude%3Dn%7D%7D(window%2Cdocument)%7D()%3B%0A