For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/plugins/ecommerce.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/api-reference/llms.txt.
Ecommerce
caution
You are reading documentation for an outdated version. Here's the latest one!
Installation
npm install @snowplow/browser-plugin-ecommerceyarn add @snowplow/browser-plugin-ecommercepnpm add @snowplow/browser-plugin-ecommerce
Initialization
javascript
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
| Documentation |
addItem | Documentation |
trackTrans | Documentation |
trackAddToCart | Documentation |
trackRemoveFromCart | Documentation |
Context
This plugin does not add any additional data to context of an event.