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

@amplitude/amplitude-js-gtm

Package Overview
Dependencies
Maintainers
20
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/amplitude-js-gtm - npm Package Compare versions

Comparing version 3.1.5 to 3.2.0

2

dist/index.js

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

(()=>{"use strict";!function(e,t){var n=e.amplitudeGTM||{_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<m.length;n++)s(e,m[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-nzpSzWEVFlpFyKT7VrM3d++MpD8mlvpJosTft5ponedNAX+l5MqtL7qR/OCjjeCA",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-gtm-0.5.4-min.js.gz",a.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(a,u);for(var p=function(){return this._q=[],this},c=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<c.length;d++)r(p,c[d]);n.Identify=p;for(var l=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<f.length;y++)r(l,f[y]);n.Revenue=l;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],m=["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.amplitudeGTM=n,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document),function(e,t){const n=e.amplitudeGTM;if(n&&"function"==typeof n.init){var r=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],i=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],s=function(e,t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var s=new n.Identify;if(t.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==i.indexOf(t)&&s[t].apply(s,e)}})),!0===r)return s;e.identify(s)}},o=function(e,t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var n=s(e,[t[2]],!0);e.groupIdentify(t[0],t[1],n)}},a=function(e,t){if((t=t.shift()).price&&t.productId){var r=(new n.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenueType(t.revenueType||"").setEventProperties(t.eventProperties||{});e.revenue(r)}},u=function(e,t){let n=e.init(...t).promise;return n.then((()=>e.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm/3.1.5",e)}))),n};e[t]=e[t]||function(){var e=[].slice.call(arguments,0),t=e.shift(),i=t?n._iq[t]:n;i||(i=n.createInstance(t));var p=e.shift();if(-1!==r.indexOf(p))return"revenue"===p?a(i,e):"identify"===p?s(i,e):"groupIdentify"===p?o(i,e):"init"===p?u(i,e):i[p].apply(this,e)}}}(window,"_amplitude")})();
(()=>{"use strict";!function(e,t){var n=e.amplitudeGTM||{_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<m.length;n++)s(e,m[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-nzpSzWEVFlpFyKT7VrM3d++MpD8mlvpJosTft5ponedNAX+l5MqtL7qR/OCjjeCA",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-gtm-0.5.4-min.js.gz",a.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(a,u);for(var p=function(){return this._q=[],this},c=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<c.length;d++)r(p,c[d]);n.Identify=p;for(var l=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<f.length;y++)r(l,f[y]);n.Revenue=l;var v=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],m=["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.amplitudeGTM=n,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document),function(e,t){const n=e.amplitudeGTM;if(n&&"function"==typeof n.init){var r=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],i=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],s=function(e,t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var s=new n.Identify;if(t.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==i.indexOf(t)&&s[t].apply(s,e)}})),!0===r)return s;e.identify(s)}},o=function(e,t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var n=s(e,[t[2]],!0);e.groupIdentify(t[0],t[1],n)}},a=function(e,t){if((t=t.shift()).price&&t.productId){var r=(new n.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenueType(t.revenueType||"").setEventProperties(t.eventProperties||{}).setRevenue(t.revenue||t.price*(t.quantity||1));e.revenue(r)}},u=function(e,t){let n=e.init(...t).promise;return n.then((()=>e.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm/3.2.0",e)}))),n};e[t]=e[t]||function(){var e=[].slice.call(arguments,0),t=e.shift(),i=t?n._iq[t]:n;i||(i=n.createInstance(t));var p=e.shift();if(-1!==r.indexOf(p))return"revenue"===p?a(i,e):"identify"===p?s(i,e):"groupIdentify"===p?o(i,e):"init"===p?u(i,e):i[p].apply(this,e)}}}(window,"_amplitude")})();
{
"name": "@amplitude/amplitude-js-gtm",
"version": "3.1.5",
"version": "3.2.0",
"description": "Amplitude JS SDK Wrapper for use with Google Tag Manager",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -129,4 +129,4 @@ import { version } from '../package.json';

.setRevenueType(args.revenueType || '')
.setEventProperties(args.eventProperties || {});
.setEventProperties(args.eventProperties || {})
.setRevenue(args.revenue || (args.price * (args.quantity || 1)));
client.revenue(revenue);

@@ -133,0 +133,0 @@ };

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