Skip to content
Tracking & analyticsLast updated

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.
  • purchase is sent only when a customer submits a booking on the booking page.

Events ​

EventWhen it is sentbooking_stepGTM / GA4Meta Pixel
add_to_cartThe customer adds a service to the bookingserviceSentAddToCart
remove_from_cartThe customer removes a selected serviceserviceSentNot sent
begin_checkoutThe customer moves on to the time selection steptimeSentInitiateCheckout
booking_time_selectedThe customer picks a time and moves on to the confirmation step (custom event)confirmSentNot sent
purchaseThe booking is submitted successfullycompleteSentSchedule
  • When the merchant has not turned on [Allow multiple services per booking], choosing a different service first sends remove_from_cart for the previous service, then add_to_cart for 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 purchase once. The number of slots is in slot_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:

js
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,
});
js
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',
});
js
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.

FieldTypeDescription
eventstringEvent name. See Events
ecommerce.currencystringThe merchant's currency as an ISO 4217 code (for example, TWD)
ecommerce.valuenumberSum of price × quantity across all items
ecommerce.itemsarrayItems. See Item fields
ecommerce.transaction_idstringpurchase only: the Appointment ID
booking_stepstringservice, time, confirm, or complete
slot_countnumberbooking_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:

js
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 ​

FieldTypeDescription
item_idstringService ID
item_namestringService name
item_categorystringService category name
item_variantstringStaff member's name. Omitted when the staff member is not yet determined or the service doesn't need staff
pricenumberUnit price in the currency's major unit (for example, NT dollars)
quantitynumberThe number of people for services whose total is based on the number of people, otherwise 1. For purchase, multiplied by the number of slots
indexnumberItem position, starting at 0

value and price are service prices, not amounts actually collected.

Meta Pixel ​

Dolyu eventMeta standard event
add_to_cartAddToCart
begin_checkoutInitiateCheckout
purchaseSchedule

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.