Booking Page Tracking Events
The events and fields the Dolyu booking page sends to Google Tag Manager (GTM), Google Analytics 4 (GA4), and Meta Pixel. For where to enter tracking codes and how to set up reports, see Ads & Analytics Tracking in the Help Center.
Scope
- Events are pushed to dataLayer only when a GTM container ID is set, sent to GA4 only when a GA4 measurement ID is set, and sent to Meta only when a Meta Pixel ID is set.
purchaseis sent only when a customer submits a booking on the booking page.
Events
| Event | When it is sent | booking_step | GTM / GA4 | Meta Pixel |
|---|---|---|---|---|
add_to_cart | The customer adds a service to the booking | service | Sent | AddToCart |
remove_from_cart | The customer removes a selected service | service | Sent | Not sent |
begin_checkout | The customer moves on to the time selection step | time | Sent | InitiateCheckout |
booking_time_selected | The customer picks a time and moves on to the confirmation step (custom event) | confirm | Sent | Not sent |
purchase | The booking is submitted successfully | complete | Sent | Schedule |
- When the merchant has not turned on [Allow multiple services per booking], choosing a different service first sends
remove_from_cartfor the previous service, thenadd_to_cartfor the new one. - Step events are sent only when moving forward. Going back sends nothing; moving forward again sends the event again.
- A multi-slot booking sends
purchaseonce. The number of slots is inslot_count.
Example: completed booking
A customer books "Trial class" for 3 people at a unit price of 1000, with the total based on the number of people, so value is 1000 × 3. Switch tabs to see what GTM, GA4, and Meta Pixel each receive:
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: 'purchase',
ecommerce: {
currency: 'TWD',
value: 3000,
transaction_id: '9f1c2e4a-…',
items: [
{
item_id: '5b7d…',
item_name: 'Trial class',
item_category: 'Classes',
item_variant: 'Amy Wang',
price: 1000,
quantity: 3,
index: 0,
},
],
},
booking_step: 'complete',
slot_count: 1,
});gtag('event', 'purchase', {
currency: 'TWD',
value: 3000,
transaction_id: '9f1c2e4a-…',
items: [
{
item_id: '5b7d…',
item_name: 'Trial class',
item_category: 'Classes',
item_variant: 'Amy Wang',
price: 1000,
quantity: 3,
index: 0,
},
],
booking_step: 'complete',
slot_count: 1,
send_to: 'G-XXXXXXXXXX',
});fbq('track', 'Schedule', {
value: 3000,
currency: 'TWD',
content_type: 'product',
content_ids: ['5b7d…'],
contents: [{ id: '5b7d…', quantity: 3, item_price: 1000 }],
num_items: 1,
});Google Tag Manager
Each event pushes two entries: first { ecommerce: null } to clear the previous ecommerce data, then the event itself. See the "GTM (dataLayer)" tab in the example for the format.
| Field | Type | Description |
|---|---|---|
event | string | Event name. See Events |
ecommerce.currency | string | The merchant's currency as an ISO 4217 code (for example, TWD) |
ecommerce.value | number | Sum of price × quantity across all items |
ecommerce.items | array | Items. See Item fields |
ecommerce.transaction_id | string | purchase only: the Appointment ID |
booking_step | string | service, time, confirm, or complete |
slot_count | number | booking_time_selected and purchase only: the number of slots in this booking |
Page changes within the booking page
When the customer moves between pages within the booking page (not on the first load), this is pushed:
window.dataLayer.push({ event: 'virtual_page_view', page_path: '/…', page_title: '…' });Google Analytics 4
When a GA4 measurement ID is set, the same five events are sent with gtag. The parameters match the GTM ecommerce data, plus booking_step and slot_count (as in the GTM fields), and send_to targets the merchant's measurement ID. See the "GA4 (gtag)" tab in the example. page_view is also sent on page changes within the booking page.
Item fields
| Field | Type | Description |
|---|---|---|
item_id | string | Service ID |
item_name | string | Service name |
item_category | string | Service category name |
item_variant | string | Staff member's name. Omitted when the staff member is not yet determined or the service doesn't need staff |
price | number | Unit price in the currency's major unit (for example, NT dollars) |
quantity | number | The number of people for services whose total is based on the number of people, otherwise 1. For purchase, multiplied by the number of slots |
index | number | Item position, starting at 0 |
value and price are service prices, not amounts actually collected.
Meta Pixel
| Dolyu event | Meta standard event |
|---|---|
add_to_cart | AddToCart |
begin_checkout | InitiateCheckout |
purchase | Schedule |
Parameters (see the "Meta Pixel (fbq)" tab in the example): value, currency, content_type (always product), content_ids (service IDs), contents (id, quantity, and item_price for each item), and num_items (number of items). PageView is sent on page load and on page changes within the booking page.