Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/analytics-browser

Package Overview
Dependencies
Maintainers
21
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/analytics-browser - npm Package Compare versions

Comparing version 2.7.4 to 2.8.0

51

lib/cjs/browser-client.js

@@ -42,8 +42,8 @@ Object.defineProperty(exports, "__esModule", { value: true });

AmplitudeBrowser.prototype._init = function (options) {
var _a, _b;
var _a, _b, _c;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var browserOptions, attributionTrackingOptions, connector;
var browserOptions, attributionTrackingOptions, queryParams, querySessionId, connector;
var _this = this;
return tslib_1.__generator(this, function (_c) {
switch (_c.label) {
return tslib_1.__generator(this, function (_d) {
switch (_d.label) {
case 0:

@@ -57,6 +57,6 @@ // Step 1: Block concurrent initialization

case 1:
browserOptions = _c.sent();
browserOptions = _d.sent();
return [4 /*yield*/, _super.prototype._init.call(this, browserOptions)];
case 2:
_c.sent();
_d.sent();
if (!(0, analytics_client_common_1.isAttributionTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 4];

@@ -69,11 +69,10 @@ attributionTrackingOptions = (0, analytics_client_common_1.getAttributionTrackingConfig)(this.config);

// Fetch the current campaign, check if need to track web attribution later
_c.sent();
_c.label = 4;
_d.sent();
_d.label = 4;
case 4:
// Step 3: Set session ID
// Priority 1: `options.sessionId`
// Priority 2: last known sessionId from user identity storage
// Default: `Date.now()`
// Session ID is handled differently than device ID and user ID due to session events
this.setSessionId((_b = (_a = options.sessionId) !== null && _a !== void 0 ? _a : this.config.sessionId) !== null && _b !== void 0 ? _b : Date.now());
queryParams = (0, analytics_client_common_1.getQueryParams)();
querySessionId = Number.isNaN(Number(queryParams.ampSessionId))
? undefined
: Number(queryParams.ampSessionId);
this.setSessionId((_c = (_b = (_a = options.sessionId) !== null && _a !== void 0 ? _a : querySessionId) !== null && _b !== void 0 ? _b : this.config.sessionId) !== null && _c !== void 0 ? _c : Date.now());
connector = (0, analytics_client_common_1.getAnalyticsConnector)(options.instanceName);

@@ -87,13 +86,13 @@ connector.identityStore.setIdentity({

case 5:
_c.sent();
_c.label = 6;
_d.sent();
_d.label = 6;
case 6: return [4 /*yield*/, this.add(new analytics_core_1.Destination()).promise];
case 7:
_c.sent();
_d.sent();
return [4 /*yield*/, this.add(new context_1.Context()).promise];
case 8:
_c.sent();
_d.sent();
return [4 /*yield*/, this.add(new analytics_client_common_1.IdentityEventSender()).promise];
case 9:
_c.sent();
_d.sent();
// Notify if DET is enabled

@@ -104,4 +103,4 @@ (0, det_notification_1.detNotify)(this.config);

case 10:
_c.sent();
_c.label = 11;
_d.sent();
_d.label = 11;
case 11:

@@ -111,4 +110,4 @@ if (!(0, analytics_client_common_1.isFormInteractionTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 13];

case 12:
_c.sent();
_c.label = 13;
_d.sent();
_d.label = 13;
case 13:

@@ -118,4 +117,4 @@ if (!(0, analytics_client_common_1.isPageViewTrackingEnabled)(this.config.defaultTracking)) return [3 /*break*/, 15];

case 14:
_c.sent();
_c.label = 15;
_d.sent();
_d.label = 15;
case 15:

@@ -127,3 +126,3 @@ this.initializing = false;

// Step 6: Run queued dispatch functions
_c.sent();
_d.sent();
// Step 7: Add the event receiver after running remaining queued functions.

@@ -130,0 +129,0 @@ connector.eventBridge.setEventReceiver(function (event) {

@@ -205,5 +205,5 @@ var _this = this;

var _c;
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
return tslib_1.__generator(this, function (_2) {
switch (_2.label) {
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
return tslib_1.__generator(this, function (_3) {
switch (_3.label) {
case 0:

@@ -221,7 +221,7 @@ identityStorage = options.identityStorage || constants_1.DEFAULT_IDENTITY_STORAGE;

case 3:
_b = (_2.sent());
_2.label = 4;
_b = (_3.sent());
_3.label = 4;
case 4:
_a = _b;
_2.label = 5;
_3.label = 5;
case 5:

@@ -232,19 +232,19 @@ cookieOptions = tslib_1.__assign.apply(void 0, [(_c.domain = _a, _c.expiration = 365, _c.sameSite = 'Lax', _c.secure = false, _c.upgrade = true, _c), options.cookieOptions]);

case 6:
legacyCookies = _2.sent();
legacyCookies = _3.sent();
return [4 /*yield*/, cookieStorage.get((0, analytics_client_common_1.getCookieName)(apiKey))];
case 7:
previousCookies = _2.sent();
previousCookies = _3.sent();
queryParams = (0, analytics_client_common_1.getQueryParams)();
deviceId = (_l = (_k = (_j = (_h = options.deviceId) !== null && _h !== void 0 ? _h : queryParams.deviceId) !== null && _j !== void 0 ? _j : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _k !== void 0 ? _k : legacyCookies.deviceId) !== null && _l !== void 0 ? _l : (0, analytics_core_1.UUID)();
lastEventId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _m !== void 0 ? _m : legacyCookies.lastEventId;
lastEventTime = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _o !== void 0 ? _o : legacyCookies.lastEventTime;
optOut = (_q = (_p = options.optOut) !== null && _p !== void 0 ? _p : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _q !== void 0 ? _q : legacyCookies.optOut;
sessionId = (_r = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _r !== void 0 ? _r : legacyCookies.sessionId;
userId = (_t = (_s = options.userId) !== null && _s !== void 0 ? _s : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _t !== void 0 ? _t : legacyCookies.userId;
amplitudeInstance.previousSessionDeviceId = (_u = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _u !== void 0 ? _u : legacyCookies.deviceId;
amplitudeInstance.previousSessionUserId = (_v = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _v !== void 0 ? _v : legacyCookies.userId;
deviceId = (_m = (_l = (_k = (_j = (_h = options.deviceId) !== null && _h !== void 0 ? _h : queryParams.ampDeviceId) !== null && _j !== void 0 ? _j : queryParams.deviceId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _l !== void 0 ? _l : legacyCookies.deviceId) !== null && _m !== void 0 ? _m : (0, analytics_core_1.UUID)();
lastEventId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _o !== void 0 ? _o : legacyCookies.lastEventId;
lastEventTime = (_p = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _p !== void 0 ? _p : legacyCookies.lastEventTime;
optOut = (_r = (_q = options.optOut) !== null && _q !== void 0 ? _q : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _r !== void 0 ? _r : legacyCookies.optOut;
sessionId = (_s = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _s !== void 0 ? _s : legacyCookies.sessionId;
userId = (_u = (_t = options.userId) !== null && _t !== void 0 ? _t : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _u !== void 0 ? _u : legacyCookies.userId;
amplitudeInstance.previousSessionDeviceId = (_v = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _v !== void 0 ? _v : legacyCookies.deviceId;
amplitudeInstance.previousSessionUserId = (_w = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _w !== void 0 ? _w : legacyCookies.userId;
trackingOptions = {
ipAddress: (_x = (_w = options.trackingOptions) === null || _w === void 0 ? void 0 : _w.ipAddress) !== null && _x !== void 0 ? _x : true,
language: (_z = (_y = options.trackingOptions) === null || _y === void 0 ? void 0 : _y.language) !== null && _z !== void 0 ? _z : true,
platform: (_1 = (_0 = options.trackingOptions) === null || _0 === void 0 ? void 0 : _0.platform) !== null && _1 !== void 0 ? _1 : true,
ipAddress: (_y = (_x = options.trackingOptions) === null || _x === void 0 ? void 0 : _x.ipAddress) !== null && _y !== void 0 ? _y : true,
language: (_0 = (_z = options.trackingOptions) === null || _z === void 0 ? void 0 : _z.language) !== null && _0 !== void 0 ? _0 : true,
platform: (_2 = (_1 = options.trackingOptions) === null || _1 === void 0 ? void 0 : _1.platform) !== null && _2 !== void 0 ? _2 : true,
};

@@ -251,0 +251,0 @@ pageCounter = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.pageCounter;

@@ -1,2 +0,2 @@

export declare const VERSION = "2.7.4";
export declare const VERSION = "2.8.0";
//# sourceMappingURL=version.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '2.7.4';
exports.VERSION = '2.8.0';
//# sourceMappingURL=version.js.map
import { __assign, __awaiter, __extends, __generator } from "tslib";
import { AmplitudeCore, Destination, Identify, returnWrapper, Revenue, UUID } from '@amplitude/analytics-core';
import { getAnalyticsConnector, getAttributionTrackingConfig, getPageViewTrackingConfig, IdentityEventSender, isAttributionTrackingEnabled, isSessionTrackingEnabled, isFileDownloadTrackingEnabled, isFormInteractionTrackingEnabled, setConnectorDeviceId, setConnectorUserId, isNewSession, isPageViewTrackingEnabled, WebAttribution, } from '@amplitude/analytics-client-common';
import { getAnalyticsConnector, getAttributionTrackingConfig, getPageViewTrackingConfig, IdentityEventSender, isAttributionTrackingEnabled, isSessionTrackingEnabled, isFileDownloadTrackingEnabled, isFormInteractionTrackingEnabled, setConnectorDeviceId, setConnectorUserId, isNewSession, isPageViewTrackingEnabled, WebAttribution, getQueryParams, } from '@amplitude/analytics-client-common';
import { OfflineDisabled, } from '@amplitude/analytics-types';

@@ -40,8 +40,8 @@ import { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';

AmplitudeBrowser.prototype._init = function (options) {
var _a, _b;
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function () {
var browserOptions, attributionTrackingOptions, connector;
var browserOptions, attributionTrackingOptions, queryParams, querySessionId, connector;
var _this = this;
return __generator(this, function (_c) {
switch (_c.label) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:

@@ -55,6 +55,6 @@ // Step 1: Block concurrent initialization

case 1:
browserOptions = _c.sent();
browserOptions = _d.sent();
return [4 /*yield*/, _super.prototype._init.call(this, browserOptions)];
case 2:
_c.sent();
_d.sent();
if (!isAttributionTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 4];

@@ -67,11 +67,10 @@ attributionTrackingOptions = getAttributionTrackingConfig(this.config);

// Fetch the current campaign, check if need to track web attribution later
_c.sent();
_c.label = 4;
_d.sent();
_d.label = 4;
case 4:
// Step 3: Set session ID
// Priority 1: `options.sessionId`
// Priority 2: last known sessionId from user identity storage
// Default: `Date.now()`
// Session ID is handled differently than device ID and user ID due to session events
this.setSessionId((_b = (_a = options.sessionId) !== null && _a !== void 0 ? _a : this.config.sessionId) !== null && _b !== void 0 ? _b : Date.now());
queryParams = getQueryParams();
querySessionId = Number.isNaN(Number(queryParams.ampSessionId))
? undefined
: Number(queryParams.ampSessionId);
this.setSessionId((_c = (_b = (_a = options.sessionId) !== null && _a !== void 0 ? _a : querySessionId) !== null && _b !== void 0 ? _b : this.config.sessionId) !== null && _c !== void 0 ? _c : Date.now());
connector = getAnalyticsConnector(options.instanceName);

@@ -85,13 +84,13 @@ connector.identityStore.setIdentity({

case 5:
_c.sent();
_c.label = 6;
_d.sent();
_d.label = 6;
case 6: return [4 /*yield*/, this.add(new Destination()).promise];
case 7:
_c.sent();
_d.sent();
return [4 /*yield*/, this.add(new Context()).promise];
case 8:
_c.sent();
_d.sent();
return [4 /*yield*/, this.add(new IdentityEventSender()).promise];
case 9:
_c.sent();
_d.sent();
// Notify if DET is enabled

@@ -102,4 +101,4 @@ detNotify(this.config);

case 10:
_c.sent();
_c.label = 11;
_d.sent();
_d.label = 11;
case 11:

@@ -109,4 +108,4 @@ if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 13];

case 12:
_c.sent();
_c.label = 13;
_d.sent();
_d.label = 13;
case 13:

@@ -116,4 +115,4 @@ if (!isPageViewTrackingEnabled(this.config.defaultTracking)) return [3 /*break*/, 15];

case 14:
_c.sent();
_c.label = 15;
_d.sent();
_d.label = 15;
case 15:

@@ -125,3 +124,3 @@ this.initializing = false;

// Step 6: Run queued dispatch functions
_c.sent();
_d.sent();
// Step 7: Add the event receiver after running remaining queued functions.

@@ -128,0 +127,0 @@ connector.eventBridge.setEventReceiver(function (event) {

@@ -202,5 +202,5 @@ import { __assign, __awaiter, __extends, __generator } from "tslib";

var _c;
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
return __generator(this, function (_2) {
switch (_2.label) {
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
return __generator(this, function (_3) {
switch (_3.label) {
case 0:

@@ -218,7 +218,7 @@ identityStorage = options.identityStorage || DEFAULT_IDENTITY_STORAGE;

case 3:
_b = (_2.sent());
_2.label = 4;
_b = (_3.sent());
_3.label = 4;
case 4:
_a = _b;
_2.label = 5;
_3.label = 5;
case 5:

@@ -229,19 +229,19 @@ cookieOptions = __assign.apply(void 0, [(_c.domain = _a, _c.expiration = 365, _c.sameSite = 'Lax', _c.secure = false, _c.upgrade = true, _c), options.cookieOptions]);

case 6:
legacyCookies = _2.sent();
legacyCookies = _3.sent();
return [4 /*yield*/, cookieStorage.get(getCookieName(apiKey))];
case 7:
previousCookies = _2.sent();
previousCookies = _3.sent();
queryParams = getQueryParams();
deviceId = (_l = (_k = (_j = (_h = options.deviceId) !== null && _h !== void 0 ? _h : queryParams.deviceId) !== null && _j !== void 0 ? _j : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _k !== void 0 ? _k : legacyCookies.deviceId) !== null && _l !== void 0 ? _l : UUID();
lastEventId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _m !== void 0 ? _m : legacyCookies.lastEventId;
lastEventTime = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _o !== void 0 ? _o : legacyCookies.lastEventTime;
optOut = (_q = (_p = options.optOut) !== null && _p !== void 0 ? _p : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _q !== void 0 ? _q : legacyCookies.optOut;
sessionId = (_r = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _r !== void 0 ? _r : legacyCookies.sessionId;
userId = (_t = (_s = options.userId) !== null && _s !== void 0 ? _s : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _t !== void 0 ? _t : legacyCookies.userId;
amplitudeInstance.previousSessionDeviceId = (_u = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _u !== void 0 ? _u : legacyCookies.deviceId;
amplitudeInstance.previousSessionUserId = (_v = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _v !== void 0 ? _v : legacyCookies.userId;
deviceId = (_m = (_l = (_k = (_j = (_h = options.deviceId) !== null && _h !== void 0 ? _h : queryParams.ampDeviceId) !== null && _j !== void 0 ? _j : queryParams.deviceId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _l !== void 0 ? _l : legacyCookies.deviceId) !== null && _m !== void 0 ? _m : UUID();
lastEventId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _o !== void 0 ? _o : legacyCookies.lastEventId;
lastEventTime = (_p = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _p !== void 0 ? _p : legacyCookies.lastEventTime;
optOut = (_r = (_q = options.optOut) !== null && _q !== void 0 ? _q : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _r !== void 0 ? _r : legacyCookies.optOut;
sessionId = (_s = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _s !== void 0 ? _s : legacyCookies.sessionId;
userId = (_u = (_t = options.userId) !== null && _t !== void 0 ? _t : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _u !== void 0 ? _u : legacyCookies.userId;
amplitudeInstance.previousSessionDeviceId = (_v = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _v !== void 0 ? _v : legacyCookies.deviceId;
amplitudeInstance.previousSessionUserId = (_w = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _w !== void 0 ? _w : legacyCookies.userId;
trackingOptions = {
ipAddress: (_x = (_w = options.trackingOptions) === null || _w === void 0 ? void 0 : _w.ipAddress) !== null && _x !== void 0 ? _x : true,
language: (_z = (_y = options.trackingOptions) === null || _y === void 0 ? void 0 : _y.language) !== null && _z !== void 0 ? _z : true,
platform: (_1 = (_0 = options.trackingOptions) === null || _0 === void 0 ? void 0 : _0.platform) !== null && _1 !== void 0 ? _1 : true,
ipAddress: (_y = (_x = options.trackingOptions) === null || _x === void 0 ? void 0 : _x.ipAddress) !== null && _y !== void 0 ? _y : true,
language: (_0 = (_z = options.trackingOptions) === null || _z === void 0 ? void 0 : _z.language) !== null && _0 !== void 0 ? _0 : true,
platform: (_2 = (_1 = options.trackingOptions) === null || _1 === void 0 ? void 0 : _1.platform) !== null && _2 !== void 0 ? _2 : true,
};

@@ -248,0 +248,0 @@ pageCounter = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.pageCounter;

@@ -1,2 +0,2 @@

export declare const VERSION = "2.7.4";
export declare const VERSION = "2.8.0";
//# sourceMappingURL=version.d.ts.map

@@ -1,2 +0,2 @@

export var VERSION = '2.7.4';
export var VERSION = '2.8.0';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,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 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-ew3/IaKre6E3b6APmfzQLiOtzd29b094xpnsAFwGvPUPjXE4q+pdWQTTO24IsP5d",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.7.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!")},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++)n(p,l[d]);r.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","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)}();
!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<f.length;t++)o(e,f[t],!1);for(var r=0;r<y.length;r++)o(e,y[r],!0)};r.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-r58GovPc8jo7o9PFd/Y8xHwOiockvJvuIBZZqsA7I8EzliMj0Pe0Sbx7Ti2ClxDD",c.crossOrigin="anonymous",c.async=!1,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.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++)n(p,l[d]);r.Identify=p;for(var m=function(){return this._q=[],this},g=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<g.length;v++)n(m,g[v]);r.Revenue=m;var f=["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,1 +0,1 @@

!function(){"use strict";!function(e,t){var r=e.amplitudeGTM||{_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})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<m.length;t++)i(e,m[t],!1);for(var r=0;r<y.length;r++)i(e,y[r],!0)};r.invoked=!0;var u=t.createElement("script");u.type="text/javascript",u.integrity="sha384-qU/7YOMCL8f/8+uQR2rcQggn+FxltGvSHPnUeuKdyhs3OEsLDaxhJg0EhMQDaTxU",u.crossOrigin="anonymous",u.async=!0,u.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.7.4-min.js.gz",u.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(u,c);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],g=0;g<v.length;g++)n(f,v[g]);r.Revenue=f;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document)}();
!function(){"use strict";!function(e,t){var r=e.amplitudeGTM||{_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})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=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 c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-brZSC96hYm3PQoDW01j9feI8ZrI3C0LCfqBawkfolqNQ43gMNKB2svxqXMnLzTrk",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.8.0-min.js.gz",c.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var f=function(){return this._q=[],this},m=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<m.length;v++)n(f,m[v]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],y=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document)}();

@@ -1,1 +0,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}},s=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._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<m.length;t++)i(e,m[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-ew3/IaKre6E3b6APmfzQLiOtzd29b094xpnsAFwGvPUPjXE4q+pdWQTTO24IsP5d",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.7.4-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];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++)n(p,l[d]);r.Identify=p;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
!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}},o=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},s=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(o(e,t,Array.prototype.slice.call(arguments)))};s(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-r58GovPc8jo7o9PFd/Y8xHwOiockvJvuIBZZqsA7I8EzliMj0Pe0Sbx7Ti2ClxDD",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var v=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<f.length;y++)n(v,f[y]);r.Revenue=v;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();

@@ -1,2 +0,2 @@

export declare const VERSION = "2.7.4";
export declare const VERSION = "2.8.0";
//# sourceMappingURL=version.d.ts.map
{
"name": "@amplitude/analytics-browser",
"version": "2.7.4",
"version": "2.8.0",
"description": "Official Amplitude SDK for Web",

@@ -47,6 +47,6 @@ "keywords": [

"dependencies": {
"@amplitude/analytics-client-common": "^2.1.6",
"@amplitude/analytics-core": "^2.2.7",
"@amplitude/analytics-types": "^2.5.0",
"@amplitude/plugin-page-view-tracking-browser": "^2.2.11",
"@amplitude/analytics-client-common": "^2.2.0",
"@amplitude/analytics-core": "^2.2.8",
"@amplitude/analytics-types": "^2.5.1",
"@amplitude/plugin-page-view-tracking-browser": "^2.2.12",
"tslib": "^2.4.1"

@@ -69,3 +69,3 @@ },

],
"gitHead": "f8a770d4355eb3d2a267f811c7d7f7e036a3dcaf"
"gitHead": "5ec4220989f9b7972887d1ecb88b6b993f2bd8b1"
}

@@ -56,3 +56,3 @@ <p align="center">

<script type="text/javascript">
!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})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<m.length;t++)i(e,m[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-ew3/IaKre6E3b6APmfzQLiOtzd29b094xpnsAFwGvPUPjXE4q+pdWQTTO24IsP5d",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.7.4-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];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++)n(p,l[d]);r.Identify=p;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
!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}},o=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},s=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(o(e,t,Array.prototype.slice.call(arguments)))};s(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-r58GovPc8jo7o9PFd/Y8xHwOiockvJvuIBZZqsA7I8EzliMj0Pe0Sbx7Ti2ClxDD",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.8.0-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(c,u);for(var l=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(l,p[d]);r.Identify=l;for(var v=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<f.length;y++)n(v,f[y]);r.Revenue=v;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();

@@ -59,0 +59,0 @@ amplitude.init("<YOUR_API_KEY>");

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc