# Add to Cart Tracking

## Add to Cart Tracking

Use the `addtocart` tracking type to capture when a user adds a product to their shopping cart. This action marks a critical e-commerce event and should be accurately tracked with both product and interaction data.

### Tracking Commands

* `product`
* `addtocart`

{% hint style="info" %}
As defined, the `addtocart` event automatically activates the [jentis-data-layer-state](https://docs.jentis.com/developer-guide/states/jentis-data-layer-state "mention") in JENTIS using the `sendBeacon` sending method.
{% endhint %}

### Example

```javascript
_jts.push({
  track: "product",
  type: "addtocart",
  id: "12345567",
  name: "Product Name"
});

_jts.push({
  track: "addtocart"
});
```

### Properties for `addtocart`

The `addtocart` command itself does not have additional properties. All relevant data should be submitted with the associated `product` object.

Make sure to use `type: "addtocart"` on the product to associate it correctly with this interaction.

For tracking product quantities, pricing, and custom variables, refer to the [](https://docs.jentis.com/data-capture/web-tracking-setup/set-up-jentis-data-layer/e-commerce-tracking "mention").
