# Ecommerce
> Documentation for Ecommerce in the web tracker.
> Source: https://docs.snowplow.io/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/plugins/ecommerce/
> Documentation index: https://docs.snowplow.io/llms.txt
> Status: Previous version
> Current version: https://docs.snowplow.io/docs/sources/web-trackers/

## Installation

- `npm install @snowplow/browser-plugin-ecommerce`
- `yarn add @snowplow/browser-plugin-ecommerce`
- `pnpm 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

|                       |                                                                                                                                                    |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `addTrans`            | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#addTrans)                               |
| `addItem`             | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#addItem)                                |
| `trackTrans`          | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#trackTrans)                             |
| `trackAddToCart`      | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#trackAddToCart_and_trackRemoveFromCart) |
| `trackRemoveFromCart` | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#trackAddToCart_and_trackRemoveFromCart) |

### Context

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