Skip to main content

Connecting Google Tag Manager for appointment analytics

How do I connect Google Tag Manager for analytics?

Updated over a week ago

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

  1. Go to Settings > Scheduling > Online Booking.

  2. Scroll down to Analytics integration and click Edit.

  3. Add your Google Tag Manager container ID where prompted, and click Save when done.


Creating Tags in GTM

  1. Select the container you want to configure.

  2. In the Tags menu, click New.

  3. Enter a name for the tag

  4. In the Tag Configuration box, select Google tag.

  5. In the Tag ID field, enter your Google tag ID.

  6. 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.


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, includes startDate and endDate in ISO format

  • carepatron.booking.date_and_time_selected - fires when the client picks a timeslot, includes startDate and endDate

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_confirmation as the conversion trigger - set up a GTM trigger on Custom Event with the event name booking_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 postMessage event carepatron.booking.completed on the parent page, then push to the dataLayer manually from there. You can also use carepatron.booking.date_and_time_selected to 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.

Did this answer your question?