@analytics/amplitude
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -37,3 +37,2 @@ var analyticsAmplitude = (function () { | ||
var apiKey = config.apiKey, | ||
projectName = config.projectName, | ||
customScriptSrc = config.customScriptSrc, | ||
@@ -40,0 +39,0 @@ _config$options = config.options, |
@@ -1,1 +0,1 @@ | ||
var analyticsAmplitude=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,o=!1,i=function(e){n=e,o=!0};return{name:"amplitude",config:t,initialize:function(t){var n=t.config,o=n.apiKey,r=(n.projectName,n.customScriptSrc),s=n.options,a=void 0===s?{}:s;if(!o)throw new Error("Amplitude project API key is not defined");if(a&&"object"!==e(a))throw new Error("Amplitude SDK options must be an object");if(void 0===window.amplitude){var u=r||"https://cdn.amplitude.com/libs/amplitude-8.1.0-min.gz.js"(function(e,t){var n=e.amplitude||{_q:[],_iq:{}},o=t.createElement("script");o.type="text/javascript",o.integrity="sha384-u0hlTAJ1tNefeBKwiBNwB4CkHZ1ck4ajx/pKmwWtc+IufKJiCQZ+WjJIi+7C6Ntm",o.crossOrigin="anonymous",o.async=!0,o.src=u,o.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var i=t.getElementsByTagName("script")[0];function r(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}i.parentNode.insertBefore(o,i);for(var s=function(){return this._q=[],this},a=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove"],c=0;c<a.length;c++)r(s,a[c]);n.Identify=s;for(var p=function(){return this._q=[],this},l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],d=0;d<l.length;d++)r(p,l[d]);n.Revenue=p;var f=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function y(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}for(var n=0;n<f.length;n++)t(f[n])}y(n),n.getInstance=function(e){return e=(e&&0!==e.length?e:"$default_instance").toLowerCase(),Object.prototype.hasOwnProperty.call(n._iq,e)||(n._iq[e]={_q:[]},y(n._iq[e])),n._iq[e]},e.amplitude=n})(window,document);window.amplitude.init(n.apiKey,null,a,i)}},page:function(e){var t=e.payload,o=t.properties,i=t.options,r="Page View";i&&i.eventType&&(r=i.eventType),n.logEvent(r,o)},track:function(e){var t=e.payload,o=t.event,i=t.properties;n.logEvent(o,i)},identify:function(e){var t=e.payload,o=t.userId,i=t.traits;e.instance,n.setUserId(o),n.setUserProperties(i)},loaded:function(){return o}}}}(); | ||
var analyticsAmplitude=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,o=!1,i=function(e){n=e,o=!0};return{name:"amplitude",config:t,initialize:function(t){var n=t.config,o=n.apiKey,r=n.customScriptSrc,s=n.options,a=void 0===s?{}:s;if(!o)throw new Error("Amplitude project API key is not defined");if(a&&"object"!==e(a))throw new Error("Amplitude SDK options must be an object");if(void 0===window.amplitude){var u=r||"https://cdn.amplitude.com/libs/amplitude-8.1.0-min.gz.js"(function(e,t){var n=e.amplitude||{_q:[],_iq:{}},o=t.createElement("script");o.type="text/javascript",o.integrity="sha384-u0hlTAJ1tNefeBKwiBNwB4CkHZ1ck4ajx/pKmwWtc+IufKJiCQZ+WjJIi+7C6Ntm",o.crossOrigin="anonymous",o.async=!0,o.src=u,o.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var i=t.getElementsByTagName("script")[0];function r(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}i.parentNode.insertBefore(o,i);for(var s=function(){return this._q=[],this},a=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove"],c=0;c<a.length;c++)r(s,a[c]);n.Identify=s;for(var p=function(){return this._q=[],this},l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],d=0;d<l.length;d++)r(p,l[d]);n.Revenue=p;var f=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function y(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}for(var n=0;n<f.length;n++)t(f[n])}y(n),n.getInstance=function(e){return e=(e&&0!==e.length?e:"$default_instance").toLowerCase(),Object.prototype.hasOwnProperty.call(n._iq,e)||(n._iq[e]={_q:[]},y(n._iq[e])),n._iq[e]},e.amplitude=n})(window,document);window.amplitude.init(n.apiKey,null,a,i)}},page:function(e){var t=e.payload,o=t.properties,i=t.options,r="Page View";i&&i.eventType&&(r=i.eventType),n.logEvent(r,o)},track:function(e){var t=e.payload,o=t.event,i=t.properties;n.logEvent(o,i)},identify:function(e){var t=e.payload,o=t.userId,i=t.traits;e.instance,n.setUserId(o),n.setUserProperties(i)},loaded:function(){return o}}}}(); |
@@ -36,3 +36,2 @@ 'use strict'; | ||
var apiKey = config.apiKey, | ||
projectName = config.projectName, | ||
customScriptSrc = config.customScriptSrc, | ||
@@ -39,0 +38,0 @@ _config$options = config.options, |
@@ -34,3 +34,2 @@ function _typeof(obj) { | ||
var apiKey = config.apiKey, | ||
projectName = config.projectName, | ||
customScriptSrc = config.customScriptSrc, | ||
@@ -37,0 +36,0 @@ _config$options = config.options, |
{ | ||
"name": "@analytics/amplitude", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Amplitude integration for 'analytics' module", | ||
@@ -54,3 +54,3 @@ "projectMeta": { | ||
}, | ||
"dependencies": {} | ||
"gitHead": "efe0751c16730a058baf0d3dbc56a303381e9037" | ||
} |
@@ -125,3 +125,2 @@ <!-- | ||
| `apiKey` <br/>**required** - string| Amplitude project API key | | ||
| `projectName` <br/>**required** - string| project name (if it's necessary to report to multiple projects) | | ||
| `options` <br/>**required** - object| Amplitude SDK options | | ||
@@ -128,0 +127,0 @@ |
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
29653
10
453
249