Skip to main content
All CollectionsLet your patients book onlineMarketing & tracking
Using Data Layer Variables with Google Tag Manager
Using Data Layer Variables with Google Tag Manager

Enhance tracking events using Data Layer Variables. Track specific appointment types, businesses and more! πŸ€“ πŸ“ˆ

Dara avatar
Written by Dara
Updated over a week ago

The "Data Layer" is a virtual layer between a Cliniko booking portal and Google Tag Manager. Technically known as a "JavaScript object", the data layer helps us pass data to Google Tag Manager (GTM) and trigger events to reporting platforms like Google Analytics.

Variables appear in the data layer upon booking completion and can be used to trigger events in Tag Manager.

Further information on the data layer can be found in this Google support article.

This article will cover:

Experience with Javascript is recommended when working with DLV's. Cliniko offers limited support for Google Tag Manager. We're not tracking/analytics experts, but always happy to share any knowledge we have!


What DLV's are available πŸ€”

How how to find an Appointment type ID

Appointment type ID can be used to track the specific appointment type, for example "Initial consultation". Your appointment type ID can be found in Cliniko when viewing the appointment type's settings.

Head over to Settings, and select Appointment types:

Select the appointment type you'd like to track from the list of existing appointment types, and find the "ID" in the URL:

The Appointment type ID will appear in the data layer upon booking completion.

How to find a Business ID

Head to Settings, and select Business information:

Click the Edit information button on the business you wish to track:

The "Business ID" can be found in the browser URL:

Where to find the "Booking Price" in Cliniko

The booking price is found over in Settings, then Billable items:

  • This article will help with configuring billable items in Cliniko.

  • This article will help relate a billable item to an appointment type.


How to configure DLV's in Google Tag Manager πŸ”§

Head over to the "Variables" section:

Select "New" under "User-Defined Variables":

Select "Data Layer Variable" from the list of variable types:

Paste the Data Layer Variable under "Data Layer Variable Name" and then "Save" your configuration:


How to trigger events using DLV's πŸš€

Data Layer Variables can be used to trigger conversion events, which can be reported in platforms like Google Analytics.

In this example, we will send a tracking event to Google Analytics for an initial appointment type using the appointment type ID as the tag trigger.

  • Select the preconfigured DLV from the list of variables (If the DLV is not available, select "New variable..." and add the variable to your list of defined variables.)

  • Set the parameter to "Equal"

  • Enter the Appointment type ID you wish to track

  • Publish your changes


Testing DLV's πŸ”Œ

We can use the Tag Assistant to see if data layer variables are working.

When running the Tag Assistant, you will find a "Data Layer" tab which will show what variables are firing:

We can use the "Tags" tab to see if the Google Tag fired:

Select the tag to confirm the firing conditions are correct:

There are other third party tools to help see activity in the Data Layer. The "datalayer checker" browser extension is pretty handy for checking activity without having to spin-up Tag Assistant:


If you're having issues with the GTM integration, please check our "Troubleshooting Tips for Google Tag Manager" guide or reach out to the Cliniko support team. Cliniko offers limited support for issues with the GTM integration and we will do our best to assist. πŸ€—

Did this answer your question?