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
- 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. - 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):
brayv_calendar_loadedbrayv_calendar_date_selectedbrayv_calendar_time_selectedbrayv_calendar_details_startedbrayv_calendar_booking_completed
Details-first flow:
brayv_calendar_loadedbrayv_calendar_details_startedbrayv_calendar_details_submittedbrayv_calendar_date_selectedbrayv_calendar_time_selectedbrayv_calendar_booking_completed
| Event | When it fires |
|---|---|
brayv_calendar_loaded | The widget has loaded and is showing its first step. Once per page view. |
brayv_calendar_date_selected | The visitor picks a date. Fires again if they pick another date. |
brayv_calendar_time_selected | The visitor picks a time. Fires again if they pick another time. |
brayv_calendar_details_started | The visitor first types in, or changes, any field on the details form. Once per page view. |
brayv_calendar_details_submitted | Details-first flow only: the visitor's details were accepted and available times are showing. |
brayv_calendar_booking_blocked | One of your booking rules turned the visitor away. In the details-first flow this can happen before they see any times. |
brayv_calendar_booking_failed | The 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_completed | The 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.
| Field | Example | Filled in on |
|---|---|---|
brayv_widget_type | calendar | Every event |
brayv_widget_id | 3f1c9a2e-… | Every event |
brayv_widget_name | Initial Design Consultation | Every event |
brayv_flow | calendar_first or form_first | Every event |
brayv_date | 2026-11-20 | date_selected, time_selected, and later events while a time is picked |
brayv_time | 9:00 AM | time_selected, and later events while a time is picked |
brayv_timezone | US/Eastern | time_selected, and later events while a time is picked |
brayv_contact_id | 8d2b47f0-… | details_submitted, booking_completed |
brayv_appointment_id | c0a8e1d4-… | booking_completed |
brayv_appointment_start | 2026-11-20T14:00:00+00:00 | booking_completed |
brayv_failure_reason | time_unavailable | booking_failed |
Form Events
| Event | When it fires |
|---|---|
brayv_form_loaded | The form has loaded. Once per page view. |
brayv_form_started | The visitor first types in, or changes, any field. Once per page view. |
brayv_form_submitted | The form was submitted successfully. If the form has a Redirect URL, this fires before the redirect. |
brayv_form_submit_failed | The submission didn't go through, for example because of a connection problem. |
| Field | Example | Filled in on |
|---|---|---|
brayv_widget_type | form | Every event |
brayv_widget_id | 5e7d0b13-… | Every event |
brayv_widget_name | Website Contact Form | Every event |
brayv_contact_id | 8d2b47f0-… | brayv_form_submitted |
brayv_submission_id | a41f6c88-… | 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_idvariable 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 inembed.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_completedorbrayv_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)