Understanding Google Tag Manager Data Layer Events
When your Online Booking is configured with Google Tag Manager, layer events will be created to inform you of the various events that have occurred.
Google Tag Manager Data Layer Events
The online booking app produces several events, which are sent to the Google Tag Manager data layer.
Booking User Flow Events
1. User Type Selection
// Trigger: When someone selects an option in the “Have you booked an appointment with us before?” section.
{
event: 'form_step',
step_name: 'User Type',
step_number: '1',
user_type: 'new' | 'existing',
}
2. Payor Type Selection
// Trigger: When someone specifies their payor type.
{
event: 'form_step',
step_name: 'Payor Type',
step_number: '2',
payor_type: 'private' | 'nhs',
}
3. Service Type Selection
// Trigger: When a user selects which service they'll book.
{
event: 'form_step',
step_name: 'Service Type',
step_number: '3',
service_type: 'Description of the dental service',
}
4. Service Provider Selection
// Trigger: When a user selects who will provide the service they booked.
{
event: 'form_step',
step_name: 'Service Provider',
step_number: '4',
service_provider: 'Name of the service provider',
}
5. Date Navigation
// Trigger: When a user clicks on the arrows to move forward for the next time period or backward for the previous time period.
{
event: 'form_step',
step_name: 'Date',
step_number: '5',
arrow_clicked: 'Previous Time Period',
}
// Trigger: When a user clicks on the arrows to move forward for the next time period or backward for the previous time period.
{
event: 'form_step',
step_name: 'Date',
step_number: '5',
arrow_clicked: 'Next Time Period',
}
6. Time Selection
// Trigger: When a user selects a booking time.
{
event: 'form_step',
step_name: 'Time',
step_number: '6',
appointment_time: '13:00:00’, // 24h, local time
appointment_date: '2025-10-01’, // YYYY-MM-DD, sortable local date
}
7. Appointment Details Complete
// Trigger: When a user completes the appointment details and clicks on the next button
{
event: 'form_step',
step_name: 'Appointment Details Complete',
step_number: '7',
user_type: 'new',
service_type: 'Description of the service',
service_provider: 'Name of the service provider',
appointment_time: '13:00:00',
appointment_date: '2025-10-01',
}
8 - 13 Personal Information Fields
These events are triggered when a user clicks on each personal information input field:
| Step | Field 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 |
// Trigger: When a user clicks on the First Name input field
{
event: 'form_step',
step_name: 'First Name',
step_number: '8',
}
// Trigger: When a user clicks on the Last Name input field
{
event: 'form_step',
step_name: 'Last Name',
step_number: '9',
}
// Trigger: When a user clicks on the Email Address input field.
{
event: 'form_step',
step_name: 'Email Address',
step_number: '10',
}
// Trigger: When a user clicks on the sex dropdown list.
{
event: 'form_step',
step_name: 'Sex',
step_number: '11',
}
// Trigger: When a user clicks on the Date of Birth input field.
{
event: 'form_step',
step_name: 'Date of Birth',
step_number: '12',
}
// Trigger: When a user clicks on the Phone Number input field.
{
event: 'form_step',
step_name: 'Phone Number',
step_number: '13',
}
14. Terms and Consent
Multiple events are triggered for terms of use and contact consent:
// Trigger: When a user clicks on the check box accepting the Terms of Use.
{
event: 'form_step',
step_name: 'Accept Terms of Use',
step_number: '14',
}
// Trigger: When a user clicks on the check box accepting the Terms of Use.
{
event: 'form_step',
step_name: 'Reject Terms of Use',
step_number: '14',
}
// Trigger: The Terms of use popup is opened
{
event: 'terms_of_use_opened",
}
// Trigger: The Terms of use popup is closed
{
event: 'terms_of_use_closed',
}
// Trigger: When a user clicks on the check box consenting to be contacted.
{
event: 'form_step',
step_name: 'Accept Contact Consent',
step_number: '14',
}
// Trigger: When a user clicks on the check box consenting to be contacted.
{
event: 'form_step',
step_name: 'Reject Contact Consent',
step_number: '14',
}
// Trigger: When the contact consent dialog is opened
{
event: 'contact_consent_opened',
}
// Trigger: When the contact consent dialog is closed
{
event: 'contact_consent_closed',
}
15. Booking Complete
// Trigger: When a user successfully completes the booking.
{
event: 'form_step',
step_name: 'Booking Complete',
step_number: '15',
booking_id: '123456789',
user_type: 'new',
service_type: 'Description of the service',
service_provider: 'Name of the service provider',
appointment_time: '13:00:00',
appointment_date: '2025-10-01',
}
16. Deposit Payment
// Trigger: The deposit payment page is displayed
{
event: 'form_step',
step_name: 'Booking Deposit Payment',
step_number: '16',
}
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.