@analytics/snowplow
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.2](https://github.com/DavidWells/analytics/compare/@analytics/snowplow@0.2.1...@analytics/snowplow@0.2.2) (2020-12-23) | ||
**Note:** Version bump only for package @analytics/snowplow | ||
## [0.2.1](https://github.com/DavidWells/analytics/compare/@analytics/snowplow@0.1.1...@analytics/snowplow@0.2.1) (2020-08-24) | ||
@@ -8,0 +16,0 @@ |
@@ -128,3 +128,3 @@ var analyticsSnowplow = (function () { | ||
return { | ||
NAMESPACE: config.name, | ||
name: config.name, | ||
initialize: function initialize() { | ||
@@ -131,0 +131,0 @@ var scriptSrc = config.scriptSrc, |
@@ -1,1 +0,1 @@ | ||
var analyticsSnowplow=function(){"use strict";function n(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),o.push.apply(o,t)}return o}function o(c){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?n(a,!0).forEach(function(e){var n,o,t;n=c,t=a[o=e],o in n?Object.defineProperty(n,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[o]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(a)):n(a).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(a,e))})}return c}var t={name:"snowplow",trackerSettings:{contexts:{webPage:!0}}};function a(){return!window.snowplow}return function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},p=o(o({},t),e);return{NAMESPACE:p.name,initialize:function(){var e,n,o,t,c,a,r,s=p.scriptSrc,i=p.collectorUrl,l=p.name,w=p.trackerSettings;if(!s)throw new Error("No Snowplow sp.js location defined");if(!i)throw new Error("No collector url defined");e=window,n=document,o="script",t=s,e[c="snowplow"]||(e.GlobalSnowplowNamespace=e.GlobalSnowplowNamespace||[],e.GlobalSnowplowNamespace.push(c),e[c]=function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].q=e[c].q||[],a=n.createElement(o),r=n.getElementsByTagName(o)[0],a.async=1,a.src=t,r.parentNode.insertBefore(a,r)),snowplow("newTracker",l,i,w)},page:function(e){var n=e.payload.properties,o=p.name;a()||(snowplow("setCustomUrl:".concat(o),n.url),snowplow("setReferrerUrl:".concat(o),n.referrer),snowplow("trackPageView:".concat(o),n.title,n.contexts,n.dynamicContexts))},reset:function(){var e=p.name;a()||(snowplow("clearUserData:".concat(e)),snowplow("setUserId:".concat(e),void 0),snowplow("clearGlobalContexts:".concat(e)))},track:function(e){var n=e.payload,o=n.event,t=n.properties,c=p.name;a()||function(e,n,o){if(n&&o)switch(n.toLowerCase()){case"selfdescribingevent":case"unstructevent":snowplow("trackSelfDescribingEvent:".concat(e),{schema:o.schema,data:o.data},o.contexts);break;case"socialinteraction":snowplow("trackSocialInteraction:".concat(e),o.action,o.network,o.target,o.contexts);break;case"adimpression":snowplow("trackAdImpression:".concat(e),o.impressionId,o.costModel,o.cost,o.targetUrl,o.bannerId,o.zoneId,o.advertiserId,o.campaignId,o.contexts);break;case"adclick":snowplow("trackAdClick:".concat(e),o.targetUrl,o.clickId,o.costModel,o.cost,o.bannerId,o.zoneId,o.impressionId,o.advertiserId,o.campaignId,o.contexts);break;case"adconversion":snowplow("trackAdConversion:".concat(e),o.conversionId,o.cost,o.category,o.action,o.property,o.initialValue,o.advertiserId,o.costModel,o.campaignId,o.contexts);break;case"linkclick":snowplow("trackLinkClick:".concat(e),o.targetUrl,o.elementId,o.elementClasses,o.elementTarget,o.elementContent,o.contexts);break;case"addtocart":snowplow("trackAddToCart:".concat(e),o.sku,o.name,o.category,o.unitPrice,o.quantity,o.currency,o.contexts);break;case"removefromcart":snowplow("trackRemoveToCart:".concat(e),o.sku,o.name,o.category,o.unitPrice,o.quantity,o.currency,o.contexts);break;case"sitesearch":snowplow("trackSiteSearch:".concat(e),o.searchTerms,o.filters,o.resultsFound,o.resultsDisplayed,o.contexts);break;case"consentgranted":snowplow("trackConsentGranted:".concat(e),o.id,o.version,o.name,o.description,o.expiry,o.contexts);break;case"consentwithdrawn":snowplow("trackConsentWithdrawn:".concat(e),o.all,o.id,o.version,o.name,o.description,o.contexts);break;case"error":snowplow("trackError:".concat(e),o.message,o.filename,o.lineno,o.colno,o.error,o.contexts);break;case"enhancedecommerceactioncontext":snowplow("addEnhancedEcommerceActionContext:".concat(e),o.id,o.affiliation,o.revenue,o.tax,o.shipping,o.coupon,o.list,o.step,o.option,o.currency);break;case"enhancedecommerceimpressioncontext":snowplow("addEnhancedEcommerceImpressionContext:".concat(e),o.id,o.name,o.list,o.brand,o.category,o.variant,o.position,o.price,o.currency);break;case"enhancedecommerceproductcontext":snowplow("addEnhancedEcommerceProductContext:".concat(e),o.id,o.name,o.list,o.brand,o.category,o.variant,o.price,o.quantity,o.coupon,o.position,o.currency);break;case"enhancedecommercepromocontext":snowplow("addEnhancedEcommercePromoContext:".concat(e),o.id,o.name,o.creative,o.position,o.currency);break;case"enhancedecommerceaction":snowplow("trackEnhancedEcommerceAction:".concat(e),o.action);break;case"timing":snowplow("trackTiming:".concat(e),o.category,o.variable,o.timing,o.label,o.contexts);case"structevent":default:snowplow("trackStructEvent:".concat(e),o.category||"All",n||o.action,o.label,o.property,o.value,o.contexts)}}(c,o,t)},identify:function(e){var n=e.payload.userId,o=p.name;a()||n&&snowplow("setUserId:".concat(o),n)},loaded:function(){return!a()},methods:{enableActivityTracking:function(e,n){var o=p.name;snowplow("enableActivityTracking:".concat(o),e,n)},refreshLinkClickTracking:function(){var e=p.name;snowplow("refreshLinkClickTracking:".concat(e))},enableFormTracking:function(e,n){var o=p.name;snowplow("enableFormTracking:".concat(o),e||{},n||null)},enableGdprContext:function(e,n,o,t){var c=p.name;snowplow("enableGdprContext:".concat(c),e,n||null,o||null,t||null)},enableLinkClickTracking:function(e,n,o,t){var c=p.name;snowplow("enableLinkClickTracking:".concat(c),e||{},n||!0,o||!1,t||null)},enableErrorTracking:function(e,n){var o=p.name;snowplow("enableErrorTracking:".concat(o),e||null,n||null)},addGlobalContexts:function(e){var n=p.name,o=e.contexts;e.filterConditions&&(o=[e.filterConditions,o]),snowplow("addGlobalContexts:".concat(n),o)},removeGlobalContexts:function(e){var n=p.name;snowplow("removeGlobalContexts:".concat(n),e)},clearGlobalContexts:function(){var e=p.name;snowplow("clearGlobalContexts:".concat(e))},disableAnonymousTracking:function(e){var n=p.name;snowplow("disableAnonymousTracking:".concat(n),e)},enableAnonymousTracking:function(e){var n=p.name;snowplow("enableAnonymousTracking:".concat(n),e)}}}}}(); | ||
var analyticsSnowplow=function(){"use strict";function e(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}function n(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,t)}return o}function o(o){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?n(c,!0).forEach(function(n){e(o,n,c[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(c)):n(c).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(c,e))})}return o}var t={name:"snowplow",trackerSettings:{contexts:{webPage:!0}}};function c(){return!window.snowplow}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=o(o({},t),e);return{name:n.name,initialize:function(){var e,o,t,c,a,r,i,s=n.scriptSrc,l=n.collectorUrl,w=n.name,p=n.trackerSettings;if(!s)throw new Error("No Snowplow sp.js location defined");if(!l)throw new Error("No collector url defined");e=window,o=document,t="script",c=s,e[a="snowplow"]||(e.GlobalSnowplowNamespace=e.GlobalSnowplowNamespace||[],e.GlobalSnowplowNamespace.push(a),e[a]=function(){(e[a].q=e[a].q||[]).push(arguments)},e[a].q=e[a].q||[],r=o.createElement(t),i=o.getElementsByTagName(t)[0],r.async=1,r.src=c,i.parentNode.insertBefore(r,i)),snowplow("newTracker",w,l,p)},page:function(e){var o=e.payload.properties,t=n.name;c()||(snowplow("setCustomUrl:".concat(t),o.url),snowplow("setReferrerUrl:".concat(t),o.referrer),snowplow("trackPageView:".concat(t),o.title,o.contexts,o.dynamicContexts))},reset:function(){var e=n.name;c()||(snowplow("clearUserData:".concat(e)),snowplow("setUserId:".concat(e),void 0),snowplow("clearGlobalContexts:".concat(e)))},track:function(e){var o=e.payload,t=o.event,a=o.properties,r=n.name;c()||function(e,n,o){if(n&&o)switch(n.toLowerCase()){case"selfdescribingevent":case"unstructevent":snowplow("trackSelfDescribingEvent:".concat(e),{schema:o.schema,data:o.data},o.contexts);break;case"socialinteraction":snowplow("trackSocialInteraction:".concat(e),o.action,o.network,o.target,o.contexts);break;case"adimpression":snowplow("trackAdImpression:".concat(e),o.impressionId,o.costModel,o.cost,o.targetUrl,o.bannerId,o.zoneId,o.advertiserId,o.campaignId,o.contexts);break;case"adclick":snowplow("trackAdClick:".concat(e),o.targetUrl,o.clickId,o.costModel,o.cost,o.bannerId,o.zoneId,o.impressionId,o.advertiserId,o.campaignId,o.contexts);break;case"adconversion":snowplow("trackAdConversion:".concat(e),o.conversionId,o.cost,o.category,o.action,o.property,o.initialValue,o.advertiserId,o.costModel,o.campaignId,o.contexts);break;case"linkclick":snowplow("trackLinkClick:".concat(e),o.targetUrl,o.elementId,o.elementClasses,o.elementTarget,o.elementContent,o.contexts);break;case"addtocart":snowplow("trackAddToCart:".concat(e),o.sku,o.name,o.category,o.unitPrice,o.quantity,o.currency,o.contexts);break;case"removefromcart":snowplow("trackRemoveToCart:".concat(e),o.sku,o.name,o.category,o.unitPrice,o.quantity,o.currency,o.contexts);break;case"sitesearch":snowplow("trackSiteSearch:".concat(e),o.searchTerms,o.filters,o.resultsFound,o.resultsDisplayed,o.contexts);break;case"consentgranted":snowplow("trackConsentGranted:".concat(e),o.id,o.version,o.name,o.description,o.expiry,o.contexts);break;case"consentwithdrawn":snowplow("trackConsentWithdrawn:".concat(e),o.all,o.id,o.version,o.name,o.description,o.contexts);break;case"error":snowplow("trackError:".concat(e),o.message,o.filename,o.lineno,o.colno,o.error,o.contexts);break;case"enhancedecommerceactioncontext":snowplow("addEnhancedEcommerceActionContext:".concat(e),o.id,o.affiliation,o.revenue,o.tax,o.shipping,o.coupon,o.list,o.step,o.option,o.currency);break;case"enhancedecommerceimpressioncontext":snowplow("addEnhancedEcommerceImpressionContext:".concat(e),o.id,o.name,o.list,o.brand,o.category,o.variant,o.position,o.price,o.currency);break;case"enhancedecommerceproductcontext":snowplow("addEnhancedEcommerceProductContext:".concat(e),o.id,o.name,o.list,o.brand,o.category,o.variant,o.price,o.quantity,o.coupon,o.position,o.currency);break;case"enhancedecommercepromocontext":snowplow("addEnhancedEcommercePromoContext:".concat(e),o.id,o.name,o.creative,o.position,o.currency);break;case"enhancedecommerceaction":snowplow("trackEnhancedEcommerceAction:".concat(e),o.action);break;case"timing":snowplow("trackTiming:".concat(e),o.category,o.variable,o.timing,o.label,o.contexts);case"structevent":default:snowplow("trackStructEvent:".concat(e),o.category||"All",n||o.action,o.label,o.property,o.value,o.contexts)}}(r,t,a)},identify:function(e){var o=e.payload.userId,t=n.name;c()||o&&snowplow("setUserId:".concat(t),o)},loaded:function(){return!c()},methods:{enableActivityTracking:function(e,o){var t=n.name;snowplow("enableActivityTracking:".concat(t),e,o)},refreshLinkClickTracking:function(){var e=n.name;snowplow("refreshLinkClickTracking:".concat(e))},enableFormTracking:function(e,o){var t=n.name;snowplow("enableFormTracking:".concat(t),e||{},o||null)},enableGdprContext:function(e,o,t,c){var a=n.name;snowplow("enableGdprContext:".concat(a),e,o||null,t||null,c||null)},enableLinkClickTracking:function(e,o,t,c){var a=n.name;snowplow("enableLinkClickTracking:".concat(a),e||{},o||!0,t||!1,c||null)},enableErrorTracking:function(e,o){var t=n.name;snowplow("enableErrorTracking:".concat(t),e||null,o||null)},addGlobalContexts:function(e){var o=n.name,t=e.contexts;e.filterConditions&&(t=[e.filterConditions,t]),snowplow("addGlobalContexts:".concat(o),t)},removeGlobalContexts:function(e){var o=n.name;snowplow("removeGlobalContexts:".concat(o),e)},clearGlobalContexts:function(){var e=n.name;snowplow("clearGlobalContexts:".concat(e))},disableAnonymousTracking:function(e){var o=n.name;snowplow("disableAnonymousTracking:".concat(o),e)},enableAnonymousTracking:function(e){var o=n.name;snowplow("enableAnonymousTracking:".concat(o),e)}}}}}(); |
@@ -127,3 +127,3 @@ 'use strict'; | ||
return { | ||
NAMESPACE: config.name, | ||
name: config.name, | ||
initialize: function initialize() { | ||
@@ -130,0 +130,0 @@ var scriptSrc = config.scriptSrc, |
@@ -125,3 +125,3 @@ function _defineProperty(obj, key, value) { | ||
return { | ||
NAMESPACE: config.name, | ||
name: config.name, | ||
initialize: function initialize() { | ||
@@ -128,0 +128,0 @@ var scriptSrc = config.scriptSrc, |
@@ -59,3 +59,3 @@ 'use strict'; | ||
return { | ||
NAMESPACE: name, | ||
name: name, | ||
config: pluginConfig, | ||
@@ -62,0 +62,0 @@ |
@@ -57,3 +57,3 @@ var snowplow$1, emitter, tracker; | ||
return { | ||
NAMESPACE: name, | ||
name: name, | ||
config: pluginConfig, | ||
@@ -60,0 +60,0 @@ |
{ | ||
"name": "@analytics/snowplow", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Snowplow integration for 'analytics' module for browser & node", | ||
@@ -60,3 +60,3 @@ "projectMeta": { | ||
}, | ||
"gitHead": "9d45cc506cb9fa6038967df4985169f8fa22bc9e" | ||
"gitHead": "8da3f086a80377e6f5593028426f25ef323bcaac" | ||
} |
@@ -162,6 +162,6 @@ <!-- | ||
- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Snowplow Analytics | ||
- **[analytics.reset](https://getanalytics.io/api/#analyticsreset)** - Reset browser storage cookies & localstorage for Snowplow Analytics values | ||
- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Snowplow Analytics | ||
- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Snowplow Analytics | ||
- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Snowplow Analytics | ||
- **[analytics.reset](https://getanalytics.io/api/#analyticsreset)** - Reset browser storage cookies & localstorage for Snowplow Analytics values | ||
- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Snowplow Analytics | ||
- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Snowplow Analytics | ||
@@ -238,5 +238,5 @@ ### Browser API | ||
- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Snowplow Analytics | ||
- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Snowplow Analytics | ||
- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Snowplow Analytics | ||
- **[analytics.page](https://getanalytics.io/api/#analyticspage)** - Sends page views into Snowplow Analytics | ||
- **[analytics.track](https://getanalytics.io/api/#analyticstrack)** - Track custom events and send to Snowplow Analytics | ||
- **[analytics.identify](https://getanalytics.io/api/#analyticsidentify)** - Identify visitors and send details to Snowplow Analytics | ||
@@ -243,0 +243,0 @@ ### Server-side API |
134579