@analytics/snowplow
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.3](https://github.com/DavidWells/analytics/compare/@analytics/snowplow@0.2.2...@analytics/snowplow@0.2.3) (2021-01-14) | ||
**Note:** Version bump only for package @analytics/snowplow | ||
## [0.2.2](https://github.com/DavidWells/analytics/compare/@analytics/snowplow@0.2.1...@analytics/snowplow@0.2.2) (2020-12-23) | ||
@@ -8,0 +16,0 @@ |
@@ -38,3 +38,3 @@ var analyticsSnowplow = (function () { | ||
if (i % 2) { | ||
ownKeys(source, true).forEach(function (key) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
@@ -45,3 +45,3 @@ }); | ||
} else { | ||
ownKeys(source).forEach(function (key) { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
@@ -64,63 +64,63 @@ }); | ||
} | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
}; | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withServerAnonymisation] - Flag which prevents collector from returning and capturing cookies and capturing ip address (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
function snowplowPlugin$1() { | ||
function snowplowPlugin() { | ||
var pluginConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -428,2 +428,3 @@ | ||
* @param {boolean} anonymousTrackingArgs.withSessionTracking - Enables session tracking when enabling Anonymous Tracking | ||
* @param {boolean} anonymousTrackingArgs.withServerAnonymisation - Prevents collector from returning cookies and capturing ip address | ||
*/ | ||
@@ -592,3 +593,3 @@ enableAnonymousTracking: function enableAnonymousTracking(anonymousTrackingArgs) { | ||
var index = snowplowPlugin$1; | ||
var index = snowplowPlugin ; | ||
@@ -595,0 +596,0 @@ return index; |
@@ -1,1 +0,1 @@ | ||
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)}}}}}(); | ||
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(Object(c),!0).forEach((function(n){e(o,n,c[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(c)):n(Object(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}function a(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)}}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,r=o.properties,i=n.name;c()||a(i,t,r)},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)}}}}}(); |
@@ -37,3 +37,3 @@ 'use strict'; | ||
if (i % 2) { | ||
ownKeys(source, true).forEach(function (key) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
@@ -44,3 +44,3 @@ }); | ||
} else { | ||
ownKeys(source).forEach(function (key) { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
@@ -63,63 +63,63 @@ }); | ||
} | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
}; | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withServerAnonymisation] - Flag which prevents collector from returning and capturing cookies and capturing ip address (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
function snowplowPlugin$1() { | ||
function snowplowPlugin() { | ||
var pluginConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -427,2 +427,3 @@ | ||
* @param {boolean} anonymousTrackingArgs.withSessionTracking - Enables session tracking when enabling Anonymous Tracking | ||
* @param {boolean} anonymousTrackingArgs.withServerAnonymisation - Prevents collector from returning cookies and capturing ip address | ||
*/ | ||
@@ -591,4 +592,4 @@ enableAnonymousTracking: function enableAnonymousTracking(anonymousTrackingArgs) { | ||
var index = snowplowPlugin$1; | ||
var index = snowplowPlugin ; | ||
module.exports = index; |
@@ -35,3 +35,3 @@ function _defineProperty(obj, key, value) { | ||
if (i % 2) { | ||
ownKeys(source, true).forEach(function (key) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
@@ -42,3 +42,3 @@ }); | ||
} else { | ||
ownKeys(source).forEach(function (key) { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
@@ -61,63 +61,63 @@ }); | ||
} | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
}; | ||
/** | ||
* Snowplow analytics integration | ||
* @link https://getanalytics.io/plugins/snowplow/ | ||
* @link https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
* @param {Object} pluginConfig - Plugin settings | ||
* @param {string} pluginConfig.scriptSrc - Self-hosted Snowplow sp.js file location | ||
* @param {string} pluginConfig.collectorUrl - The URL to a Snowplow collector | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker, use if using multiple tracker instances ('snowplow' default) | ||
* @param {Object} [pluginConfig.trackerSettings] - The arg map to pass to the Snowplow Tracker | ||
* @param {string} [pluginConfig.trackerSettings.appId] - The appId to identify this application | ||
* @param {string} [pluginConfig.trackerSettings.platform] - Platform of tracking ("web" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieDomain] - Domain to set cookie against | ||
* @param {string} [pluginConfig.trackerSettings.discoverRootDomain] - Automatically discover root domain | ||
* @param {string} [pluginConfig.trackerSettings.cookieName] - Prefix for cookies ("_sp_" default) | ||
* @param {string} [pluginConfig.trackerSettings.cookieSameSite] - SameSite cookie setting ("None" default) | ||
* @param {boolean} [pluginConfig.trackerSettings.cookieSecure] - Secure cookie setting (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.encodeBase64] - Encode JSON objects as Base64 (true default) | ||
* @param {bolean} [pluginConfig.trackerSettings.respectDoNotTrack] - Respect do not track (consider analytics-plugin-do-not-track) (false default) | ||
* @param {number} [pluginConfig.trackerSettings.pageUnloadTimer] - Timeout in ms to block page navigation until buffer is empty (500 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.forceSecureTracker] - Forces requests to be sent https (false default) | ||
* @param {string} [pluginConfig.trackerSettings.eventMethod] - Method to send events, GET, POST, Beacon (POST default) | ||
* @param {number} [pluginConfig.trackerSettings.bufferSize] - Amount of events to buffer before sending (1 default) | ||
* @param {number} [pluginConfig.trackerSettings.maxPostBytes] - Maximum size of POST or Beacon before sending (40000 default) | ||
* @param {string} [pluginConfig.trackerSettings.crossDomainLinker] - function to configure which links to add cross domain linking | ||
* @param {number} [pluginConfig.trackerSettings.cookieLifetime] - Cookie lifetime (63072000 default) | ||
* @param {string} [pluginConfig.trackerSettings.stateStorageStrategy] - Use cookies and/or localstorage ("cookieAndLocalStorage" default) | ||
* @param {number} [pluginConfig.trackerSettings.maxLocalStorageQueueSize] - Maximum numbers of events to buffer in localstorage to prevent filling local storage (1000 default) | ||
* @param {boolean} [pluginConfig.trackerSettings.resetActivityTrackingOnPageView] - Flag to decide whether to reset page ping timers on virtual page view (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.connectionTimeout] - The timeout, in milliseconds, before GET and POST requests will timeout (5000 default) (Snowplow JS 2.15.0+) | ||
* @param {string[]} [pluginConfig.trackerSettings.skippedBrowserFeatures] - Array to skip browser feature collection ([] default) (Snowplow JS 2.15.0+) | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.anonymousTracking] - Flag to enable anonymous tracking functionality (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withSessionTracking] - Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | ||
* @param {boolean} [pluginConfig.trackerSettings.anonymousTracking.withServerAnonymisation] - Flag which prevents collector from returning and capturing cookies and capturing ip address (false default) | ||
* @param {Object} [pluginConfig.trackerSettings.contexts] - The auto contexts for each event | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.webPage] - The webpage context, containing the page view id. (true default) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.performanceTiming] - Add performance timing information | ||
* @param {(Object|boolean)} [pluginConfig.trackerSettings.contexts.clientHints] - Add Client Hint information (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.clientHints.includeHighEntropy] - Capture High Entropy Client Hints (Snowplow JS 2.15.0+) | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.gaCookies] - Add gaCookie information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.geolocation] - Add browser geolocation information | ||
* @param {boolean} [pluginConfig.trackerSettings.contexts.optimizelyXSummary] - Add browser geolocation information | ||
* @return {Object} Analytics plugin | ||
* | ||
* @example | ||
* | ||
* // Minimal recommended configuration | ||
* snowplowPlugin({ | ||
* name: 'snowplow', | ||
* scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
* collectorUrl: 'collector.mysite.com', | ||
* trackerSettings: { | ||
* appId: 'myApp', | ||
* contexts: { | ||
* webPage: true | ||
* } | ||
* } | ||
* }) | ||
*/ | ||
function snowplowPlugin$1() { | ||
function snowplowPlugin() { | ||
var pluginConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -425,2 +425,3 @@ | ||
* @param {boolean} anonymousTrackingArgs.withSessionTracking - Enables session tracking when enabling Anonymous Tracking | ||
* @param {boolean} anonymousTrackingArgs.withServerAnonymisation - Prevents collector from returning cookies and capturing ip address | ||
*/ | ||
@@ -589,4 +590,4 @@ enableAnonymousTracking: function enableAnonymousTracking(anonymousTrackingArgs) { | ||
var index = snowplowPlugin$1; | ||
var index = snowplowPlugin ; | ||
export default index; |
'use strict'; | ||
var snowplow$1, emitter, tracker; | ||
var snowplow, gotEmitter, tracker; | ||
{ | ||
snowplow$1 = require('snowplow-tracker'); | ||
emitter = snowplow$1.emitter; | ||
tracker = snowplow$1.tracker; | ||
snowplow = require('snowplow-tracker'); | ||
gotEmitter = snowplow.gotEmitter; | ||
tracker = snowplow.tracker; | ||
} | ||
@@ -18,6 +18,7 @@ /** | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker ('snowplow' default) | ||
* @param {string} [pluginConfig.protocol] - http or https (https default) | ||
* @param {string} [pluginConfig.port] - collector port (80 default) | ||
* @param {string} [pluginConfig.method] - The method to send events to collector, POST or GET (POST default) | ||
* @param {string} [pluginConfig.protocol] - 'http' or 'https' ('https' default) | ||
* @param {string} [pluginConfig.port] - collector port (80 or 443 default) | ||
* @param {string} [pluginConfig.method] - The method to send events to collector, 'post' or 'get' ('post' default) | ||
* @param {string} [pluginConfig.bufferSize] - Only send events once n are buffered. Defaults to 1 for GET requests and 10 for POST requests. | ||
* @param {string} [pluginConfig.retries] - The number of times the tracker will try to resend an event. Defaults to 5. | ||
* @param {string} [pluginConfig.maxSockets] - Node.js agentOptions object to tune performance (6 default) | ||
@@ -54,5 +55,9 @@ * @param {string} [pluginConfig.platform] - Sets the platform https://bit.ly/302dSQy ('srv' default) | ||
var name = pluginConfig.name || 'snowplow'; | ||
var e = emitter(pluginConfig.collectorUrl, pluginConfig.protocol || 'https', pluginConfig.port, pluginConfig.method || 'POST', pluginConfig.bufferSize, null, { | ||
maxSockets: pluginConfig.maxSockets || 6 // Node.js agentOptions object to tune performance | ||
var e = gotEmitter(pluginConfig.collectorUrl, pluginConfig.protocol.toLowerCase() || 'https', pluginConfig.port, pluginConfig.method.toLowerCase() || 'post', pluginConfig.bufferSize, pluginConfig.retries || 5, null, { | ||
http: new http.Agent({ | ||
maxSockets: pluginConfig.maxSockets || 6 | ||
}), | ||
https: new https.Agent({ | ||
maxSockets: pluginConfig.maxSockets || 6 | ||
}) | ||
}); | ||
@@ -221,66 +226,4 @@ var t = tracker([e], name, pluginConfig.appId, false); | ||
/** | ||
* @typedef {Object} Context | ||
* @property {string} schema - The Schema which describes the context | ||
* @property {Object} data - The data object which conforms to the schema | ||
*/ | ||
var index = snowplowPlugin; | ||
/** | ||
* A function which determines which links should be tracked | ||
* @callback linkClickFilter | ||
* @param {Object} element | ||
* @return {boolean} true if the element should be tracked | ||
*/ | ||
/** | ||
* A function which determines which ErrorEvents should be tracked | ||
* @callback errorFilter | ||
* @param {Object} errorEvent | ||
* @return {boolean} true if the error should be tracked | ||
*/ | ||
/** | ||
* A function which determines which ErrorEvents should be tracked | ||
* @callback errorContexts | ||
* @param {Object} errorEvent | ||
* @return {Context[]} Array of contexts to be included with the error tracking event | ||
*/ | ||
/** | ||
* A function which determines which fields should be tracked | ||
* @callback formFieldsFilter | ||
* @param {Object} formElement | ||
* @return {boolean} true if the form field should be tracked | ||
*/ | ||
/** | ||
* Transforms a form elements value | ||
* @callback formFieldsTransform | ||
* @param {Object} formElement | ||
* @return {string} The value to replace this form elements value with | ||
*/ | ||
/** | ||
* @typedef {Object} GlobalContexts | ||
* @property {Context[]} contexts - The contexts to add | ||
* @property {GlobalContextFilter|GlobalContextRuleset} [filterConditions] - The Schema which describes the context | ||
*/ | ||
/** | ||
* A function which determines which contexts should be sent | ||
* @callback GlobalContextFilter | ||
* @param {Object} event | ||
* @param {string} event.eventType This argument is a string taken from the event payload field, e. e.g. pv, pp, se | ||
* @param {string} event.eventSchema The schema of the event | ||
* @return {boolean} true if the context should be included with the event | ||
*/ | ||
/** | ||
* @typedef {Object} GlobalContextRuleset | ||
* @property {string[]} [accept] - A list of schemas to attach this context to | ||
* @property {string[]} [reject] - A list of schemas to not attach this context too | ||
*/ | ||
var index = snowplowPlugin; | ||
module.exports = index; |
@@ -1,7 +0,7 @@ | ||
var snowplow$1, emitter, tracker; | ||
var snowplow, gotEmitter, tracker; | ||
{ | ||
snowplow$1 = require('snowplow-tracker'); | ||
emitter = snowplow$1.emitter; | ||
tracker = snowplow$1.tracker; | ||
snowplow = require('snowplow-tracker'); | ||
gotEmitter = snowplow.gotEmitter; | ||
tracker = snowplow.tracker; | ||
} | ||
@@ -16,6 +16,7 @@ /** | ||
* @param {string} [pluginConfig.name] - The name to identify this instance of the tracker ('snowplow' default) | ||
* @param {string} [pluginConfig.protocol] - http or https (https default) | ||
* @param {string} [pluginConfig.port] - collector port (80 default) | ||
* @param {string} [pluginConfig.method] - The method to send events to collector, POST or GET (POST default) | ||
* @param {string} [pluginConfig.protocol] - 'http' or 'https' ('https' default) | ||
* @param {string} [pluginConfig.port] - collector port (80 or 443 default) | ||
* @param {string} [pluginConfig.method] - The method to send events to collector, 'post' or 'get' ('post' default) | ||
* @param {string} [pluginConfig.bufferSize] - Only send events once n are buffered. Defaults to 1 for GET requests and 10 for POST requests. | ||
* @param {string} [pluginConfig.retries] - The number of times the tracker will try to resend an event. Defaults to 5. | ||
* @param {string} [pluginConfig.maxSockets] - Node.js agentOptions object to tune performance (6 default) | ||
@@ -52,5 +53,9 @@ * @param {string} [pluginConfig.platform] - Sets the platform https://bit.ly/302dSQy ('srv' default) | ||
var name = pluginConfig.name || 'snowplow'; | ||
var e = emitter(pluginConfig.collectorUrl, pluginConfig.protocol || 'https', pluginConfig.port, pluginConfig.method || 'POST', pluginConfig.bufferSize, null, { | ||
maxSockets: pluginConfig.maxSockets || 6 // Node.js agentOptions object to tune performance | ||
var e = gotEmitter(pluginConfig.collectorUrl, pluginConfig.protocol.toLowerCase() || 'https', pluginConfig.port, pluginConfig.method.toLowerCase() || 'post', pluginConfig.bufferSize, pluginConfig.retries || 5, null, { | ||
http: new http.Agent({ | ||
maxSockets: pluginConfig.maxSockets || 6 | ||
}), | ||
https: new https.Agent({ | ||
maxSockets: pluginConfig.maxSockets || 6 | ||
}) | ||
}); | ||
@@ -219,66 +224,4 @@ var t = tracker([e], name, pluginConfig.appId, false); | ||
/** | ||
* @typedef {Object} Context | ||
* @property {string} schema - The Schema which describes the context | ||
* @property {Object} data - The data object which conforms to the schema | ||
*/ | ||
var index = snowplowPlugin; | ||
/** | ||
* A function which determines which links should be tracked | ||
* @callback linkClickFilter | ||
* @param {Object} element | ||
* @return {boolean} true if the element should be tracked | ||
*/ | ||
/** | ||
* A function which determines which ErrorEvents should be tracked | ||
* @callback errorFilter | ||
* @param {Object} errorEvent | ||
* @return {boolean} true if the error should be tracked | ||
*/ | ||
/** | ||
* A function which determines which ErrorEvents should be tracked | ||
* @callback errorContexts | ||
* @param {Object} errorEvent | ||
* @return {Context[]} Array of contexts to be included with the error tracking event | ||
*/ | ||
/** | ||
* A function which determines which fields should be tracked | ||
* @callback formFieldsFilter | ||
* @param {Object} formElement | ||
* @return {boolean} true if the form field should be tracked | ||
*/ | ||
/** | ||
* Transforms a form elements value | ||
* @callback formFieldsTransform | ||
* @param {Object} formElement | ||
* @return {string} The value to replace this form elements value with | ||
*/ | ||
/** | ||
* @typedef {Object} GlobalContexts | ||
* @property {Context[]} contexts - The contexts to add | ||
* @property {GlobalContextFilter|GlobalContextRuleset} [filterConditions] - The Schema which describes the context | ||
*/ | ||
/** | ||
* A function which determines which contexts should be sent | ||
* @callback GlobalContextFilter | ||
* @param {Object} event | ||
* @param {string} event.eventType This argument is a string taken from the event payload field, e. e.g. pv, pp, se | ||
* @param {string} event.eventSchema The schema of the event | ||
* @return {boolean} true if the context should be included with the event | ||
*/ | ||
/** | ||
* @typedef {Object} GlobalContextRuleset | ||
* @property {string[]} [accept] - A list of schemas to attach this context to | ||
* @property {string[]} [reject] - A list of schemas to not attach this context too | ||
*/ | ||
var index = snowplowPlugin; | ||
export default index; |
{ | ||
"name": "@analytics/snowplow", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Snowplow integration for 'analytics' module for browser & node", | ||
@@ -58,5 +58,5 @@ "projectMeta": { | ||
"dependencies": { | ||
"snowplow-tracker": "^0.3.0" | ||
"snowplow-tracker": "^0.4.0" | ||
}, | ||
"gitHead": "8da3f086a80377e6f5593028426f25ef323bcaac" | ||
"gitHead": "bf040feee18d72d29df9f7a86504eb50c044e8c2" | ||
} |
@@ -56,3 +56,3 @@ <!-- | ||
name: 'snowplow', | ||
scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
collectorUrl: 'collector.mysite.com', | ||
@@ -180,3 +180,3 @@ trackerSettings: { | ||
name: 'snowplow', | ||
scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
collectorUrl: 'collector.mysite.com', | ||
@@ -226,2 +226,3 @@ trackerSettings: { | ||
| `trackerSettings.anonymousTracking.withSessionTracking` <br/>_optional_ - boolean| Flag to enable whether to continue tracking sessions in anonymous tracking mode (false default) | | ||
| `trackerSettings.anonymousTracking.withServerAnonymisation` <br/>_optional_ - boolean| Flag which prevents collector from returning and capturing cookies and capturing ip address (false default) | | ||
| `trackerSettings.contexts` <br/>_optional_ - Object| The auto contexts for each event | | ||
@@ -270,6 +271,7 @@ | `trackerSettings.contexts.webPage` <br/>_optional_ - boolean| The webpage context, containing the page view id. (true default) | | ||
| `name` <br/>_optional_ - string| The name to identify this instance of the tracker ('snowplow' default) | | ||
| `protocol` <br/>_optional_ - string| http or https (https default) | | ||
| `port` <br/>_optional_ - string| collector port (80 default) | | ||
| `method` <br/>_optional_ - string| The method to send events to collector, POST or GET (POST default) | | ||
| `protocol` <br/>_optional_ - string| 'http' or 'https' ('https' default) | | ||
| `port` <br/>_optional_ - string| collector port (80 or 443 default) | | ||
| `method` <br/>_optional_ - string| The method to send events to collector, 'post' or 'get' ('post' default) | | ||
| `bufferSize` <br/>_optional_ - string| Only send events once n are buffered. Defaults to 1 for GET requests and 10 for POST requests. | | ||
| `retries` <br/>_optional_ - string| The number of times the tracker will try to resend an event. Defaults to 5. | | ||
| `maxSockets` <br/>_optional_ - string| Node.js agentOptions object to tune performance (6 default) | | ||
@@ -523,3 +525,3 @@ | `platform` <br/>_optional_ - string| Sets the platform https://bit.ly/302dSQy ('srv' default) | | ||
name: 'snowplow', | ||
scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
collectorUrl: 'collector.mysite.com', | ||
@@ -652,3 +654,3 @@ trackerSettings: { | ||
name: 'snowplow', | ||
scriptSrc: '//*.cloudfront.net/2.15.0/sp.js', | ||
scriptSrc: '//*.cloudfront.net/2.17.0/sp.js', | ||
collectorUrl: 'collector.mysite.com', | ||
@@ -655,0 +657,0 @@ trackerSettings: { |
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
757
132480
1971
+ Added@sindresorhus/is@4.6.0(transitive)
+ Added@szmarczak/http-timer@4.0.6(transitive)
+ Added@types/cacheable-request@6.0.3(transitive)
+ Added@types/http-cache-semantics@4.0.4(transitive)
+ Added@types/keyv@3.1.4(transitive)
+ Added@types/node@22.10.6(transitive)
+ Added@types/responselike@1.0.3(transitive)
+ Addedcacheable-lookup@5.0.4(transitive)
+ Addedcacheable-request@7.0.4(transitive)
+ Addedclone-response@1.0.3(transitive)
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddefer-to-connect@2.0.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedgot@11.8.6(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedhttp2-wrapper@1.0.3(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlowercase-keys@2.0.0(transitive)
+ Addedmimic-response@1.0.13.1.0(transitive)
+ Addednormalize-url@6.1.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-cancelable@2.1.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquick-lru@5.1.1(transitive)
+ Addedresolve-alpn@1.2.1(transitive)
+ Addedresponselike@2.0.1(transitive)
+ Addedsnowplow-tracker@0.4.4(transitive)
+ Addedsnowplow-tracker-core@0.9.4(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsnowplow-tracker@0.3.0(transitive)
- Removedsnowplow-tracker-core@0.5.0(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@2.0.3(transitive)
- Removedverror@1.10.0(transitive)
Updatedsnowplow-tracker@^0.4.0