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

@amplitude/analytics-browser

Package Overview
Dependencies
Maintainers
20
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 1.12.0 to 1.12.1

34

lib/cjs/plugins/file-download-tracking.js

@@ -8,6 +8,24 @@ var _this = this;

var fileDownloadTracking = function () {
var observer;
var eventListeners = [];
var addEventListener = function (element, type, handler) {
element.addEventListener(type, handler);
eventListeners.push({
element: element,
type: type,
handler: handler,
});
};
var removeClickListeners = function () {
eventListeners.forEach(function (_a) {
var element = _a.element, type = _a.type, handler = _a.handler;
/* istanbul ignore next */
element === null || element === void 0 ? void 0 : element.removeEventListener(type, handler);
});
eventListeners = [];
};
var name = '@amplitude/plugin-file-download-tracking-browser';
var type = analytics_types_1.PluginType.ENRICHMENT;
var setup = function (config, amplitude) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var addFileDownloadListener, ext, links, observer;
var addFileDownloadListener, ext, links;
return tslib_1.__generator(this, function (_a) {

@@ -20,2 +38,6 @@ /* istanbul ignore if */

}
/* istanbul ignore if */
if (typeof document === 'undefined') {
return [2 /*return*/];
}
addFileDownloadListener = function (a) {

@@ -34,3 +56,3 @@ var url;

if (fileExtension) {
a.addEventListener('click', function () {
addEventListener(a, 'click', function () {
var _a;

@@ -78,2 +100,9 @@ if (fileExtension) {

}); }); };
var teardown = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
observer === null || observer === void 0 ? void 0 : observer.disconnect();
removeClickListeners();
return [2 /*return*/];
});
}); };
return {

@@ -84,2 +113,3 @@ name: name,

execute: execute,
teardown: teardown,
};

@@ -86,0 +116,0 @@ };

@@ -8,6 +8,24 @@ var _this = this;

var formInteractionTracking = function () {
var observer;
var eventListeners = [];
var addEventListener = function (element, type, handler) {
element.addEventListener(type, handler);
eventListeners.push({
element: element,
type: type,
handler: handler,
});
};
var removeClickListeners = function () {
eventListeners.forEach(function (_a) {
var element = _a.element, type = _a.type, handler = _a.handler;
/* istanbul ignore next */
element === null || element === void 0 ? void 0 : element.removeEventListener(type, handler);
});
eventListeners = [];
};
var name = '@amplitude/plugin-form-interaction-tracking-browser';
var type = analytics_types_1.PluginType.ENRICHMENT;
var setup = function (config, amplitude) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var addFormInteractionListener, forms, observer;
var addFormInteractionListener, forms;
return tslib_1.__generator(this, function (_a) {

@@ -20,5 +38,9 @@ /* istanbul ignore if */

}
/* istanbul ignore if */
if (typeof document === 'undefined') {
return [2 /*return*/];
}
addFormInteractionListener = function (form) {
var hasFormChanged = false;
form.addEventListener('change', function () {
addEventListener(form, 'change', function () {
var _a;

@@ -33,4 +55,4 @@ if (!hasFormChanged) {

hasFormChanged = true;
}, {});
form.addEventListener('submit', function () {
});
addEventListener(form, 'submit', function () {
var _a, _b;

@@ -80,2 +102,9 @@ if (!hasFormChanged) {

}); }); };
var teardown = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
observer === null || observer === void 0 ? void 0 : observer.disconnect();
removeClickListeners();
return [2 /*return*/];
});
}); };
return {

@@ -86,2 +115,3 @@ name: name,

execute: execute,
teardown: teardown,
};

@@ -88,0 +118,0 @@ };

2

lib/cjs/version.d.ts

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

export declare const VERSION = "1.12.0";
export declare const VERSION = "1.12.1";
//# sourceMappingURL=version.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '1.12.0';
exports.VERSION = '1.12.1';
//# sourceMappingURL=version.js.map

@@ -5,6 +5,24 @@ import { __awaiter, __generator } from "tslib";

export var fileDownloadTracking = function () {
var observer;
var eventListeners = [];
var addEventListener = function (element, type, handler) {
element.addEventListener(type, handler);
eventListeners.push({
element: element,
type: type,
handler: handler,
});
};
var removeClickListeners = function () {
eventListeners.forEach(function (_a) {
var element = _a.element, type = _a.type, handler = _a.handler;
/* istanbul ignore next */
element === null || element === void 0 ? void 0 : element.removeEventListener(type, handler);
});
eventListeners = [];
};
var name = '@amplitude/plugin-file-download-tracking-browser';
var type = PluginType.ENRICHMENT;
var setup = function (config, amplitude) { return __awaiter(void 0, void 0, void 0, function () {
var addFileDownloadListener, ext, links, observer;
var addFileDownloadListener, ext, links;
return __generator(this, function (_a) {

@@ -17,2 +35,6 @@ /* istanbul ignore if */

}
/* istanbul ignore if */
if (typeof document === 'undefined') {
return [2 /*return*/];
}
addFileDownloadListener = function (a) {

@@ -31,3 +53,3 @@ var url;

if (fileExtension) {
a.addEventListener('click', function () {
addEventListener(a, 'click', function () {
var _a;

@@ -75,2 +97,9 @@ if (fileExtension) {

}); }); };
var teardown = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
observer === null || observer === void 0 ? void 0 : observer.disconnect();
removeClickListeners();
return [2 /*return*/];
});
}); };
return {

@@ -81,4 +110,5 @@ name: name,

execute: execute,
teardown: teardown,
};
};
//# sourceMappingURL=file-download-tracking.js.map

@@ -5,6 +5,24 @@ import { __awaiter, __generator } from "tslib";

export var formInteractionTracking = function () {
var observer;
var eventListeners = [];
var addEventListener = function (element, type, handler) {
element.addEventListener(type, handler);
eventListeners.push({
element: element,
type: type,
handler: handler,
});
};
var removeClickListeners = function () {
eventListeners.forEach(function (_a) {
var element = _a.element, type = _a.type, handler = _a.handler;
/* istanbul ignore next */
element === null || element === void 0 ? void 0 : element.removeEventListener(type, handler);
});
eventListeners = [];
};
var name = '@amplitude/plugin-form-interaction-tracking-browser';
var type = PluginType.ENRICHMENT;
var setup = function (config, amplitude) { return __awaiter(void 0, void 0, void 0, function () {
var addFormInteractionListener, forms, observer;
var addFormInteractionListener, forms;
return __generator(this, function (_a) {

@@ -17,5 +35,9 @@ /* istanbul ignore if */

}
/* istanbul ignore if */
if (typeof document === 'undefined') {
return [2 /*return*/];
}
addFormInteractionListener = function (form) {
var hasFormChanged = false;
form.addEventListener('change', function () {
addEventListener(form, 'change', function () {
var _a;

@@ -30,4 +52,4 @@ if (!hasFormChanged) {

hasFormChanged = true;
}, {});
form.addEventListener('submit', function () {
});
addEventListener(form, 'submit', function () {
var _a, _b;

@@ -77,2 +99,9 @@ if (!hasFormChanged) {

}); }); };
var teardown = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
observer === null || observer === void 0 ? void 0 : observer.disconnect();
removeClickListeners();
return [2 /*return*/];
});
}); };
return {

@@ -83,4 +112,5 @@ name: name,

execute: execute,
teardown: teardown,
};
};
//# sourceMappingURL=form-interaction-tracking.js.map

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

export declare const VERSION = "1.12.0";
export declare const VERSION = "1.12.1";
//# sourceMappingURL=version.d.ts.map

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

export var VERSION = '1.12.0';
export var VERSION = '1.12.1';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,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}},s=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},o=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))}}},i=function(e){for(var t=0;t<m.length;t++)o(e,m[t],!1);for(var n=0;n<g.length;n++)o(e,g[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-s4Wx3hZn20lk10XSCWAIMwlpJRoowQ1Yt6E0gUEhrmytlmyODAskmfnOcu84UYAg",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.12.0-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++)r(u,l[p]);n.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<f.length;v++)r(d,f[v]);n.Revenue=d;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];i(n),n.createInstance=function(e){return n._iq[e]={_q:[]},i(n._iq[e]),n._iq[e]},e.amplitude=n}}(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}},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)))}}},o=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 a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-tVVRWU7GrpjrC44WiDzQSQ9/fCEp3KlzT6HvGeU9Q4YPkOziz0qa/azi73J6jBr6",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.12.1-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},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],l=0;l<p.length;l++)n(u,p[l]);r.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","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"],m=["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)}();

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

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

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

"dependencies": {
"@amplitude/analytics-client-common": "^1.1.0",
"@amplitude/analytics-core": "^1.2.0",
"@amplitude/analytics-types": "^1.3.0",
"@amplitude/plugin-page-view-tracking-browser": "^1.0.6",
"@amplitude/plugin-web-attribution-browser": "^1.0.6",
"@amplitude/analytics-client-common": "^1.1.1",
"@amplitude/analytics-core": "^1.2.1",
"@amplitude/analytics-types": "^1.3.1",
"@amplitude/plugin-page-view-tracking-browser": "^1.0.7",
"@amplitude/plugin-web-attribution-browser": "^1.0.7",
"@amplitude/ua-parser-js": "^0.7.31",

@@ -72,3 +72,3 @@ "tslib": "^2.4.1"

],
"gitHead": "01c20d61e8c51b59dc7fdf83d4abd57391aecf71"
"gitHead": "bc426d86b020aa96c9dc3a824aaaecf22213b32f"
}

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

<script type="text/javascript">
!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}},s=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},o=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))}}},i=function(e){for(var t=0;t<m.length;t++)o(e,m[t],!1);for(var n=0;n<g.length;n++)o(e,g[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-s4Wx3hZn20lk10XSCWAIMwlpJRoowQ1Yt6E0gUEhrmytlmyODAskmfnOcu84UYAg",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.12.0-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++)r(u,l[p]);n.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<f.length;v++)r(d,f[v]);n.Revenue=d;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];i(n),n.createInstance=function(e){return n._iq[e]={_q:[]},i(n._iq[e]),n._iq[e]},e.amplitude=n}}(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}},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)))}}},o=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 a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-tVVRWU7GrpjrC44WiDzQSQ9/fCEp3KlzT6HvGeU9Q4YPkOziz0qa/azi73J6jBr6",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.12.1-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},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],l=0;l<p.length;l++)n(u,p[l]);r.Identify=u;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","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"],m=["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)}();

@@ -46,0 +46,0 @@ amplitude.init("YOUR_API_KEY_HERE");

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 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