Skip to main content

Google Tag Manager Setup Guide for Agencies & Practices

✅ Track every appointment booking as a conversion in Google Ads✅ Send booking funnel events to Google Analytics 4 for analysis✅ Time Required: 30-45 minutes for first-time setup

Rohit Garg avatar
Written by Rohit Garg
Updated over a week ago

Before You Start

What is Google Tag Manager?

Google Tag Manager (GTM) is a free tool that lets you add tracking codes to your website without editing code. Think of it as a central control panel for all your marketing tracking.

Important: Two-Part Setup

Our system does Part A automatically (in our code):

  • ✅ We send booking events (like "appointment booked") to GTM's dataLayer

  • ✅ This happens automatically once you enable GTM in PracticeByNumbers

You must do Part B manually (in Google's GTM dashboard):

  • ⚠️ Configure GTM to forward those events to your marketing platforms

  • ⚠️ This happens in tagmanager.google.com (NOT in our code!)

  • ⚠️ You'll create "tags" (small code snippets) in GTM's web interface

Without Part B, the events are sent but nothing happens with them!

🔑 Key Concept:
Think of it like a relay race:

  • We hand off the baton (push events to dataLayer)

  • GTM catches the baton (monitors dataLayer)

  • You configure GTM to run with it (forward to Google Ads, Facebook, etc.)

  • Your marketing platforms receive the finish (conversions tracked!)

Event Naming

All our events use the pbn_ prefix to prevent conflicts:

  • pbn_appointment_booked ← Main conversion event

  • pbn_booking_widget_opened ← Funnel start

  • pbn_location_selected, pbn_visit_type_selected, etc.


Master Reference: All GTM Components

📋 Complete Checklist
This section lists EVERY trigger, variable, and event you'll need to create in GTM. Use this as a reference when following the step-by-step instructions later.

Events We Send (Automatic)

These events are automatically sent by PracticeByNumbers to GTM's dataLayer (14 total events):

Event Name

When It Fires

Use Case

pbn_booking_widget_opened

Widget loads

Funnel start, remarketing

pbn_location_selected

User picks location

Funnel analysis

pbn_visit_type_selected

User picks visit type

Funnel analysis

pbn_provider_selected

User picks provider

Funnel analysis

pbn_timeslot_selected

User picks date/time

Funnel analysis

pbn_patient_info_entered

User submits contact form

Lead event

pbn_draft_appointment_created

Backend saves appointment

Backend confirmation (draft, not booked yet)

pbn_payment_screen_shown

Payment page loads

Payment funnel tracking

pbn_payment_info_entered

User submits credit card

Payment completion tracking

pbn_insurance_screen_shown

Insurance page loads

Insurance funnel tracking

pbn_insurance_info_entered

User submits insurance

Insurance completion tracking

pbn_otp_verification_shown

OTP/verification page loads

Verification funnel tracking

pbn_appointment_booked

Final confirmation shown

MAIN CONVERSION

pbn_booking_error

Booking fails

Error tracking

Category: All events include event_category: 'pbn_appointment_booking'

Note: Not all practices use all steps. Payment, insurance, and OTP screens only appear if enabled.


Triggers to Create in GTM

Create these triggers in GTM (one for each event you want to track):

Trigger Name

Type

Event Name

When to Use

PBN - Appointment Booked

Custom Event

pbn_appointment_booked

REQUIRED - Main conversion

PBN - Widget Opened

Custom Event

pbn_booking_widget_opened

Recommended - Funnel start

PBN - Patient Info Entered

Custom Event

pbn_patient_info_entered

Recommended - Lead event

PBN - Draft Appointment Created

Custom Event

pbn_draft_appointment_created

Recommended - Backend confirmation

PBN - Payment Screen Shown

Custom Event

pbn_payment_screen_shown

Optional - Payment funnel

PBN - Payment Info Entered

Custom Event

pbn_payment_info_entered

Optional - Payment completed

PBN - Insurance Screen Shown

Custom Event

pbn_insurance_screen_shown

Optional - Insurance funnel

PBN - Insurance Info Entered

Custom Event

pbn_insurance_info_entered

Optional - Insurance completed

PBN - OTP Verification Shown

Custom Event

pbn_otp_verification_shown

Optional - Verification step

PBN - Location Selected

Custom Event

pbn_location_selected

Optional - Funnel step

PBN - Visit Type Selected

Custom Event

pbn_visit_type_selected

Optional - Funnel step

PBN - Provider Selected

Custom Event

pbn_provider_selected

Optional - Funnel step

PBN - Timeslot Selected

Custom Event

pbn_timeslot_selected

Optional - Funnel step

PBN - Booking Error

Custom Event

pbn_booking_error

Optional - Error tracking

How to Create: Triggers → New → Custom Event → Enter event name exactly as shown

Priority Triggers (Create these first):

  1. PBN - Appointment Booked - Main conversion (REQUIRED)

  2. PBN - Draft Appointment Created - Backend confirmation

  3. PBN - Patient Info Entered - Lead generation


Data Layer Variables to Create in GTM

Create these variables to capture event data (needed for GA4 and other advanced tracking):

Variable Name

Data Layer Variable Name

Description

DLV - appointment_id

appointment_id

Appointment ID (for tracking after creation)

DLV - appointment_date

appointment_date

Date of appointment (YYYY-MM-DD)

DLV - appointment_time

appointment_time

Time of appointment (HH:MM)

DLV - visit_type_id

visit_type_id

Visit type ID number

DLV - visit_type_name

visit_type_name

Visit type name (e.g., "Cleaning")

DLV - provider_id

provider_id

Provider ID number

DLV - provider_name

provider_name

Provider name (e.g., "Dr. Smith")

DLV - location_id

location_id

Location ID number

DLV - location_name

location_name

Location name (e.g., "Downtown Office")

DLV - patient_type

patient_type

"new" or "returning" (generic only)

DLV - payment_method

payment_method

Payment method (e.g., "credit_card")

DLV - has_insurance

has_insurance

true/false if insurance provided

DLV - practice_slug

practice_slug

Practice identifier

DLV - utm_source

utm_source

UTM source parameter

DLV - utm_medium

utm_medium

UTM medium parameter

DLV - utm_campaign

utm_campaign

UTM campaign parameter

DLV - error_type

error_type

Error type (for booking_error event)

DLV - error_message

error_message

Error message (for booking_error event)

How to Create: Variables → User-Defined Variables → New → Data Layer Variable → Enter name

When Needed: Required for GA4 event parameters and advanced tracking

Most Important Variables (Create these first):

  • DLV - appointment_id - Tracks specific appointments

  • DLV - appointment_date - When appointment is scheduled

  • DLV - visit_type_name - What type of appointment

  • DLV - provider_name - Which provider


Example Event Data Structure

When a booking is confirmed, we send this to GTM's dataLayer:

{   // Event identifier   event: 'pbn_appointment_booked',   event_category: 'pbn_appointment_booking',      // Appointment details   appointment_date: '2024-10-20',   appointment_time: '14:30',      // Visit details   visit_type_id: 123,   visit_type_name: 'New Patient Exam',      // Provider details   provider_id: 456,   provider_name: 'Dr. Sarah Johnson',      // Location details   location_id: 789,   location_name: 'Downtown Office',      // Patient type (generic only - NO PII!)   patient_type: 'new', // or 'returning'      // Practice identifier   practice_slug: 'avondalesmiles',      // Marketing attribution (if available)   utm_source: 'google',   utm_medium: 'cpc',   utm_campaign: 'fall-promotion',   utm_term: 'dentist near me',   utm_content: 'ad-variant-1',      // Tracking tokens (non-identifying)   external_id: 'ext_abc123',   rwg_token: 'rwg_xyz789' }

Use these variables in your GTM tags to pass data to Google Ads, GA4, Facebook, etc.


Tags You'll Create (Platform-Specific)

Depending on which platforms you use, you'll create these tags:

For Google Ads:

  • Tag: Google Ads - Appointment Booked Conversion

    • Type: Google Ads Conversion Tracking

    • Trigger: PBN - Appointment Booked

For Google Analytics 4:

  • Tag: GA4 Event - PBN Appointment Booked

    • Type: GA4 Event

    • Trigger: PBN - Appointment Booked

    • Parameters: Use {{DLV - ...}} variables

  • Tag: GA4 Event - PBN Widget Opened

    • Type: GA4 Event

    • Trigger: PBN - Widget Opened

  • Tag: GA4 Event - PBN Patient Info Entered

    • Type: GA4 Event

    • Trigger: PBN - Patient Info Entered

For Facebook Pixel:

  • Tag: Facebook Pixel - Base Code

    • Type: Custom HTML

    • Trigger: All Pages

  • Tag: Facebook Pixel - PBN Schedule Event

    • Type: Custom HTML

    • Trigger: PBN - Appointment Booked

  • Tag: Facebook Pixel - PBN Lead Event

    • Type: Custom HTML

    • Trigger: PBN - Patient Info Entered

  • Tag: Facebook Pixel - PBN ViewContent Event

    • Type: Custom HTML

    • Trigger: PBN - Widget Opened


Quick Setup Checklist

Use this checklist as you work through the setup:

Minimum Setup (Google Ads only):

  • [ ] Create trigger: PBN - Appointment Booked

  • [ ] Create tag: Google Ads Conversion Tracking

  • [ ] Publish container

  • [ ] Test in Preview mode

Recommended Setup (Google Ads + Funnel):

  • [ ] Create 3 triggers: Appointment Booked, Widget Opened, Patient Info Entered

  • [ ] Create Google Ads conversion tag

  • [ ] Create 3 GA4 event tags (optional)

  • [ ] Create 10+ Data Layer Variables (for GA4)

  • [ ] Publish container

  • [ ] Test in Preview mode

Full Setup (All Platforms):

  • [ ] Create all 8 triggers

  • [ ] Create all 15+ Data Layer Variables

  • [ ] Create Google Ads tags

  • [ ] Create GA4 tags

  • [ ] Create Facebook Pixel tags

  • [ ] Publish container

  • [ ] Test in Preview mode

  • [ ] Verify in each platform (Ads, GA4, Facebook)


Part 1: Create Your GTM Account

Step 1.1: Go to Google Tag Manager

  1. Open your web browser

  2. Click the blue "Sign in" button in the top right

  3. Sign in with your Google account (the same one you use for Google Ads or Gmail)

Step 1.2: Create an Account

If this is your first time:

  1. You'll see a welcome screen

  2. Click the blue "Create Account" button

Fill out the form:

  1. Account Name: Enter your practice name

    • Example: Avondale Dental Practice

    • This is just for your reference, patients won't see it

  2. Country: Select your country from the dropdown

  3. Check the box: ☑ "Share data with Google and others anonymously"

  4. Click "Continue"

Step 1.3: Set Up Your Container

A "container" holds all your tracking codes. You need one per website.

Fill out the container form:

  1. Container name: Use your website URL

    • Example: avondaledental.com

    • This helps you identify it if you have multiple websites

  2. Target platform: Click the "Web" option

    • This is for your practice website

    • Don't choose Mobile, AMP, or Server

  3. Click "Create"

Step 1.4: Accept the Terms

  1. A popup will appear with Google Tag Manager Terms of Service

  2. Check the box: ☑ "I also accept the Data Processing Terms"

  3. Click "Yes" at the top right

Step 1.5: Get Your Container ID

After accepting terms, you'll see installation instructions:

  1. Look at the code in the first box

  2. Find the text that looks like: GTM-XXXXXXX

    • The X's will be letters and numbers

    • Example: GTM-ABC1234 or GTM-K8HT6WM

  3. Copy this Container ID - you'll need it in Part 2

  4. Important: Click the "X" in the top right to close this popup

    • You DON'T need to install this code yourself

    • PracticeByNumbers will load it automatically for you

Step 1.6: You're Now in Your GTM Workspace

You should see a screen with:

  • Your Container ID at the top (e.g., GTM-ABC1234)

  • Navigation on the left: Tags, Triggers, Variables, etc.

  • A blue "Submit" button in the top right

Keep this tab open - you'll use it in Parts 3-5


Part 2: Enable GTM in PracticeByNumbers

Now we'll connect your GTM container to your booking widget.

Step 2.1: Log Into PracticeByNumbers Admin

  1. Go to your PracticeByNumbers admin dashboard

  2. Log in with your practice account

Step 2.2: Navigate to Widget Settings

  1. In the left sidebar, click "Online Booking"

  2. Then click "Widget Section" (or "Widget Settings")

Step 2.3: Scroll to GTM Section

  1. Scroll down past all the settings

  2. Look for a section titled: "Google Tag Manager (GTM) Conversion Tracking"

  3. It should be below the "Google Reserve" section

Step 2.4: Enable GTM Tracking

  1. Find the toggle switch labeled "Enable GTM Tracking"

  2. Click it to turn it ON (it should turn blue/green)

Step 2.5: Enter Your Container ID

  1. Look for the input field labeled "GTM Container ID"

  2. Paste the Container ID you copied in Step 1.5

    • Format: GTM-XXXXXXX

    • Example: GTM-ABC1234

  3. If you see an error:

    • Make sure it starts with GTM-

    • Make sure there are no spaces before or after

    • Make sure you copied the whole ID

Step 2.6: Select Events to Track

You'll see checkboxes for 14 different events. Here's what each means:

✅ MUST SELECT (Required):

  • Appointment Booked - This is your main conversion!

    • Fires when patient sees final confirmation page

    • Use this to track conversions in Google Ads

✅ HIGHLY RECOMMENDED:

  • Draft Appointment Created - Backend confirms appointment saved

    • Fires when appointment is created in database (before payment/insurance/OTP)

    • Helps track drop-off between "created" and "fully booked"

  • Patient Info Entered - Tracks when user submits contact form

    • Good for: Facebook "Lead" event, abandonment tracking

  • Widget Opened - Tracks when booking widget loads

    • Good for: Funnel analysis, Facebook "ViewContent" event

💰 PAYMENT & INSURANCE TRACKING (If you collect payment/insurance):

  • Payment Screen Shown - User reaches credit card page

  • Payment Info Entered - User submits credit card

  • Insurance Screen Shown - User reaches insurance page

  • Insurance Info Entered - User submits insurance info

  • OTP Verification Shown - User reaches verification screen

ℹ️ OPTIONAL (For detailed funnel analysis):

  • Location Selected - User picks practice location

  • Visit Type Selected - User picks appointment type

  • Provider Selected - User picks doctor

  • Time Slot Selected - User picks date/time

  • Booking Error - When booking fails

My Recommendation for Beginners: Check these to start:

  • ☑ Appointment Booked (REQUIRED - main conversion)

  • ☑ Draft Appointment Created (backend confirmation)

  • ☑ Patient Info Entered (lead tracking)

  • ☑ Widget Opened (funnel start)

Add payment/insurance events if applicable:

  • ☑ Payment Info Entered (if you collect payment)

  • ☑ Insurance Info Entered (if you collect insurance)

You can add more later!

Step 2.7: Save Your Settings

  1. Click the blue "Save GTM Settings" button at the bottom

  2. Wait for the success message: "GTM settings updated successfully"

  3. Done! PracticeByNumbers is now ready to send events to GTM


Part 3: Configure GTM to Track Google Ads Conversions

🎯 What This Section Does
This teaches you how to configure Google Tag Manager (in Google's dashboard) to send booking conversions to Google Ads.

Where You'll Work: tagmanager.google.com (GTM dashboard)
What You'll Create: A trigger + tag that fires when appointments are booked
What You WON'T Touch: PracticeByNumbers code (we already send events automatically)

This is the most important part - tracking bookings as conversions in Google Ads.

How It Works

  1. We automatically do this ✅:

    • Push pbn_appointment_booked event to GTM's dataLayer

    • Include data like visit_type, appointment_date, etc.

  2. You configure this in GTM ⚙️:

    • Create a trigger that listens for pbn_appointment_booked

    • Create a Google Ads Conversion tag

    • Link the tag to the trigger

  3. Google Ads receives 📊:

    • Conversion data with your Conversion ID and Label

    • Shows up in your Google Ads dashboard

    • Can optimize campaigns based on conversions

Prerequisites

Before starting:

  • ✅ You must have a Google Ads account

  • ✅ You must have created a conversion action in Google Ads

  • ✅ You need your Conversion ID and Conversion Label

Don't have these yet? See Appendix A at the bottom of this guide.

Step 3.1: Go Back to Your GTM Workspace

  1. Go back to the browser tab with Google Tag Manager

  2. You should see your workspace with the navigation on the left

Step 3.2: Create a Trigger for Appointment Bookings

A "trigger" tells GTM when to fire a tag. We need one for bookings.

Follow these exact steps:

  1. In the left sidebar, click "Triggers"

  2. Click the red "New" button in the top right

  3. At the top, click the pencil icon next to "Untitled Trigger"

  4. Name it: PBN - Appointment Booked

  5. Click away to save the name

  6. Click in the large box in the middle (it says "Trigger Configuration")

  7. In the popup, find and click: "Custom Event"

    • Scroll down if you don't see it

    • It's in the "Other" section at the bottom

  8. You'll see a form with one field: "Event name"

  9. Type exactly: pbn_appointment_booked

    • ⚠️ Must be all lowercase

    • ⚠️ Use underscores _, not hyphens -

    • ⚠️ Must match exactly including the pbn_ prefix

  10. Leave "This trigger fires on" set to "All Custom Events"

  11. Click the blue "Save" button in the top right

✅ You've created your first trigger!

Step 3.3: Create a Google Ads Conversion Tag

A "tag" is the actual tracking code that runs. Now we'll create one for Google Ads.

Follow these exact steps:

  1. In the left sidebar, click "Tags"

  2. Click the red "New" button in the top right

  3. At the top, click the pencil icon next to "Untitled Tag"

  4. Name it: Google Ads - Appointment Booked Conversion

  5. Click away to save the name

  6. Click in the box labeled "Tag Configuration"

  7. In the popup, scroll to find: "Google Ads Conversion Tracking"

    • It's under "Google Ads" section with the Google Ads logo

    • Click it

  8. You'll see a form with several fields. Fill them out:

    a) Conversion ID:

    • This is a number like 123456789 or AW-123456789

    • You got this from your Google Ads account

    • Paste it here

    b) Conversion Label:

    • This looks like a random string: a1B2c3D4e5F6g7H8

    • You got this from your Google Ads account

    • Paste it here

    c) Conversion Value (optional):

    • If you know the average value of an appointment, enter it here

    • Example: 100 for $100

    • Or leave blank to not track value

    d) Currency Code (optional):

    • Only fill if you entered a Conversion Value

    • Example: USD or CAD

    • Leave blank if you didn't enter a value

    e) Order ID (optional):

    • Leave blank - we don't use order IDs for appointments

    f) Phone conversion number (optional):

    • Leave blank

  9. Scroll down to the "Triggering" section at the bottom

  10. Click in the box labeled "Triggering"

  11. In the popup, find the trigger you created: "PBN - Appointment Booked"

  12. Click on it

  13. Click the blue "Save" button in the top right

✅ Your Google Ads conversion tag is ready!

Step 3.4: Publish Your Changes

Tags don't go live until you publish them.

Follow these steps:

  1. Look at the top right corner of the screen

  2. Click the blue "Submit" button

  3. A popup appears asking for version details:

    • Version Name: Type Added PBN appointment booking conversion

    • Version Description: Type Tracks PBN bookings as Google Ads conversions (optional)

  4. Click the blue "Publish" button in the top right of the popup

  5. You'll see a success message and a version number

✅ Your Google Ads conversion tracking is now LIVE!

Step 3.5: Test It (Important!)

Let's make sure it works:

  1. In GTM, click the "Preview" button in the top right

    • It's next to the Submit button

  2. A popup appears: "Tag Assistant"

  3. In the field "Your website's URL", enter your booking widget URL

    • Example: https://avondaledental.com/schedule/

  4. Click "Connect"

  5. A new tab opens with your booking widget

  6. Go through a test booking:

    • Select location, visit type, provider, time

    • Fill out patient information

    • Click "Book Appointment"

  7. Go back to the Tag Assistant tab

  8. Look for the event pbn_appointment_booked

  9. Click on it

  10. Look for your tag: Google Ads - Appointment Booked Conversion

  11. It should show "Tags Fired" with a green checkmark ✓

If you see the green checkmark, it works!

If you see a red X, see Troubleshooting section at the bottom.


Part 4: Configure GTM to Send Events to Google Analytics 4

🎯 What This Section Does
This teaches you how to configure Google Tag Manager to forward our booking events to Google Analytics 4 (GA4).

Where You'll Work: tagmanager.google.com (GTM dashboard)
What You'll Create: Variables + triggers + GA4 Event tags
What You WON'T Touch: PracticeByNumbers code (we already send events automatically)

Send booking events to GA4 for detailed funnel analysis.

How It Works

  1. We automatically do this ✅:

    • Push booking events to GTM's dataLayer

    • Include data like appointment_date, visit_type_name, etc.

  2. You configure this in GTM ⚙️:

    • Create Data Layer Variables to capture our data

    • Create triggers for each event

    • Create GA4 Event tags that send to GA4

    • GTM forwards data to Google Analytics

  3. GA4 receives 📊:

    • Custom events like pbn_appointment_booked

    • All the parameters (date, visit type, provider, etc.)

    • Can analyze full booking funnel

Prerequisites

  • ✅ You must have a Google Analytics 4 property set up

  • ✅ You must have a GA4 Configuration tag already in GTM

    • If you don't, this is beyond this guide's scope - contact your marketing agency

Step 4.1: Create Data Layer Variables

We need to create variables to pass event data to GA4.

For each variable below, follow these exact steps:

  1. In the left sidebar, click "Variables"

  2. Scroll down to "User-Defined Variables" section

  3. Click the "New" button

  4. Click the pencil icon at the top and name it (see table below)

  5. Click in "Variable Configuration" box

  6. Scroll down and click "Data Layer Variable"

  7. In the "Data Layer Variable Name" field, enter the name from the table

  8. Click "Save"

Create these 10 variables:

Variable Name (in 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 will take about 5 minutes. It's worth it!

Step 4.2: Create Triggers for Each Event

You already created one trigger (pbn_appointment_booked). Now create 2 more for GA4.

Trigger 1: Widget Opened

  1. Click "Triggers" in left sidebar

  2. Click "New"

  3. Name it: PBN - Widget Opened

  4. Click "Trigger Configuration"

  5. Select "Custom Event"

  6. Event name: pbn_booking_widget_opened

  7. Click "Save"

Trigger 2: Patient Info Entered

  1. Click "New" again

  2. Name it: PBN - Patient Info Entered

  3. Click "Trigger Configuration"

  4. Select "Custom Event"

  5. Event name: pbn_patient_info_entered

  6. Click "Save"

Note: You can create triggers for other events later (location_selected, visit_type_selected, etc.) using the same pattern.

Step 4.3: Create GA4 Event Tag for Appointment Booked

Now we'll create a GA4 event tag.

Follow these steps:

  1. Click "Tags" in left sidebar

  2. Click "New"

  3. Name it: GA4 Event - PBN Appointment Booked

  4. Click "Tag Configuration"

  5. Find and click: "Google Analytics: GA4 Event"

    • It's under "Google Analytics" section

  6. Fill out the form:

    a) Configuration Tag:

    • Click the dropdown

    • Select your existing GA4 Configuration tag

    • It's usually named something like "GA4 Config" or "Google Analytics 4"

    • If you don't see one, you need to set up GA4 first

    b) Event Name:

    • Type: pbn_appointment_booked

    c) Event Parameters:

    • Click "Add Row" and fill in:

Parameter Name

Value (select from dropdown)

appointment_date

Select: {{DLV - appointment_date}}

appointment_time

Select: {{DLV - appointment_time}}

visit_type_name

Select: {{DLV - visit_type_name}}

provider_name

Select: {{DLV - provider_name}}

location_name

Select: {{DLV - location_name}}

patient_type

Select: {{DLV - patient_type}}

  • To add each row: Click "Add Row", type the Parameter Name on left, click dropdown on right and find the variable

  1. Scroll down to "Triggering"

  2. Click the Triggering box

  3. Select: PBN - Appointment Booked

  4. Click "Save"

Step 4.4: Create GA4 Event Tags for Other Events

Repeat Step 4.3 for the other events:

Tag 2: Widget Opened

  • Name: GA4 Event - PBN Widget Opened

  • Event Name: pbn_booking_widget_opened

  • Parameters: Just add practice_slug{{DLV - practice_slug}}

  • Trigger: PBN - Widget Opened

Tag 3: Patient Info Entered

  • Name: GA4 Event - PBN Patient Info Entered

  • Event Name: pbn_patient_info_entered

  • Parameters: Just add patient_type{{DLV - patient_type}}

  • Trigger: PBN - Patient Info Entered

Step 4.5: Publish Your Changes

  1. Click blue "Submit" button in top right

  2. Version Name: Added PBN events to GA4

  3. Click "Publish"

✅ GA4 tracking is now live!

Step 4.6: Verify in GA4

There are three ways to view your 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. Go to analytics.google.com

  2. In left sidebar, click "Reports"

  3. Click "Realtime"

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

  5. You should see your events listed:

    • pbn_appointment_booked

    • pbn_booking_widget_opened

    • pbn_patient_info_entered

    • etc.

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

  1. Go to analytics.google.com

  2. In left sidebar, click "Reports"

  3. Click "Engagement"

  4. Click "Events"

  5. You'll see a table with all your events:

    • Event name

    • Event count

    • Total users

    • Event value (if configured)

  6. Click on pbn_appointment_booked to see details

  7. You can then:

    • Add dimensions (like visit_type_name, location_name)

    • See event parameters

    • Compare date ranges

    • Export to sheets

Note: ⏱️ Takes 24-48 hours for events to appear here (processing delay)


How to View Event Parameters in GA4

Once you click on an event (in any of the 3 views above):

  1. Look for the "Event parameters" section

  2. You should see all the data we send:

    • appointment_date

    • appointment_time

    • visit_type_name

    • provider_name

    • location_name

    • patient_type

    • etc.

If parameters are missing:

  • Check that you created the Data Layer Variables in GTM (Step 4.1)

  • Check that you added them to your GA4 Event tag (Step 4.3)

  • Republish your GTM container


Creating a Custom Report for Bookings

Want a dashboard just for appointment bookings?

  1. In GA4, go to "Explore" (left sidebar)

  2. Click "Blank" to create new exploration

  3. Under "Dimensions", click the + and add:

    • Event name

    • visit_type_name (custom dimension)

    • location_name (custom dimension)

    • Date

  4. Under "Metrics", click the + and add:

    • Event count

  5. Drag dimensions and metrics to the report

  6. Under "Filters", add:

    • Event name exactly matches pbn_appointment_booked

  7. Name it: "PBN Appointment Bookings"

  8. Click "Save"

Now you have a custom dashboard showing:

  • How many bookings per day

  • Which visit types are most popular

  • Which locations get the most bookings


Setting Up Conversions in GA4

To track pbn_appointment_booked as a conversion:

  1. Go to GA4 → "Admin""Events"

  2. Find pbn_appointment_booked in the list

  3. Toggle "Mark as conversion" to ON

  4. It will now appear in your Conversions report

Now you can:

  • See conversion rate

  • Attribute bookings to marketing channels

  • Optimize campaigns based on which drive bookings


Troubleshooting: Events Not Showing in GA4

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

Still not working? See Troubleshooting section at the bottom.


Part 5: Configure GTM to Send Events to Facebook Pixel

🎯 What This Section Does
This teaches you how to configure Google Tag Manager (in Google's dashboard) to forward our booking events to Facebook Pixel.

Where You'll Work: tagmanager.google.com (GTM dashboard)
What You'll Add: Tags in GTM that call Facebook's API
What You WON'T Touch: PracticeByNumbers code (we already send events automatically)

How It Works

  1. We automatically do this ✅:

    • Push pbn_appointment_booked event to GTM's dataLayer

    • Include data like visit_type_name, appointment_date, etc.

  2. You configure this in GTM ⚙️:

    • Create tags that listen for our events

    • Tags call Facebook's API (fbq() function)

    • GTM forwards our event data to Facebook

  3. Facebook receives 📊:

    • Schedule event (for appointments)

    • Lead event (for form fills)

    • Can now track conversions and build audiences

Prerequisites

  • ✅ You must have a Facebook Business account

  • ✅ You must have created a Facebook Pixel

  • ✅ You need your Pixel ID (a number like 123456789012345)

Don't have these yet? See Appendix B at the bottom.

Step 5.1: Install Facebook Pixel Base Code in GTM

📍 Where: This happens in tagmanager.google.com (NOT in PracticeByNumbers code)

First, install the base Pixel code that tracks all page views.

Follow these steps:

  1. Go to tagmanager.google.com and open your GTM workspace

  2. In GTM left sidebar, click "Tags"

  3. Click "New"

  4. Name it: Facebook Pixel - Base Code

  5. Click "Tag Configuration"

  6. Scroll down to "Custom HTML"

    • It's under "Custom" section at the bottom

  7. In the HTML editor box inside GTM, paste this code:
    ⚠️ Replace YOUR_PIXEL_ID with your actual Facebook Pixel ID

<script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window,document,'script', 'https://connect.facebook.net/en_US/fbevents.js');  fbq('init', 'YOUR_PIXEL_ID'); fbq('track', 'PageView'); </script>
  1. Important: Replace YOUR_PIXEL_ID with your actual Facebook Pixel ID

    • Example: If your Pixel ID is 123456789012345, the line should be:

    • fbq('init', '123456789012345');

    • This code stays in GTM - you're NOT editing PracticeByNumbers code!

  2. Scroll down to "Triggering"

  3. Click the Triggering box

  4. Select "All Pages" (should be at the top)

  5. Click "Save"

Step 5.2: Create Facebook Event for Appointment Booked

📍 Where: Still in tagmanager.google.com (GTM dashboard)
What This Does: When we push pbn_appointment_booked to dataLayer, GTM will call Facebook's API

Now create a tag to fire the "Schedule" event (Facebook's event for appointments).

Follow these steps:

  1. In GTM, click "New" tag

  2. Name it: Facebook Pixel - PBN Schedule Event

  3. Click "Tag Configuration"

  4. Select "Custom HTML"

  5. In the HTML editor box inside GTM, paste this code:

<script> fbq('track', 'Schedule', {   content_name: {{DLV - visit_type_name}},   value: 100,   currency: 'USD' }); </script>

💡 What This Code Does:

  • Calls Facebook's fbq() function (installed in Step 5.1)

  • Sends "Schedule" event to Facebook

  • {{DLV - visit_type_name}} pulls data from GTM variables you created earlier

  • GTM automatically replaces it with the actual visit type name

  1. Optional: Change the value to your average appointment value

    • Example: If cleanings are $150, change 100 to 150

    • Or remove the value and currency lines entirely

  2. Scroll down to "Triggering"

  3. Select trigger: PBN - Appointment Booked

  4. Click "Save"

Step 5.3: Create Facebook Lead Event

📍 Where: Still in GTM dashboard
What This Does: When users fill out the patient form, send "Lead" event to Facebook

Track when users fill out the patient form (great for remarketing).

Follow these steps:

  1. In GTM, click "New" tag

  2. Name it: Facebook Pixel - PBN Lead Event

  3. Click "Tag Configuration"

  4. Select "Custom HTML"

  5. In the HTML editor box inside GTM, paste this code:

<script> fbq('track', 'Lead'); </script>

💡 What This Code Does:

  • Sends "Lead" event to Facebook when user submits patient info

  • Facebook can use this for "Lead" conversion tracking

  • Great for remarketing to people who started booking

  1. Scroll down to "Triggering"

  2. Select trigger: PBN - Patient Info Entered

  3. Click "Save"

Step 5.4: Create Facebook ViewContent Event

📍 Where: Still in GTM dashboard
What This Does: When booking widget opens, send "ViewContent" event to Facebook

Track when users open the booking widget.

Follow these steps:

  1. In GTM, click "New" tag

  2. Name it: Facebook Pixel - PBN ViewContent Event

  3. Click "Tag Configuration"

  4. Select "Custom HTML"

  5. In the HTML editor box inside GTM, paste this code:

<script> fbq('track', 'ViewContent'); </script>

💡 What This Code Does:

  • Sends "ViewContent" event when widget loads

  • Standard Facebook event for page/product views

  • Useful for building remarketing audiences

  1. Scroll down to "Triggering"

  2. Select trigger: PBN - Widget Opened

  3. Click "Save"

Step 5.5: Publish Your Changes

  1. Click blue "Submit" button

  2. Version Name: Added Facebook Pixel for PBN events

  3. Click "Publish"

✅ Facebook Pixel is now live!

Step 5.6: Verify with Facebook Pixel Helper

  1. Install the Facebook Pixel Helper Chrome extension

    • Search Google for "Facebook Pixel Helper Chrome"

    • Install it from Chrome Web Store

  2. Go to your booking widget page

  3. Click the Pixel Helper icon in Chrome toolbar

  4. You should see your Pixel ID and "PageView" event

  5. Do a test booking

  6. After clicking "Book Appointment", you should see:

    • ✓ Schedule event fired

If you see checkmarks, it's working!


✅ Part 5 Summary: What You Just Did

You configured Google Tag Manager (not our code!) to:

  1. Load Facebook Pixel on all pages

  2. Listen for our pbn_appointment_booked event

  3. Call Facebook's API when the event fires

  4. Send appointment data to Facebook

The flow:

Patient books     ↓ We push pbn_appointment_booked to dataLayer     ↓ GTM sees the event     ↓ GTM runs your Custom HTML tags     ↓ Tags call fbq('track', 'Schedule')     ↓ Facebook receives the conversion

All the HTML code lives in GTM - not in PracticeByNumbers code!


Testing Your Setup

Complete Test Checklist

Do a full test booking and verify each platform receives the conversion:

GTM Preview Mode:

  1. In GTM, click "Preview"

  2. Enter your booking widget URL

  3. Complete a test booking

  4. In Tag Assistant, verify:

    • pbn_appointment_booked event appears

    • ☑ Your Google Ads tag fires (green checkmark)

    • ☑ Your GA4 tags fire (green checkmarks)

    • ☑ Your Facebook Pixel tags fire (green checkmarks)

Google Ads:

  1. Go to Google Ads

  2. Click "Tools & Settings""Conversions"

  3. Find your booking conversion action

  4. Click on it

  5. Wait 24-48 hours

  6. You should see conversion counts increase

Google Analytics 4:

  1. Go to GA4

  2. Click "Configure""DebugView"

  3. Do test booking

  4. See pbn_appointment_booked appear in real-time

  5. Click on it to verify parameters are populated

Facebook Pixel:

  1. Open your website with Facebook Pixel Helper extension

  2. Do test booking

  3. Click Pixel Helper icon

  4. Verify "Schedule" event fired


Troubleshooting

Problem: Tag shows "Tag Not Fired" in GTM Preview

Possible Causes:

  1. Trigger event name doesn't match

  2. Container not published

  3. Event hasn't fired yet

Solutions:

  1. Check trigger event name is exactly: pbn_appointment_booked (lowercase, underscores)

  2. Make sure you clicked "Publish" after creating tags

  3. Complete a full booking to trigger the event

Problem: Google Ads conversions not showing

Possible Causes:

  1. Wrong Conversion ID or Label

  2. Takes 24-48 hours to appear

  3. Tag firing before conversion action created

Solutions:

  1. Double-check Conversion ID and Label from Google Ads

  2. Wait 48 hours after first test

  3. Create conversion action in Google Ads first, then set up GTM

Problem: Events not appearing in dataLayer

Possible Causes:

  1. GTM not enabled in PracticeByNumbers

  2. Wrong Container ID

  3. Events not selected

Solutions:

  1. Go to PracticeByNumbers → Widget Section → Make sure toggle is ON

  2. Verify Container ID format: GTM-XXXXXXX

  3. Make sure "Appointment Booked" checkbox is checked

Problem: "Configuration Tag not found" in GA4 Event tag

Cause: You don't have a GA4 Configuration tag in GTM yet.

Solution:

  1. You need to create a GA4 Configuration tag first

  2. This requires your GA4 Measurement ID (format: G-XXXXXXXXXX)

  3. If you're not sure, contact your marketing agency or see GA4 setup docs

Problem: Facebook Pixel shows "No Pixel Found"

Possible Causes:

  1. Base Pixel tag not created

  2. Base Pixel tag has wrong Pixel ID

  3. Container not published

Solutions:

  1. Create the Facebook Pixel Base Code tag (Step 5.1)

  2. Verify your Pixel ID is correct (no quotes, just numbers)

  3. Publish your container changes


Appendix A: Creating a Google Ads Conversion Action

If you don't have a conversion action yet:

  1. Go to Google Ads

  2. Click "Tools & Settings" (wrench icon)

  3. Under "Measurement", click "Conversions"

  4. Click the blue "+" button

  5. Select "Website"

  6. Click "Create a conversion action manually"

  7. Fill out:

    • Category: Select "Submit lead form" or "Purchase"

    • Conversion name: "Appointment Booked"

    • Value: "Use the same value for each conversion" → Enter average appointment value

    • Count: "One" (count each booking once)

    • Click-through window: 30 days

    • Attribution model: "Data-driven" or "Last click"

  8. Click "Done"

  9. You'll see your Conversion ID and Conversion Label - copy these!


Appendix B: Creating a Facebook Pixel

If you don't have a Facebook Pixel yet:

  1. Go to Facebook Business Manager

  2. Click "Business Settings" (gear icon)

  3. Under "Data Sources", click "Pixels"

  4. Click "Add""Create a Pixel"

  5. Name it after your practice (e.g., "Avondale Dental Pixel")

  6. Click "Continue"

  7. Skip the manual installation (GTM will do this)

  8. Copy your Pixel ID (it's a long number like 123456789012345)


Did this answer your question?