@amplitude/amplitude-js-gtm
Advanced tools
Comparing version 3.0.0-beta.2 to 3.0.0-beta.4
@@ -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{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-QhZkEQJe2NFJ4yDkn/RFnD+NP0FINrep4tUh958v8McXRqszeRUQWbwBCfFqZvnF",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-0.2.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var i=t.getElementsByTagName("script")[0];function f(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}i.parentNode.insertBefore(n,i);for(var s=function(){return this._q=[],this},o=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<o.length;a++)f(s,o[a]);r.Identify=s;for(var u=function(){return this._q=[],this},p=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],d=0;d<p.length;d++)f(u,p[d]);r.Revenue=u;var c=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],l=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];function v(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<c.length;r++)t(c[r],!1);for(var n=0;n<l.length;n++)t(l[n],!0)}v(r),r.createInstance=function(){var e=r._iq.push({_q:[]})-1;return v(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}(),function(e,t){if(e.amplitude&&"function"==typeof e.amplitude.init){var r=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],n=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],i=function(t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var i=new e.amplitude.Identify;if(t.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==n.indexOf(t)&&i[t].apply(i,e)}})),!0===r)return i;e.amplitude.identify(i)}},s=function(t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var r=i([t[2]],!0);e.amplitude.groupIdentify(t[0],t[1],r)}},o=function(t){if((t=t.shift()).price&&t.id){var r=(new e.amplitude.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenueType(t.revenueType||"").setEventProperties(t.eventProperties||{});e.amplitude.revenue(r)}};e[t]=e[t]||function(){var t=[].slice.call(arguments,0),n=t.shift();if(-1!==r.indexOf(n))return"revenue"===n?o(t):"identify"===n?i(t):"groupIdentify"===n?s(t):e.amplitude[n].apply(this,t)}}}(window,"_amplitude"); | ||
!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{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-QhZkEQJe2NFJ4yDkn/RFnD+NP0FINrep4tUh958v8McXRqszeRUQWbwBCfFqZvnF",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/marketing-analytics-browser-0.2.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var i=t.getElementsByTagName("script")[0];function f(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}i.parentNode.insertBefore(n,i);for(var s=function(){return this._q=[],this},o=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<o.length;a++)f(s,o[a]);r.Identify=s;for(var u=function(){return this._q=[],this},p=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],d=0;d<p.length;d++)f(u,p[d]);r.Revenue=u;var c=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],l=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];function v(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<c.length;r++)t(c[r],!1);for(var n=0;n<l.length;n++)t(l[n],!0)}v(r),r.createInstance=function(){var e=r._iq.push({_q:[]})-1;return v(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}(),function(e,t){if(e.amplitude&&"function"==typeof e.amplitude.init){var r=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],n=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],i=function(t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var i=new e.amplitude.Identify;if(t.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==n.indexOf(t)&&i[t].apply(i,e)}})),!0===r)return i;e.amplitude.identify(i)}},s=function(t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var r=i([t[2]],!0);e.amplitude.groupIdentify(t[0],t[1],r)}},o=function(t){if((t=t.shift()).price&&t.productId){var r=(new e.amplitude.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenueType(t.revenueType||"").setEventProperties(t.eventProperties||{});e.amplitude.revenue(r)}};e[t]=e[t]||function(){var t=[].slice.call(arguments,0),n=t.shift();if(-1!==r.indexOf(n))return"revenue"===n?o(t):"identify"===n?i(t):"groupIdentify"===n?s(t):e.amplitude[n].apply(this,t)}}}(window,"_amplitude"); |
{ | ||
"name": "@amplitude/amplitude-js-gtm", | ||
"version": "3.0.0-beta.2", | ||
"version": "3.0.0-beta.4", | ||
"description": "Amplitude JS SDK Wrapper for use with Google Tag Manager", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -182,3 +182,3 @@ /* Amplitude JavaScript SDK begin */ | ||
// Validate revenue args | ||
if (!args.price || !args.id) return; | ||
if (!args.price || !args.productId) return; | ||
@@ -221,2 +221,2 @@ var revenue = new a.amplitude.Revenue() | ||
})(window, '_amplitude') | ||
/* Amplitude wrapper end */ | ||
/* Amplitude wrapper end */ |
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
22320
216