---
title: Sending an add to cart - Web
description: Send an add to cart event from your web page
source_url:
  html: https://docs.contentsquare.com/en/web/sending-an-add-to-cart/
  md: https://docs.contentsquare.com/en/web/sending-an-add-to-cart/index.md
---

> ## Documentation index
> Fetch the complete documentation index at: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.

The Add to cart event is available with **Experience Analytics Web** and **Merchandising**. The event is not available in **Experience Analytics Mobile**.

For **Experience Analytics Web**:

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(["trackPageEvent", "addToCart"]);
  window._uxa.push([
    "ec:cart:add",
    {
      merchant: window.location.hostname
    },
  ]);
</script>
```

For **Merchandising**, specify an SKU value identical to the value in the Product Catalogue:

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push([
    "ec:cart:add",
    {
      sku: "SKU_added_to_cart" /* mandatory */,
      merchant: window.location.hostname
    },
  ]);
</script>
```

You can also implement an add to cart in Google Tag Manager using the "Tracking Customization" tag: select `Add to cart` as Action type and supply the SKU.


```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Sending an add to cart","description":"Send an add to cart event from your web page","url":"https://docs.contentsquare.com/en/web/sending-an-add-to-cart/","inLanguage":"en","dateModified":"2025-09-30T15:39:12+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```