Enhanced Ecommerce

Overview

The

is a sample ecommerce application with a complete implementation of . Use this demo to understand how the Enhanced Ecommerce code works, and what is required to implement it on your own site.

A screenshot from the Enhanced Ecommerce demo.

Every action in this demo comes with code samples showing exactly how the feature is implemented. The samples include code for both

and the plugin for .

The following is an example "Add to cart" event:

dataLayer.push({
  "event": "addToCart",
    "ecommerce": {
      "currencyCode": "USD",
      "add": {
        "products": [{
          "id": "57b9d",
          "name": "Kiosk T-Shirt",
          "price": "55.00",
          "brand": "Kiosk",
          "category": "T-Shirts",
          "variant": "red",
          "dimension1": "M",
          "quantity": 1
        }]
      }
    }
});