---
title: The E-commerce tag - Web
description: The e-commerce tag is used to keep track of the e-commerce transactions happening on the site and empower analysis with revenue-related metrics
lastUpdated: 05 December 2025
source_url:
  html: https://docs.contentsquare.com/en/web/ecommerce-tag/
  md: https://docs.contentsquare.com/en/web/ecommerce-tag/index.md
---

The e-commerce tag is used to keep track of the e-commerce transactions happening on the site and empower analysis with revenue-related metrics.

It needs to be **fired a single time on the confirmation page**, after the transaction has been finalised, and needs the following **mandatory parameters** in order to function:

* Transaction ID, which is the unique identifier for that transaction
* Revenue, which is the total amount of the purchase

You can also include the following **optional** parameters:

* Currency, which is the currency used for the purchase and also in our platform for a potential conversion. [Full technical documentation firing the e-commerce tag...](https://docs.contentsquare.com/en/web/sending-ecommerce-commands/)

## Google Tag Manager (Template)

1. Open your container and go to the **templates** section ![](https://docs.contentsquare.com/_astro/main-1.BR8xO2Cv_Z1Rabw1.webp)

2. Select **Search gallery** ![](https://docs.contentsquare.com/_astro/main-2.CDPvDirB_Z1usb2F.webp)

3. Type in **`contentsquare`** and select the **Contentsquare - E-commerce data** option ![](https://docs.contentsquare.com/_astro/ecom-1.BkWZawpg_2hYQ9E.webp)

4. Click **Add to workspace** ![](https://docs.contentsquare.com/_astro/ecom-2.zNwJePJW_x7Sgp.webp)

5. Confirm your choice by selecting **Add** ![](https://docs.contentsquare.com/_astro/ecom-3.h-EKq9Gy_ZW3R8k.webp)

6. Go to the Tags section and click the **New** button to create a new tag ![](https://docs.contentsquare.com/_astro/add-tag.DuGAskV4_1e0yKr.webp)

7. Configure it by selecting the top-right button ![](https://docs.contentsquare.com/_astro/tag-config.krkkPQIC_19Jyy1.webp)

8. Search for **`contentsquare`** and select the **Contentsquare - E-commerce data** template that you've previously added to your container. ![](https://docs.contentsquare.com/_astro/new-ecom.CEiMu1qg_Z8Oh3s.webp)

9. Give a title to the tag and add your **GTM Variables** to the **Transaction IDs** and **Revenue** fields.

   Make sure to select a trigger that fires only on the confirmation page, or on all the pages that are needed to keep track of transactions, on which **your variables are going to be populated**.

   ![](https://docs.contentsquare.com/_astro/ecom-4.DaK0sUes_Z2catTS.webp)

10. If you would like to send Contentsquare the **currency** value as well, fill in the **optional parameters** section. ![](https://docs.contentsquare.com/_astro/ecom-5.DE5FwQqN_Z1tVX7L.webp)

11. Save your changes and go back to your container. You should now see both the template and the newly created tag.

## Google Tag Manager (Custom HTML)

1. Create a new tag and paste the following code in the **HTML field**:

   ```html
   <script type="text/javascript">
     window._uxa = window._uxa || [];
     window._uxa.push([
       "ec:transaction:create",
       {
         id: "{{YOUR ID HERE}}",
         revenue: "{{YOUR REVENUE HERE}}",
         currency: "{{CURRENCY ISO CODE HERE}}"
       },
     ]);
     window._uxa.push(["ec:transaction:send"]);
   </script>
   ```

2. Inside the script, **replace all the placeholder variables** with your GTM values (using the double brace notation: `{{transaction id}}`, `{{transaction revenue}}`).

   These variables must be available in the "Variables" section of Google Tag Manager.

3. In the trigger list, select the "Confirmation page", or create one if it doesn't exist.

   * Select the "+" on the top right,
   * Select "Choose a trigger type to begin setup..."
   * Pick "Window Loaded"
   * You don't want this to be trigger on every page, so choose "Some Window Loaded Events"
   * Add a condition to match only the confirmation page — for instance, `"Page URL" contains "checkout/confirmation"`
   * Save and name your trigger "Confirmation page"

## Tealium

The Tealium extension will **automatically fire the Contentsquare transaction code** as soon as the transaction values defined have been populated in your `utag` datalayer.

## Adobe Launch

Navigate to **Rules**, and open an existing rule or create a new one.

### Event Configuration

The E-commerce tag **needs to be fired once on the confirmation page**, after a transaction has been made and needs to be tracked. In order to do so, **specify the path or the event** to be used as a trigger. For example, if you want to target the confirmation page, you could use a similar condition:

![](https://docs.contentsquare.com/_astro/10.BLv1Zd3J_DxnDO.webp)

If you have chosen the event+condition route, your setup should look similar to this:

![](https://docs.contentsquare.com/_astro/11.DCr_kpv__ZgWRCS.webp)

### Action Configuration

Select the **Contentsquare** extension and then **Ecommerce Transactions** as the action type.

![](https://docs.contentsquare.com/_astro/13.d9KpvqpB_Z2qhtY2.webp)

You will then be prompted to fill in the required information by using either strings or Data Elements.

![](https://docs.contentsquare.com/_astro/14.Ba2KZqV3_iNSx4.webp)

Given the dynamic nature of transaction details, **it is required to have previously setup Data Elements with the requested information**.

![](https://docs.contentsquare.com/_astro/15.DnpC2NyQ_ZVmYof.webp)

## Commanders Act

1. Add a new tag to your container by choosing "Contentsquare (Builder)". ![](https://docs.contentsquare.com/_astro/containers-zoom.DWWiRczJ_Z1DyX0u.webp)

2. Set the right Contentsquare template selecting **Ecommerce**. ![](https://docs.contentsquare.com/_astro/tag-type.DNH2ItCP_Z1m1jxs.webp)

3. Fill in all required fields with your Commanders Act variables. ![](https://docs.contentsquare.com/_astro/transaction-vars.ic-msuV4_Z1pJCps.webp)

4. (Optional) If your transactions have different currencies, send Contentsquare the currency value. ![](https://docs.contentsquare.com/_astro/currency.BXhXARDl_gc13D.webp)

5. (Optional) If you are a merchandising customer, add items.

6. Select a trigger/perimeter that fires only on the confirmation page, and click **Save**.

Your Tag is ready to be deployed.

## Shopify

The Contentsquare Shopify app automatically collects e-commerce transaction data during the checkout flow, eliminating the need for manual tagging.

**No additional configuration is required** — once the app is installed and configured, transaction data (order ID, revenue, and currency) is automatically captured on checkout completion.

For installation instructions, see [Shopify app installation](https://docs.contentsquare.com/en/web/#shopify).

## Custom HTML

Supply the transaction ID, revenue, and currency ISO code as parameters to the [`ec:transaction:create`](https://docs.contentsquare.com/en/web/command-reference/#ectransactioncreate) command.

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(['ec:transaction:create', {
      'id': {{TRANSACTION_ID}},
      'revenue': {{TRANSACTION_REVENUE}},
      'currency': {{CURRENCY_ISO_CODE}}
  }]);
</script>
```

Then execute the [`ec:transaction:send`](https://docs.contentsquare.com/en/web/command-reference/#ectransactionsend) command to send the transaction to Contentsquare.

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(['ec:transaction:create', {
      'id': {{TRANSACTION_ID}},
      'revenue': {{TRANSACTION_REVENUE}},
      'currency': {{CURRENCY_ISO_CODE}}
  }]);
  window._uxa.push(['ec:transaction:send']);
</script>
```
