@amplitude/amplitude-js-gtm
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -1,1 +0,1 @@ | ||
(()=>{"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<m.length;n++)s(e,m[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-D3GO8BuPsJOXpw91yAMykYKOR35cmmZ15qHBaEcl5aU3po1Xnyw2m+J4lL2+Cs1t",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-0.4.0-min.js.gz",a.onload=function(){e.amplitude.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.amplitude=n}}(window,document),function(e,t){if(e.amplitude&&"function"==typeof e.amplitude.init){var n=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],r=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],i=function(t,n,i){if(n=n.shift(),Array.isArray(n)&&0!==n.length){var s=new e.amplitude.Identify;if(n.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==r.indexOf(t)&&s[t].apply(s,e)}})),!0===i)return s;t.identify(s)}},s=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=i(e,[t[2]],!0);e.groupIdentify(t[0],t[1],n)}},o=function(t,n){if((n=n.shift()).price&&n.productId){var r=(new e.amplitude.Revenue).setProductId(n.productId).setQuantity(n.quantity||1).setPrice(n.price).setRevenueType(n.revenueType||"").setEventProperties(n.eventProperties||{});t.revenue(r)}},a=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.2",e)}))),n};e[t]=e[t]||function(){var t=[].slice.call(arguments,0),r=t.shift(),u=r?e.amplitude:e.amplitude._iq[r];u||(u=e.amplitude.createInstance(r));var p=t.shift();if(-1!==n.indexOf(p))return"revenue"===p?o(u,t):"identify"===p?i(u,t):"groupIdentify"===p?s(u,t):"init"===p?a(u,t):u[p].apply(this,t)}}}(window,"_amplitude")})(); | ||
(()=>{"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<m.length;n++)s(e,m[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-D3GO8BuPsJOXpw91yAMykYKOR35cmmZ15qHBaEcl5aU3po1Xnyw2m+J4lL2+Cs1t",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-0.4.0-min.js.gz",a.onload=function(){e.amplitude.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.amplitude=n}}(window,document),function(e,t){if(e.amplitude&&"function"==typeof e.amplitude.init){var n=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],r=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],i=function(t,n,i){if(n=n.shift(),Array.isArray(n)&&0!==n.length){var s=new e.amplitude.Identify;if(n.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==r.indexOf(t)&&s[t].apply(s,e)}})),!0===i)return s;t.identify(s)}},s=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=i(e,[t[2]],!0);e.groupIdentify(t[0],t[1],n)}},o=function(t,n){if((n=n.shift()).price&&n.productId){var r=(new e.amplitude.Revenue).setProductId(n.productId).setQuantity(n.quantity||1).setPrice(n.price).setRevenueType(n.revenueType||"").setEventProperties(n.eventProperties||{});t.revenue(r)}},a=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.3",e)}))),n};e[t]=e[t]||function(){var t=[].slice.call(arguments,0),r=t.shift(),u=r?e.amplitude._iq[r]:e.amplitude;u||(u=e.amplitude.createInstance(r));var p=t.shift();if(-1!==n.indexOf(p))return"revenue"===p?o(u,t):"identify"===p?i(u,t):"groupIdentify"===p?s(u,t):"init"===p?a(u,t):u[p].apply(this,t)}}}(window,"_amplitude")})(); |
{ | ||
"name": "@amplitude/amplitude-js-gtm", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "Amplitude JS SDK Wrapper for use with Google Tag Manager", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -162,3 +162,3 @@ import { version } from '../package.json'; | ||
var name = args.shift(); | ||
var client = name ? a.amplitude : a.amplitude._iq[name]; | ||
var client = !name ? a.amplitude : a.amplitude._iq[name]; | ||
if (!client) { | ||
@@ -165,0 +165,0 @@ client = a.amplitude.createInstance(name); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22567