Skip to main content
All CollectionsBooking tools (booking pages and booking widgets)The new booking tools - Widgets 2.0
Tracking events from your Appointedd booking tools with GA4 using Google Tag Manager
Tracking events from your Appointedd booking tools with GA4 using Google Tag Manager

Learn how to use custom JavaScript on your website to track events from our booking tools with GA4 using Google Tag Manager.

Ruta Vareikaite avatar
Written by Ruta Vareikaite
Updated over 2 weeks ago

🌎 Overview

Implementing GA4 tracking via Google Tag Manager on your booking tools allows you to efficiently monitor user engagement and gain valuable insights into customer behavior. By setting up GA4 tracking, you can capture data on interactions, such as when a customer engages with the booking widget or when they confirm a booking.

This guide will walk you through the step-by-step process of setting up GA4 tracking via Google Tag Manager on widget 2.0 in the popover mode only.

If you're using our legacy booking tools, such as Standard or Enterprise widget, you may wish to explore this guide instead.

Please note: This guide will help you set up tracking on the widget 2.0 in the popover mode only. We'll soon release a guide for widget 2.0 in the embed mode, too.



1. First, setup the required tracking code and decide on what events you want to track

Refer to our guide on Tracking events from your Appointedd booking tools on your website with JavaScript and follow those steps to setup the required event listeners for the events you want to track.

You can also inject the above code in Google Tag Manager instead of placing it directly on your website manually by following these steps:

  1. Log in to Google Tag Manager and navigate to your workspace.

  2. Click on Tags in the left-hand menu.

  3. Click New to create a new tag.

  4. Name your tag (e.g. Appointedd event listener)

  5. Under Tag Configuration, select Custom HTML as the tag type.

  6. In the HTML code editor, insert the required script, adjusting it according to which events you want to track

  7. Click on Triggering and select All pages.

  8. Click Save


2. Forward events to GA4 data layer in your event listeners

In each of your event listeners, forward the event (and any required additional data) using the Google Tag Manager dataLayer object.

// Or bookingTool.on(...) if you're using embedded mode.
window.Appointedd.popovers.on("READY", function() {
try {
window.dataLayer.push({
event: "READY",
});
} catch (err) {
console.error(err);
}
});


3. Create a custom trigger in Google Tag Manager


Next, you need to create a custom trigger that listens for the event names in the data layer.

  1. Go to Triggers in GTM.

  2. Click New and name your trigger (e.g. “Appointedd BOOKING_CREATED”)

  3. Choose Custom Event as the trigger type.

  4. In the Event Name field, enter the event name you pushed to the data layer (e.g., BOOKING_CREATED).

  5. Under This trigger fires on select All Custom Events, unless you would like to trigger the event on specific pages. If so, select Some Custom Events and set any additional conditions

  6. Click Save.


4. Finally, create a GA4 tag to track events


Now, set up a tag in GTM to send the events to Google Analytics 4 (GA4).

  1. Go to Tags in GTM.

  2. Click New and name your tag (e.g. ”GA4 - Appointedd BOOKING_CREATED - tag”)

  3. Click on Tag Configuration, select Google Analytics, and then select Google Analytics: GA4 Event

  4. Enter your Measurement ID and in the Event Name field, enter the event name from the data layer (e.g. BOOKING_CREATED)

  5. Add any custom parameters you’d like to track (e.g., service name, booking date, etc.).

  6. Select Triggering, and then select the custom trigger you created in Step 3 of the Create a custom trigger in Google Tag Manager instructions above.

  7. Save the tag.


5. Test your tags are working

Next, access Google Tag Managers Tag Assistant tool to test if the tags and triggers you have set are working properly before pushing it live to your website. To do this following the steps below.

  1. Select Preview

  2. In the Connect Tag Assistant to your site box, select the URL on your website that has your Appointedd booking widget on it and then click Connect

  3. This will open up the page you have entered in a separate tab. Here find your Appointedd booking widget on this page and complete a test booking

  4. Go back to Google Tag Assistant and check if the tags you have created are under Tags Fired.
    ​

  5. A. If the tags have fired correctly, jump straight to section 6 to publish the tags to your website.
    ​
    ​B. If one or more of the tags have not fired correctly and appear under Tags Not Fired this means one or more of the instructions above have not been implemented correctly. Go back through the steps again and fix any issues or missing steps. If you are still struggling to get the tags to fire contact Appointedd’s customer support team - support@appointedd.com.


6. Publish the tags to your website

Finally, submit the tags to your live website in order to be able to track your Appointedd events in Google Analytics 4.

  1. When your tags are firing correctly, go back to your Google Tag Manager workspace

  2. Click Submit

  3. Create a name and description for your tag submission

  4. Click Publish. This will push the tags to your live website.


If you have any feedback we would love to hear it 👂

Keywords: Google Analytics, GA, GA4, Google tag manager, tracking.

Did this answer your question?