Skip to main content

Google Tag Manager (GTM)

Get Access

Contact the Globber IT team to access your GTM dashboard (request form link coming soon)

Google Tag Manager (GTM) keeps all your website tracking tools in one place and controls when they work.

GTM Overview

What GTM Manages

Analytics: GA4, Facebook Pixel, LinkedIn Insight Tag

Marketing: Conversion tracking, remarketing tags, email pixels

Website Features: Chat widgets, feedback tools, A/B testing

How GTM Works

Once GTM is installed on your site it will automatically:

  • Loads tracking codes when visitors arrive
  • Sends data to analytics platforms
  • Triggers events based on visitor actions
  • Manages privacy settings

dataLayer Events Reference

The Globber theme pushes events to window.dataLayer automatically. All ecommerce events follow the GA4 Enhanced Ecommerce schema.

note

All ecommerce events are preceded by dataLayer.push({ ecommerce: null }) to clear any previous ecommerce object — this is the recommended GA4 practice.

Ecommerce Events

These events track the customer shopping journey and are compatible with GA4 Enhanced Ecommerce.

EventTriggerSource
view_item_listShop, category, search, or related products page loadsServer (PHP)
view_itemSingle product page loadsServer (PHP)
select_itemCustomer clicks a product card in a listingClient (JS)
add_to_cartCustomer adds a product to the cartClient (JS)
remove_from_cartCustomer removes a product from the cartClient (JS)
add_to_wishlistCustomer adds a product to their wishlistClient (JS)
view_cartCart page loadsClient (JS)
begin_checkoutCustomer proceeds to checkout from the cartClient (JS)
purchaseOrder confirmation (thank-you) page loadsServer (PHP)

Example: purchase event payload

dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: '12345',
affiliation: 'Globber HK',
value: 99.00,
tax: 0,
shipping: 10.00,
currency: 'HKD',
coupon: 'SUMMER10', // only present if a coupon was applied
items: [
{
item_id: 'SKU-001',
item_name: 'Globber One K E-Motion',
item_brand: 'Globber',
item_category: 'Electric Scooters',
item_variant: 'Red',
price: 89.00,
quantity: 1,
discount: 10.00 // only present if a discount was applied
}
]
}
});

Item object fields

Every items array entry follows this structure:

FieldDescription
item_idProduct SKU, or WooCommerce product/variation ID if no SKU is set
item_nameProduct name
affiliationSite name (e.g. Globber HK)
item_brandBrand name (from product_manufacturer taxonomy, ACF brand field, or 'Globber' as default)
item_categoryPrimary product category
item_category2item_category5Additional categories (if the product belongs to more than one)
item_variantVariation attribute values joined by / (e.g. Red / Large), only present for variable products
item_list_nameThe list the product was shown in (e.g. Shop, Related Products, Search Results)
item_list_idMachine-readable list identifier (e.g. shop, related, search)
indexPosition of the item in its list (1-based)
priceUnit price at the time of the event
quantityQuantity
discountPer-unit discount amount, only present when a discount applies
couponCoupon code, only present when a coupon is applied
currencyISO 4217 currency code (e.g. HKD, USD)

Marketing & Checkout Events

EventTriggerSource
checkout_newsletter_optinCustomer places an order and the newsletter opt-in checkbox is shownServer (PHP)

checkout_newsletter_optin payload

dataLayer.push({
event: 'checkout_newsletter_optin',
newsletter_optin: true, // or false
newsletter_provider: 'klaviyo' // or 'mailchimp'
});

Use this event in GTM to trigger a Klaviyo or Mailchimp subscription tag when newsletter_optin is true. See the Checkout guide for admin configuration.


Popup interactions are tracked automatically by the popup manager.

EventTrigger
popup_viewA popup is displayed to the visitor
popup_closeVisitor dismisses a popup
popup_cta_clickVisitor clicks the CTA button inside a popup

All three popup events share the same popup object:

dataLayer.push({
event: 'popup_view', // or 'popup_close' / 'popup_cta_click'
popup: {
popup_id: 'promo-summer-2025',
popup_title: 'Summer Sale',
template: 'default',
trigger_type: 'scroll' // e.g. 'scroll', 'exit_intent', 'timer'
// popup_cta_click also includes:
// cta_url: 'https://...',
// cta_text: 'Shop Now'
}
});

Adding New Tracking

See Google's guide on Adding and editing tags for detailed instructions on adding new tracking scripts.

Learning Resources

Need help?

Contact the Globber IT team for all GTM assistance and setup.