Skip to main content

Send Online Booking Funnel Data to Google Analytics 4 (GA4)

Alyssa Elso avatar
Written by Alyssa Elso
Updated this week

This section shows you how to use Google Tag Manager (GTM) to send Practice by Numbers booking events into Google Analytics 4 (GA4).

This allows you to analyze the full online booking funnel, not just final conversions.

  • Where you’ll work: Google Tag Manager tagmanager.google.com

  • What you’ll create:

    • Data Layer Variables

    • Triggers

    • GA4 Event Tags

  • What you won’t touch:

    • Practice by Numbers code (events are already sent automatically)


Why This Matters

  • Google Ads tells you what converted.

  • GA4 tells you how users got there.

With GA4, you can:

  • See where patients drop off in the booking flow

  • Compare visit types, locations, and providers

  • Build custom booking dashboards

  • Attribute bookings to traffic sources


How It Works

What Practice by Numbers Does Automatically ✅

  • Sends booking events to GTM’s dataLayer

  • Includes details like:

    • Appointment date & time

    • Visit type

    • Provider

    • Location

    • Patient type

What You Configure in GTM ⚙️

  • Create Data Layer Variables to capture that data

  • Create triggers for booking events

  • Create GA4 Event tags to send data to GA4

What GA4 Receives 📊

  • Custom events (ex: pbn_appointment_booked)

  • Detailed event parameters

  • Full visibility into your booking funnel


Prerequisites

Before starting, make sure:

✅ You have a Google Analytics 4 property
✅ You already have a GA4 Configuration tag in GTM

If you don’t have a GA4 Configuration tag, this setup requires GA4 onboarding and is outside the scope of this guide. Contact your marketing agency for assistance.


Create Data Layer Variables

These variables allow GA4 to receive appointment details (date, provider, visit type, etc.).

How to Create a Variable

For each variable below, follow the same steps:

  • In GTM, click Variables

  • Scroll to User-Defined Variables

  • Click New

  • Rename the variable (see table below)

  • Click Variable Configuration

  • Select Data Layer Variable

  • Enter the Data Layer Variable Name

  • Click Save


Required Variables to Create

Variable Name (GTM)

Data Layer Variable Name

DLV – appointment_date

appointment_date

DLV – appointment_time

appointment_time

DLV – visit_type_id

visit_type_id

DLV – visit_type_name

visit_type_name

DLV – provider_id

provider_id

DLV – provider_name

provider_name

DLV – location_id

location_id

DLV – location_name

location_name

DLV – patient_type

patient_type

DLV – practice_slug

practice_slug

⏱️ This takes about 5 minutes and only needs to be done once.


Create Triggers for GA4 Events

You already created the Appointment Booked trigger earlier. Now create two more.

Trigger 1: Widget Opened

  • Go to TriggersNew

  • Name: PBN – Widget Opened

  • Trigger Type: Custom Event

  • Event name: pbn_booking_widget_opened

  • Click Save

Trigger 2: Patient Info Entered

  • Click New

  • Name: PBN – Patient Info Entered

  • Trigger Type: Custom Event

  • Event name: pbn_patient_info_entered

  • Click Save

You can add triggers for additional events later using the same pattern.


Create GA4 Event Tag – Appointment Booked

This sends the most important booking event to GA4.

Create the Tag

  • Go to TagsNew

  • Name: GA4 Event – PBN Appointment Booked

  • Tag Type: Google Analytics: GA4 Event

Configure the Tag

  • Select your existing GA4 Configuration tag

  • Event Name: pbn_appointment_booked

Add Event Parameters

Click Add Row for each parameter:

Parameter Name

Value

appointment_date

{{DLV – appointment_date}}

appointment_time

{{DLV – appointment_time}}

visit_type_name

{{DLV – visit_type_name}}

provider_name

{{DLV – provider_name}}

location_name

{{DLV – location_name}}

patient_type

{{DLV – patient_type}}

Attach Trigger

  • Trigger: PBN – Appointment Booked

  • Click Save


Create GA4 Event Tags for Other Events

Repeat the same steps above for the following events:

GA4 Event – Widget Opened

  • Event Name: pbn_booking_widget_opened

  • Parameter:

    • practice_slug → {{DLV – practice_slug}}

  • Trigger: PBN – Widget Opened

GA4 Event – Patient Info Entered

  • Event Name: pbn_patient_info_entered

  • Parameter:

    • patient_type → {{DLV – patient_type}}

  • Trigger: PBN – Patient Info Entered

Publish Your Changes

  • Click Submit

  • Version Name: Added PBN events to GA4

  • Click Publish

✅ GA4 tracking is now live.


Verify Events in GA4

Option 1: DebugView (Real-Time Testing)

  • Best for: Immediate verification while testing

    1. Go to your Google Analytics 4 property at analytics.google.com

    2. In the left sidebar, click "Admin" (gear icon at bottom)

    3. Under "Data display", click "DebugView"

    4. Open your booking widget in another tab

    5. Complete a test booking

    6. Back in DebugView, you should see events appear in real-time:

      • pbn_booking_widget_opened

      • pbn_appointment_booked

      • etc.

    7. Click on any event to see its parameters

    Tip: DebugView only shows events from sessions where the GA4 debug mode is active. The GTM Preview mode automatically enables this!


Option 2: Realtime Report (Live Traffic)

  • Best for: Seeing actual user events as they happen

    1. In left sidebar, click "Reports"

    2. Click "Realtime"

    3. Scroll down to "Event count by Event name" card

    4. You should see your events listed:

      • pbn_appointment_booked

      • pbn_booking_widget_opened

      • pbn_patient_info_entered

      • etc.

    5. Click on an event name to see more details

    Shows: Events from the last 30 minutes


Option 3: Events Report (Historical Data)

Best for: Analyzing trends and conversions over time

  • In left sidebar, click "Reports"

  • Click "Engagement"

  • Click "Events"

  • You'll see a table with all your events:

    • Event name

    • Event count

    • Total users

    • Event value (if configured)


Mark Appointment Booked as a Conversion in GA4

  • GA4 → AdminEvents

  • Find pbn_appointment_booked

  • Toggle Mark as conversion ON

Now you can:

  • Track booking conversion rates

  • Attribute bookings to channels

  • Optimize campaigns using GA4 data


Troubleshooting: Events Not Showing

Problem: Events not appearing in any view

Check these:

  1. ✅ Did you create the GA4 Event tags in GTM?

    • Go to GTM → Tags

    • Look for GA4 Event - PBN Appointment Booked

  2. ✅ Is your GA4 Configuration tag firing?

    • Use GTM Preview mode

    • Check "Tags Fired" section

    • Should see your GA4 Config tag

  3. ✅ Are events firing in GTM?

    • Use GTM Preview mode

    • Complete a test booking

    • Check for pbn_appointment_booked in "Messages" tab

  4. ✅ Is the GA4 Measurement ID correct?

    • In GTM, check your GA4 Configuration tag

    • Measurement ID format: G-XXXXXXXXXX

    • Verify it matches your GA4 property

  5. ✅ Has it been 24-48 hours?

    • DebugView: Instant

    • Realtime: 30 minute delay

    • Reports: 24-48 hour delay

Did this answer your question?