Back to Help Home
Last updated: 2026-11-12

Tracking Calendar Widget and Form Events with Google Tag Manager

Quick Reference Keywords: Google Tag Manager · GTM · dataLayer · conversion tracking · GA4 events · booking funnel · drop-off · postMessage

Overview

The calendar widget and forms you embed on your website tell your page what the visitor is doing as they go: when the widget loads, when they pick a date and a time, when they start filling in their details, and when they book or submit. Each step is pushed into your site's Google Tag Manager (GTM) data layer, so you can fire your own tags on it: GA4 events, Google Ads conversions, the Meta pixel, or anything else GTM supports.

Because the events fire in the visitor's browser, GA4 ties them to the visitor's session, so bookings show up with the right source, campaign, and landing page. And because there's an event for every step, you can build a funnel and see where visitors drop off.

There is nothing to turn on. Any widget or form embedded with the standard embed code sends these events, including embeds that are already on your site.

Tip Running ads through brayv.ai too? Your tags and brayv.ai's conversion reporting stay out of each other's way. The conversions brayv.ai sends to Google Ads are secondary actions that only brayv.ai's campaigns bid on, so they never steer your campaigns, and a conversion tag you add here never steers brayv.ai's campaigns. A booking counts once in the Conversions column; only All conv. shows both. On Meta, brayv.ai sends its own brayv_ events, which stay separate from your pixel's standard events.

Requirements

  1. Use the standard embed code. This is the <div> and <script> snippet from Embed Your Widget > Embed Code on the calendar's Widget tab, or Embed Options > Embed Code on the form's details page (Settings > Lead Sources). The script is what passes events into your data layer. If you pasted only an <iframe>, see Listening without Google Tag Manager.
  2. Google Tag Manager on the same page as the embed.

Calendar Widget Events

The order depends on whether the widget shows the calendar first (the standard flow) or asks for the visitor's details first. Widgets switch to details first automatically when travel-aware scheduling is on.

Standard flow (calendar first):

  1. brayv_calendar_loaded
  2. brayv_calendar_date_selected
  3. brayv_calendar_time_selected
  4. brayv_calendar_details_started
  5. brayv_calendar_booking_completed

Details-first flow:

  1. brayv_calendar_loaded
  2. brayv_calendar_details_started
  3. brayv_calendar_details_submitted
  4. brayv_calendar_date_selected
  5. brayv_calendar_time_selected
  6. brayv_calendar_booking_completed
EventWhen it fires
brayv_calendar_loadedThe widget has loaded and is showing its first step. Once per page view.
brayv_calendar_date_selectedThe visitor picks a date. Fires again if they pick another date.
brayv_calendar_time_selectedThe visitor picks a time. Fires again if they pick another time.
brayv_calendar_details_startedThe visitor first types in, or changes, any field on the details form. Once per page view.
brayv_calendar_details_submittedDetails-first flow only: the visitor's details were accepted and available times are showing.
brayv_calendar_booking_blockedOne of your booking rules turned the visitor away. In the details-first flow this can happen before they see any times.
brayv_calendar_booking_failedThe booking didn't go through for some other reason, most often because someone else took the time first. brayv_failure_reason says why. In the details-first flow this can also happen when the visitor submits their details.
brayv_calendar_booking_completedThe appointment was booked. Use this one for conversions.

brayv_calendar_booking_blocked and brayv_calendar_booking_failed take the place of brayv_calendar_booking_completed when a booking doesn't go through. The visitor can go back and try again, so both can fire more than once, and time_selected can follow a failure.

Failure reasons (brayv_failure_reason):

  • time_unavailable - The time can no longer be booked: someone else booked it first, nobody on the team is free then, an appointment limit was reached, or a travel rule now rules it out. The widget takes the visitor back to the available times.
  • calendar_unavailable - The calendar was deleted.
  • error - Anything else, such as a failed security check or a connection problem.

Reschedule and cancel links don't send events, so they never look like new bookings.

Calendar Event Fields

Every calendar event carries all of these fields. A field is empty (undefined) until it applies.

FieldExampleFilled in on
brayv_widget_typecalendarEvery event
brayv_widget_id3f1c9a2e-…Every event
brayv_widget_nameInitial Design ConsultationEvery event
brayv_flowcalendar_first or form_firstEvery event
brayv_date2026-11-20date_selected, time_selected, and later events while a time is picked
brayv_time9:00 AMtime_selected, and later events while a time is picked
brayv_timezoneUS/Easterntime_selected, and later events while a time is picked
brayv_contact_id8d2b47f0-…details_submitted, booking_completed
brayv_appointment_idc0a8e1d4-…booking_completed
brayv_appointment_start2026-11-20T14:00:00+00:00booking_completed
brayv_failure_reasontime_unavailablebooking_failed

Form Events

EventWhen it fires
brayv_form_loadedThe form has loaded. Once per page view.
brayv_form_startedThe visitor first types in, or changes, any field. Once per page view.
brayv_form_submittedThe form was submitted successfully. If the form has a Redirect URL, this fires before the redirect.
brayv_form_submit_failedThe submission didn't go through, for example because of a connection problem.
FieldExampleFilled in on
brayv_widget_typeformEvery event
brayv_widget_id5e7d0b13-…Every event
brayv_widget_nameWebsite Contact FormEvery event
brayv_contact_id8d2b47f0-…brayv_form_submitted
brayv_submission_ida41f6c88-…brayv_form_submitted

brayv_widget_name is the form's Name, which you otherwise only see inside brayv.ai. It is visible to anyone who inspects your page, so keep anything private out of it.

No Personal Information

Events never include anything the visitor typed: no name, phone number, email, address, or answers. That keeps them safe to send to GA4 and other tools that don't allow personal data. To connect an event back to the person, use brayv_contact_id or brayv_appointment_id, which match the contact and appointment in brayv.ai.

Setting Up Google Tag Manager

This example sends booked appointments to GA4 and Google Ads. The same pattern works for any tag and any event.

Step 1: In GTM, go to Variables > User-Defined Variables > New and create a Data Layer Variable for each field you want to use, for example brayv_appointment_id and brayv_widget_name.

Step 2: Go to Triggers > New and choose Custom Event. Set Event name to brayv_calendar_booking_completed.

  • To catch every step instead, enter ^brayv_calendar_ and check Use regex matching.

Step 3: Go to Tags > New and add the tags you want, using the trigger from Step 2:

  • GA4 Event: use an event name such as book_appointment, and add the variables from Step 1 as event parameters.
  • Google Ads Conversion Tracking: enter your conversion ID and label, and set Transaction ID to your brayv_appointment_id variable so your conversion action never counts the same booking twice.

Step 4: Click Preview, open your page, and book a test appointment. Each brayv_ event appears in Tag Assistant's event list as you click through the widget.

Step 5: Click Submit to publish the container.

Building a funnel: In GA4, go to Explore > Funnel exploration and use the calendar events as steps, in the order listed for your widget's flow. To use brayv_flow or other fields in GA4 reports, send them as event parameters and register them as custom dimensions.

Listening without Google Tag Manager

The widget and form also send each event to your page as a browser message. You can listen for it directly, which also works if you embedded with a plain <iframe> instead of the embed code:

<script>
window.addEventListener('message', function (e) {
  if (e.origin !== 'https://hub.brayv.ai') return;
  if (!e.data || e.data.type !== 'brayvEvent') return;
  if (e.data.event === 'brayv_calendar_booking_completed') {
    // Your code here, e.g. a gtag() or fbq() call.
    console.log('Booked', e.data.brayv_appointment_id);
  }
});
</script>

Each message has the same event name and brayv_ fields as the data layer events. Replace https://hub.brayv.ai with the domain in your embed code if it's different.

Troubleshooting

Problem: No brayv_ events in GTM Preview

Solution:

  • Make sure the page uses the standard embed code (the <script> ending in embed.js), not just an <iframe>
  • Make sure GTM is installed on the same page as the widget or form
  • Some site builders put custom code in a frame of its own (for example, an "embed HTML" element). Events then reach that frame instead of your page. Add the embed code directly to the page's HTML, or use the site builder's own custom code setting

Problem: date_selected or time_selected fires several times

Solution:

  • This is expected. They fire each time the visitor picks a date or time. For conversions, use brayv_calendar_booking_completed or brayv_form_submitted, which fire once per booking or submission

Problem: My site uses a renamed data layer

Solution:

  • Events are always pushed to window.dataLayer. If your GTM container uses a different data layer name, use the browser message listener above to forward the events yourself

Problem: A booking shows up more than once in Google Ads

Solution:

  • Check which column you're looking at. All conv. includes brayv.ai's own conversion actions (Brayv Lead, Brayv Converted Lead, Brayv Opportunity Won) alongside yours, so one booking can appear there more than once. Conversions only counts the actions each campaign bids on, so a booking counts once
  • If your own conversion action counts the same booking twice, set its Transaction ID to brayv_appointment_id (see Step 3 above)