Enhanced Ecommerce

Overview

The Enhanced Ecommerce Demo Store is a sample ecommerce application with a complete implementation of Enhanced Ecommerce. 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 Google Tag Manager and the Enhanced Ecommerce (ec.js) plugin for analytics.js.

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
        }]
      }
    }
});