Skip to main content

Ecommerce

Installationโ€‹

  • npm install @snowplow/browser-plugin-ecommerce
  • yarn add @snowplow/browser-plugin-ecommerce
  • pnpm add @snowplow/browser-plugin-ecommerce

Initializationโ€‹

import { newTracker, trackPageView } from '@snowplow/browser-tracker';
import { EcommercePlugin, addTrans, addItem, trackTrans } from '@snowplow/browser-plugin-ecommerce';

newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ EcommercePlugin() ],
});

Functionsโ€‹

addTransDocumentation
addItemDocumentation
trackTransDocumentation
trackAddToCartDocumentation
trackRemoveFromCartDocumentation

Contextโ€‹

This plugin does not add any additional data to context of an event.

Was this page helpful?