Understanding Google Tag Manager Data Layer Events
When Online Booking is configured with Google Tag Manager, the booking app pushes events to the GTM data layer as the patient moves through the flow.
Events fall into two groups:
- Booking user flow events — almost all use
event: 'form_step', with astep_name(and usually astep_number) describing what happened. - Interaction events — separate event names for cookie consent, policy overlays, and header actions (About us / telephone).
Step numbers below describe the standard (non-recall) booking journey. Where recall uses a different number, that is noted.
Booking user flow events (form_step)
Unless noted otherwise, each event looks like:
{
event: 'form_step',
step_name: '...',
step_number: '...',
// plus any attributes listed for that step
}
Practice status and selection
Practice Selection
Trigger: Multi-location booking — patient selects a practice.
{
event: 'form_step',
step_name: 'Practice Selection',
step_number: '0',
practice: 'Practice display name',
location_id: 'location-id',
}
Practice Online / Offline / Disabled
Trigger: After location settings load, when the practice is available online, offline, or disabled for online booking.
These events have no step_number.
{
event: 'form_step',
step_name: 'Practice Online', // or 'Practice Offline' | 'Practice Disabled'
practice: 'Practice display name',
location_id: 'location-id',
recall: true | false,
}
Appointment details
1. User Type Selection
Trigger: Patient answers whether they have booked before (new or existing).
{
event: 'form_step',
step_name: 'User Type',
step_number: '1',
user_type: 'new' | 'existing',
recall: true | false,
}
2. Payor Type Selection
Trigger: Patient selects payor type (when shown).
{
event: 'form_step',
step_name: 'Payor Type',
step_number: '2',
payor_type: 'private' | 'nhs',
}
3. Service Type Selection
Trigger: Patient selects a service.
{
event: 'form_step',
step_name: 'Service Type',
step_number: '3',
service_type: 'Description of the dental service',
}
4. Service Provider Selection
Trigger: Patient selects a provider.
{
event: 'form_step',
step_name: 'Service Provider',
step_number: '4',
service_provider: 'Name of the service provider',
}
5. Date Navigation
Trigger: Patient uses the calendar arrows to move to a previous or next time period.
{
event: 'form_step',
step_name: 'Date',
step_number: '5', // recall (daily calendar): '1'
arrow_clicked: 'Previous Time Period' | 'Next Time Period',
recall: true | false, // present on the daily calendar view
}
6. Time Selection
Trigger: Patient selects an appointment time.
{
event: 'form_step',
step_name: 'Time',
step_number: '6', // recall: '2'
appointment_time: '13:00:00', // 24h, local time
appointment_date: '2025-10-01', // YYYY-MM-DD, local date
}
7. Appointment Details Complete
Trigger: Patient completes appointment details and continues to the next step.
{
event: 'form_step',
step_name: 'Appointment Details Complete',
step_number: '7',
user_type: 'new' | 'existing',
service_type: 'Description of the service',
service_provider: 'Name of the service provider',
appointment_time: '13:00:00',
appointment_date: '2025-10-01',
}
Personal information fields
These fire when the patient focuses (clicks into) each field — not when they finish typing.
| Step | step_name | step_number |
|---|---|---|
| 8 | First Name | 8 |
| 9 | Last Name | 9 |
| 10 | Email Address | 10 |
| 11 | Sex | 11 |
| 12 | Date of Birth | 12 |
| 13 | Phone Number | 13 |
Example:
{
event: 'form_step',
step_name: 'First Name',
step_number: '8',
}
Terms and contact consent (checkboxes)
14. Terms of Use / Contact Consent checkboxes
{
event: 'form_step',
step_name: 'Accept Terms of Use', // or 'Reject Terms of Use'
step_number: '14',
}
{
event: 'form_step',
step_name: 'Accept Contact Consent', // or 'Reject Contact Consent'
step_number: '14',
}
(Overlay open/close events for these dialogs are listed under Interaction events below.)
Verification, deposit, and completion
15. Booking Code Challenge
Trigger: Verification / MFA code step is shown.
{
event: 'form_step',
step_name: 'Booking Code Challenge',
step_number: '15',
}
15. Booking Code Submitted
Trigger: Patient successfully submits the verification code.
{
event: 'form_step',
step_name: 'Booking Code Submitted',
step_number: '15',
booking_id: '123456789',
}
16. Deposit Payment Info
Trigger: Deposit payment page is displayed.
{
event: 'form_step',
step_name: 'Booking Deposit Payment Info',
step_number: '16',
}
17. Deposit Payment Result
Trigger: Deposit payment attempt finishes.
{
event: 'form_step',
step_name: 'Booking Deposit Payment Complete', // or 'Booking Deposit Payment Error'
step_number: '17',
}
18. Booking Complete
Trigger: Appointment is successfully confirmed.
{
event: 'form_step',
step_name: 'Booking Complete',
step_number: '18', // recall: '3'
}
18. Booking Failed
Trigger: Confirmation fails after the booking has been submitted (for example slot taken, or payment succeeded but the appointment could not be finalised).
{
event: 'form_step',
step_name: 'Booking Failed',
step_number: '18', // recall: '3'
appointment_status: 'taken' | 'error' | /* other status values */,
payment_status: 'succeeded' | 'entered' | /* other payment status values */,
}
Interaction events
These use their own event names (not form_step).
Cookie consent
When the patient sets cookie preferences, the app stores a browser cookie named cookie_consent and pushes:
{
event: 'cookie_consent',
consent: 'necessary_20250610' | 'performance_20250610' | 'marketing_20250610' | 'all_20250610',
}
| Value | Meaning |
|---|---|
necessary_20250610 | Essential cookies only |
performance_20250610 | Essential + performance |
marketing_20250610 | Essential + marketing |
all_20250610 | Essential + all optional cookies |
Marketing consent is considered given when the value is all_20250610 or marketing_20250610.
Example check:
if (document.cookie.match("cookie_consent=(all|marketing)")) { /* ... */ }
Important: Values are suffixed with the cookie policy date (for example _20250610). When the policy date changes, previous consents are invalidated and patients are asked again.
Terms of use and contact consent overlays
{ event: 'terms_of_use_opened' }
{ event: 'terms_of_use_closed' }
{ event: 'contact_consent_opened' }
{ event: 'contact_consent_closed' }
Header actions
About us — patient clicks About us in the booking header.step_name is the current booking tab name (for example Appointment Details, Personal Details, Your Info, Complete).
{
event: 'click_about_us',
step_name: 'Appointment Details',
}
Telephone — patient clicks the practice phone number in the header.
{
event: 'click_telephone',
step_name: 'Appointment Details',
}
Quick reference — form_step step numbers (standard flow)
| # | step_name |
|---|---|
| 0 | Practice Selection |
| 1 | User Type |
| 2 | Payor Type |
| 3 | Service Type |
| 4 | Service Provider |
| 5 | Date |
| 6 | Time |
| 7 | Appointment Details Complete |
| 8–13 | First Name … Phone Number |
| 14 | Accept/Reject Terms of Use; Accept/Reject Contact Consent |
| 15 | Booking Code Challenge; Booking Code Submitted |
| 16 | Booking Deposit Payment Info |
| 17 | Booking Deposit Payment Complete / Error |
| 18 | Booking Complete; Booking Failed |
Practice Online / Offline / Disabled do not use a step number. Recall reuses some of these names with different step numbers (Date 1, Time 2, Booking Complete / Failed 3).
Cookie Consent
Users are asked to consent to the use of cookies and may choose one of the following options:
- Consent only to the essential cookies required for the app to function
- Consent to essential cookies plus any combination of the following optional cookies:
- Performance cookies
- Marketing cookies
Consent Processing
- When the user gives their consent:
- A cookie is stored in their browser with their selection
- Data is stored on the user's record in the database
- An event is sent to the GTM dataLayer
Cookie Storage
The local cookie holding the user's cookie consent preference is named:
cookie_consent
Google Tag Manager Events
The event sent to GTM follows this structure:
{
event: 'cookie_consent',
consent: value
}
Consent Values
value may be any of the following:
| "necessary_20250610" | User consent to essential cookies only |
| "performance_20250610" | User consent to essential and performance cookies |
| "marketing_20250610" | User consent to essential and marketing cookies |
| "all_20250610" | User consent to essential and all optional cookies |
⚠️Note: If either value “all_20250610" or "marketing_20250610" is present, marketing consent is considered given.
Checking Marketing Cookie Acceptance
Example code for checking marketing cookie acceptance:
if (document.cookie.match("cookie_consent=(all|marketing)")) { ... }
⚠️ Important: The values are suffixed by the date of the cookie policy (e.g., _20250610). When the cookie policy changes, this suffix will be updated, resetting the user's cookie preference. Users will be prompted to accept the cookies/policy again when they next use the platform.
Comments
0 comments
Please sign in to leave a comment.