TABLE OF CONTENTS |
Overview
Triggers, Tags, Variables & the Data Layer - What are they?
From Google Tag Manager Help:
- Tag: A tag is code that send data to a system such as Google Analytics.
- Trigger: A trigger listens for certain events, such as clicks, form submissions, or page loads. When an event is detected that matches the trigger definition, any tags that reference that trigger will fire.
- Variable: A variable is a named placeholder for a value that will change, such as a product name, a price value, or a date.
- Data layer: Tag manager implements a data layer to temporarily hold values in the client so that they can be used by tags, triggers, and variables.
ACME's Data Layer
Universal Analytics (depreciated)
ACME's original Universal Analytics solution relied on a series of custom Variables and Triggers. If you implemented this prior to GA4, you may still have these present in your GTM Container. These included:
- Triggers: Interaction, Product
- Variables: Event Action, Event Category, Event Label, etc.
For a full list, see the Data Layer Example below.
Note: ACME will eventually deprecate the fields that were in place for Universal Analytics - advanced notification will be provided regarding timing. As such, if you are still utilizing these original fields, we recommend switching to the ones implemented for GA4.GA4/GTM (current)
The current data layer follows Google's Recommended Events. Currently support is in place for a purchase event, with data sending through the data layer as described in Google's documentation. Refer to the ACME Mappings: ACME Google Analytics Mapping: UA > GA4 to see how the parameters play out for GA4 and GTM.
Note: For those who migrated from Universal Analytics, a tab is included in that document with the original fields that would have been used before UA was replaced.Additional Helpful Resources
Keys to Understanding ACME's Data Layer for GA4/GTM
Purchase Event
The purchase event triggers when a product is successfully purchased & the user is shown the confirmation page. If multiple items are purchased, they will all be included as Items in a single purchase event.
For those tracking revenue, the value and transaction_id are key:
- value - the total of the order (e.g. total of all items, with any applicable discounts applied)
- transaction_id - the unique order number. Google documents the importance of using this on https://support.google.com/google-ads/answer/6386790
Note: ACME's original implementation for Universal Analytics relied on custom triggers named "Product Trigger", which fired on order completion. As ACME will eventually deprecate this trigger, we recommend shifting to the purchase event instead.Items Sold
All items sold online via ACME B2C are returned in the ACME Data Layer. This includes Event Tickets & Add-ons, Combo Event Tickets & Add-ons, Memberships, and Donations. This is tracked with "item_category5". Refer to the ACME Mappings: ACME Google Analytics Mapping for details & examples.
When it comes to what's sold, you may want to slice and dice your sales in various ways. For example:
- You may be interested to report on sales at the Event level (e.g. all "Admissions" event revenue) and/or the Item level (e.g. all "Adult" ticket revenue" or all "Audio Tour" add-on revenue).
- Or you may be interested to report on revenue for Events vs Memberships vs Donations.
We've made this possible with how the data layer is constructed. We send each unique item in the "items" array, utilizing the five item_category fields to help you slice and dice your data in different ways. Using the same above example use cases:
- To report on sales at the Event vs Item level...
- Event level (e.g. Admissions Event)
- Filter on "item_category5" = Event
- (Optional) Filter on "item_category" = Admissions"
- Sum up the price across all items
- Item level (e.g. Adult ticket)
- Filter on "item_category4" = "Adult"
- Sum up the price across all items
- Event level (e.g. Admissions Event)
- To report on revenue for Events vs Memberships vs Donations
- Group by "item_category5"
- Sum up the price across all items
Note: ACME's original implementation for Universal Analytics returned a Product Trigger with the confirmation page per item purchased, with two firing for Event sales (one for the Event and one for the Ticket/Add-on). This was originally done to give you the flexibility to track revenue both per Event (e.g. all "Admissions" event revenue) and per Ticket type (e.g. all "Adult" ticket revenue) or Add-on (e.g. all "Audio Tour" add-on revenue). As such, if your code relies on the "Price" variable firing from a Product Trigger, be sure your code handles accordingly to not mistakenly inflate revenue totals.GA4 (current) vs Universal Analytics (to be deprecated)
{
// Universal Analytics - to be deprecated
Page Title: "Checkout",
eventCategory: "Checkout",
eventLabel: "Order (100003204)",
eventAction: "Checkout",
Product Id: "6130feaa64056f6aa46c4b56",
Product Name: "Senior",
Product Category: "General Admission/Ticket",
Price: "13.00",
quantity: 1,
Product Variant: "Ticket",
Product Brand: "General Admission",
Quantity: 1,
// GA4
event: "purchase",
Environment Name: "sandbox", // Built in variable
ecommerce: {
// Universal Analytics - to be deprecated
eventCategory: "Purchase",
eventLabel: "100003204",
eventAction: "Purchase::Complete",
// GA4
currency: "USD",
transaction_id: "100003204",
value: 28,
coupon: "",
shipping: 0,
tax: 0,
items: [
{
item_id: "6776e5fd970966174e173e33",
item_name: "General Admission, Jul 30, 2025 09:00 AM, Adult",
affiliation: "509",
coupon: null,
discount: 0,
index: 0,
item_brand: "General Admission Event Ticket",
item_category: "General Admission",
item_category2: "Jul 30, 2025",
item_category3: "09:00 AM",
item_category4: "Adult",
item_category5: "Event",
item_list_id: "",
item_list_name: "",
item_variant: "",
location_id: "",
price: 15,
quantity: 1
},
{
item_id: "6776e5fd970966174e173e33",
item_name: "General Admission, Jul 30, 2025 09:00 AM, Senior",
affiliation: "509",
coupon: null,
discount: 0,
index: 1,
item_brand: "General Admission Event Ticket",
item_category: "General Admission",
item_category2: "Jul 30, 2025",
item_category3: "09:00 AM",
item_category4: "Senior",
item_category5: "Event",
item_list_id: "",
item_list_name: "",
item_variant: "",
location_id: "",
price: 13,
quantity: 1
}
]
}
}