GTM Events Documentation

This document describes all Google Tag Manager events implemented across the EventJuicer platform.

Table of Contents


page_view

Triggered automatically on every route change in Next.js.

Component: GTMPageviewTracker

Parameters:

ParameterTypeDescriptionExample
page_pathstringCurrent pathname"/tickets"
page_locationstringFull URL with query params"/tickets?role=visitor"
page_titlestringDocument title"Tickets - EventJuicer"
timestampnumberEvent timestamp1234567890123

Example:

{ event: 'page_view', page_path: '/tickets', page_location: '/tickets?role=visitor', page_title: 'Tickets - EventJuicer', timestamp: 1234567890123 }

Setup:

Add the GTMPageviewTracker component to your root layout wrapped in Suspense:

// app/layout.tsx import { GTMPageviewTracker } from '@eventjuicer/analytics/gtm-pageview-tracker' import { Suspense } from 'react' export default function RootLayout({ children }) { return ( <html> <body> <Suspense fallback={null}> <GTMPageviewTracker /> </Suspense> {children} </body> </html> ) }

more_button_click

Triggered when a user clicks a "More" button (used throughout the platform for CTAs and navigation).

Component: MoreButton

Parameters:

ParameterTypeDescriptionExample
labelstringButton label text"Learn More"
hrefstringDestination URL"/tickets" or "https://external.com"
is_externalbooleanWhether link is externaltrue or false

Example:

{ event: 'more_button_click', label: 'Learn More', href: '/tickets', is_external: false }

E-commerce Events

add_to_cart

Triggered when a user adds a ticket to their shopping cart.

Components:

  • AddToCartButton - Standard add to cart action
  • AddToCartPredefinedButton - Predefined exhibitor-specific tickets

Parameters:

ParameterTypeDescriptionExample
ticket_idnumberUnique ticket identifier123
ticket_namestringName of the ticket"VIP Access Pass"
quantitynumberNumber of tickets added1
pricenumberPrice per ticket99.99
currencystringCurrency code"EUR" or "PLN"
rolestringTicket role/type"visitor", "exhibitor"
has_optionsbooleanWhether ticket has custom optionstrue
company_idnumberCompany ID (predefined only)456
company_namestringCompany name (predefined only)"Tech Corp"
predefinedbooleanIs predefined ticket (predefined only)true

Example:

{ event: 'add_to_cart', ticket_id: 123, ticket_name: 'VIP Access Pass', quantity: 2, price: 99.99, currency: 'EUR', role: 'visitor', has_options: false }

view_cart

Triggered when the shopping cart preview drawer is opened with items in it.

Component: CartPreview

Parameters:

ParameterTypeDescriptionExample
cart_items_countnumberTotal number of items in cart3
cart_total_valuenumberTotal cart value299.97
currencystringCurrency code"EUR" or "PLN"
itemsarrayArray of cart itemsSee below

Items array structure:

{ ticket_id: 123, ticket_name: 'VIP Access Pass', quantity: 2, price: 99.99, role: 'visitor' }

Example:

{ event: 'view_cart', cart_items_count: 3, cart_total_value: 299.97, currency: 'EUR', items: [ { ticket_id: 123, ticket_name: 'VIP Access Pass', quantity: 2, price: 99.99, role: 'visitor' }, { ticket_id: 124, ticket_name: 'Standard Pass', quantity: 1, price: 49.99, role: 'visitor' } ] }

proceed_to_checkout

Triggered when user clicks the "Proceed to Checkout" button in the cart preview.

Component: CartPreview

Parameters:

ParameterTypeDescriptionExample
cart_items_countnumberTotal number of items in cart3
cart_total_valuenumberTotal cart value299.97
currencystringCurrency code"EUR" or "PLN"
itemsarrayArray of cart itemsSame structure as view_cart

Example:

{ event: 'proceed_to_checkout', cart_items_count: 3, cart_total_value: 299.97, currency: 'EUR', items: [...] }

clear_cart

Triggered when user clicks the "Clear Cart" button and confirms the action.

Component: CartPreview

Parameters:

ParameterTypeDescriptionExample
cart_items_countnumberTotal number of items in cart3
cart_total_valuenumberTotal cart value299.97
currencystringCurrency code"EUR" or "PLN"

Example:

{ event: 'clear_cart', cart_items_count: 3, cart_total_value: 299.97, currency: 'EUR' }

Payment Events

pay_now_click

Triggered when user clicks the "Pay Now" button to initiate payment.

Component: PayNowButton

Parameters:

ParameterTypeDescriptionExample
purchase_idnumberUnique purchase identifier789
amountnumberPayment amount299.97
currencystringCurrency code"EUR" or "PLN"
items_countnumberNumber of items in purchase3
ctxstringContext/source of purchase"entry_tickets"

Example:

{ event: 'pay_now_click', purchase_id: 789, amount: 299.97, currency: 'EUR', items_count: 3, ctx: 'entry_tickets' }

Invoice Events

download_invoice_click

Triggered when user downloads an invoice (proforma or VAT).

Component: DownloadInvoiceButton

Parameters:

ParameterTypeDescriptionExample
purchase_idnumberUnique purchase identifier789
invoice_typestringType of invoice"proforma", "vat", "correction"
already_existsbooleanWhether invoice already existedtrue or false

Example:

{ event: 'download_invoice_click', purchase_id: 789, invoice_type: 'vat', already_exists: true }

Form Events

form_start

Triggered when user first interacts with any field in a SmartForm (tracked only once per form instance).

Component: SmartForm

Parameters:

ParameterTypeDescriptionExample
form_idstringUnique form identifier"checkout-form"
base_labelstringForm base label for translations"checkout.fields"
field_namestringName of first field interacted with"email"

Example:

{ event: 'form_start', form_id: 'checkout-form', base_label: 'checkout.fields', field_name: 'email' }

form_submit

Triggered when user submits a SmartForm.

Component: SmartForm

Parameters:

ParameterTypeDescriptionExample
form_idstringUnique form identifier"checkout-form"
base_labelstringForm base label for translations"checkout.fields"
fields_countnumberTotal number of fields in form8

Example:

{ event: 'form_submit', form_id: 'checkout-form', base_label: 'checkout.fields', fields_count: 8 }

Implementation Details

All events are tracked using the useGTMTracking hook from @eventjuicer/analytics/gtm-track-interaction.

Client-side tracking:

Events are pushed to the dataLayer object for GTM to process.

Server-side tracking:

Events can optionally be sent to a GTM Server-Side Container if configured via GTM_SERVER_CONTAINER_URL environment variable.

Development mode:

All events are logged to the console when NODE_ENV=development.


Usage Example

import { useGTMTracking } from '@eventjuicer/analytics/gtm-track-interaction'; function MyComponent() { const { track } = useGTMTracking(); const handleAction = async () => { await track('event_name', { param1: 'value1', param2: 123 }); }; return <button onClick={handleAction}>Track Event</button>; }