By connecting a Google Tag Manager container ID, you can track and analyze client interactions and appointment behavior. This article includes steps to connect Google Tag Manager to your Carepatron workspace.
Adding GTM to your Workspace
Go to Settings > Scheduling > Online Booking.
Scroll down to Analytics integration and click Edit.
Add your Google Tag Manager container ID where prompted, and click Save when done.
Creating Tags in GTM
Go to Google Tag Manager.
Select the container you want to configure.
In the Tags menu, click New.
Enter a name for the tag
In the Tag Configuration box, select Google tag.
In the Tag ID field, enter your Google tag ID.
Click Save.
You may see a tag diagnostic prompting you to add a Google tag. Click View all issues to review suggestions, and click Add Google tag if necessary. Click Add to workspace to add the suggested changes to your workspace.
Read more: Set up your Google tag in Google Tag Manager
Tracking referral sources
To track referral sources, cross-domain tracking must be properly set up.
Here are some suggestions to assist: In the ‘Configuration settings’ section, consider adding additional parameters to support cross-domain tracking:
"cookie_flags" set to "samesite=none;secure"
In 2020, Chrome updated how cookies are shared across sites as part of ongoing security and privacy enhancements. More context can be found here: https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure
"allowLinker" set to "true"
This allows domains to pass the Client ID, where the tracking data is stored.
"send_page_view" set to "true"
This is a default setting added by Google to send page views. Leave set to "True".
Blacklisted Tags
The following tags are blacklisted:
id | tag | deets |
html | Custom HTML | could execute scripts that can extract and send user data |
adm | Adometry | could inadvertently send PII or PHI to advertising platforms |
ga | Google Analytics Tag (legacy) | lacks built-in privacy feats like IP anon by default & prone to misconfiguration |
gcs | Google Consumer Surveys Website Satisfaction |
|
Events or elements we recommend tracking for successful bookings
There's one GTM event that fires in the your own GTM container:
booking_confirmation- fires when the confirmation page loads after a successful booking (direct dataLayer push via the provider's GTM container). This is the most reliable trigger for a completed booking conversion.
There are also two postMessage signals broadcast to the parent window, which are useful if the booking widget is embedded via iframe on the provider's own website:
carepatron.booking.completed- fires after the booking is successfully created, includesstartDateandendDatein ISO formatcarepatron.booking.date_and_time_selected- fires when the client picks a timeslot, includesstartDateandendDate
These aren't GTM events themselves, but you can listen for them in your own page's JavaScript and manually push to their GTM dataLayer if needed.
Most reliable trigger
booking_confirmation is the most reliable trigger. It's a direct dataLayer push that fires once when the confirmation page mounts, so it won't double-fire or mis-fire.
Best practices for GTM + Carepatron booking links
Use
booking_confirmationas the conversion trigger - set up a GTM trigger on Custom Event with the event namebooking_confirmation. This maps cleanly to a GA4 conversion or Google Ads conversion event.For embedded booking widgets - if the booking widget is embedded via iframe or button on an external site, listen for the
postMessageeventcarepatron.booking.completedon the parent page, then push to the dataLayer manually from there. You can also usecarepatron.booking.date_and_time_selectedto track earlier intent signals.GTM container setup - the GTM container ID is configured per-provider in Carepatron's Online Booking settings (Settings → Online Booking → Analytics). Standard GTM configuration works without any custom data layer name adjustments.
Avoid using page URL as the only trigger - the booking flow is a single-page app, so URL changes alone may not reliably indicate step completion. Event-based triggers are much more accurate.
Our team will be available to answer any further questions you may have. Just reply via messenger through the Help channel in your workspace.


