Skip to content

Analytics Tracking and The Data Layer

The Thirstie EComm Vue components push structured events to window.dataLayer automatically at key points in the shopping flow. The table below lists every event name and the moment it is triggered.

Event NameWhen the event is triggeredData tracked
age_gateuser passes age gateage gate type ("dob" vs "yesno")
enter_addressuser enters an addresszipcode for address
validate_addressuser valid address is validated and in coveragezipcode for address
unavailable_addressuser enters an unavailable addresszipcode for address
enter_promo_codevalid promo code is enteredpromo_code entered
remove_promo_codevalid promo code is removedpromo_code removed
invalid_promo_codean invalid promo code is entered during paymentpromo_code entered
view_item_listproduct list is shown on the pageecommerce payload
view_itemproduct detail page (PDP) is shownecommerce payload
cart_loadedon each page load if the user has an active shopping cartecommerce payload
add_to_cartproduct is added to the cartecommerce payload
remove_from_cartproduct is removed from the cartecommerce payload
view_cartuser views their shopping cartecommerce payload
begin_checkoutthe checkout process startsecommerce payload
add_shipping_infoshipping information is completely enteredecommerce payload
add_payment_infouser submits payment detailsecommerce payload
purchaseuser completes a purchaseecommerce payload

Ecommerce Payload Schema

js
ecommerce: {
    currency: "USD",
    value: 79.98, // Total cart value
    cart_id: "CART12345",
    items: [
      {
        item_id: "SKU_12345",
        item_name: "Example Product 1",
        affiliation: "Example Store",
        price: 29.99,
        quantity: 1,
        item_brand: "Brand A",
        item_category: "Category A",
        item_variant: "Variant 1"
      },
      {
        item_id: "SKU_12346",
        item_name: "Example Product 2",
        affiliation: "Example Store",
        price: 49.99,
        quantity: 1,
        item_brand: "Brand B",
        item_category: "Category B",
        item_variant: "Variant 2"
      }
    ]
  }

About Google Tag Manager (GTM)

Google Tag Manager (GTM) is a tag management system that lets you add and update tracking scripts on your site without modifying code directly. It works through a JavaScript array called the data layer — a shared communication channel between your site and GTM. When something meaningful happens (a product is viewed, an item is added to cart, a purchase completes), your site pushes an event object onto the data layer. GTM listens for those events and uses them to fire the appropriate tags, such as Google Analytics or Meta Pixel, based on rules you define in the GTM interface.