GTM Events Documentation
This document describes all Google Tag Manager events implemented across the EventJuicer platform.
Table of Contents
Navigation Events
page_view
Triggered automatically on every route change in Next.js.
Component: GTMPageviewTracker
Parameters:
| Parameter | Type | Description | Example |
|---|---|---|---|
page_path | string | Current pathname | "/tickets" |
page_location | string | Full URL with query params | "/tickets?role=visitor" |
page_title | string | Document title | "Tickets - EventJuicer" |
timestamp | number | Event timestamp | 1234567890123 |
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:
| Parameter | Type | Description | Example |
|---|---|---|---|
label | string | Button label text | "Learn More" |
href | string | Destination URL | "/tickets" or "https://external.com" |
is_external | boolean | Whether link is external | true 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 actionAddToCartPredefinedButton- Predefined exhibitor-specific tickets
Parameters:
| Parameter | Type | Description | Example |
|---|---|---|---|
ticket_id | number | Unique ticket identifier | 123 |
ticket_name | string | Name of the ticket | "VIP Access Pass" |
quantity | number | Number of tickets added | 1 |
price | number | Price per ticket | 99.99 |
currency | string | Currency code | "EUR" or "PLN" |
role | string | Ticket role/type | "visitor", "exhibitor" |
has_options | boolean | Whether ticket has custom options | true |
company_id | number | Company ID (predefined only) | 456 |
company_name | string | Company name (predefined only) | "Tech Corp" |
predefined | boolean | Is 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
cart_items_count | number | Total number of items in cart | 3 |
cart_total_value | number | Total cart value | 299.97 |
currency | string | Currency code | "EUR" or "PLN" |
items | array | Array of cart items | See 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
cart_items_count | number | Total number of items in cart | 3 |
cart_total_value | number | Total cart value | 299.97 |
currency | string | Currency code | "EUR" or "PLN" |
items | array | Array of cart items | Same 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
cart_items_count | number | Total number of items in cart | 3 |
cart_total_value | number | Total cart value | 299.97 |
currency | string | Currency 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
purchase_id | number | Unique purchase identifier | 789 |
amount | number | Payment amount | 299.97 |
currency | string | Currency code | "EUR" or "PLN" |
items_count | number | Number of items in purchase | 3 |
ctx | string | Context/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:
| Parameter | Type | Description | Example |
|---|---|---|---|
purchase_id | number | Unique purchase identifier | 789 |
invoice_type | string | Type of invoice | "proforma", "vat", "correction" |
already_exists | boolean | Whether invoice already existed | true 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
form_id | string | Unique form identifier | "checkout-form" |
base_label | string | Form base label for translations | "checkout.fields" |
field_name | string | Name 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:
| Parameter | Type | Description | Example |
|---|---|---|---|
form_id | string | Unique form identifier | "checkout-form" |
base_label | string | Form base label for translations | "checkout.fields" |
fields_count | number | Total number of fields in form | 8 |
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>;
}