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 eventpbn_booking_widget_opened← Funnel startpbn_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 |
| Widget loads | Funnel start, remarketing |
| User picks location | Funnel analysis |
| User picks visit type | Funnel analysis |
| User picks provider | Funnel analysis |
| User picks date/time | Funnel analysis |
| User submits contact form | Lead event |
| Backend saves appointment | Backend confirmation (draft, not booked yet) |
| Payment page loads | Payment funnel tracking |
| User submits credit card | Payment completion tracking |
| Insurance page loads | Insurance funnel tracking |
| User submits insurance | Insurance completion tracking |
| OTP/verification page loads | Verification funnel tracking |
| Final confirmation shown | MAIN CONVERSION |
| 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 |
| Custom Event |
| REQUIRED - Main conversion |
| Custom Event |
| Recommended - Funnel start |
| Custom Event |
| Recommended - Lead event |
| Custom Event |
| Recommended - Backend confirmation |
| Custom Event |
| Optional - Payment funnel |
| Custom Event |
| Optional - Payment completed |
| Custom Event |
| Optional - Insurance funnel |
| Custom Event |
| Optional - Insurance completed |
| Custom Event |
| Optional - Verification step |
| Custom Event |
| Optional - Funnel step |
| Custom Event |
| Optional - Funnel step |
| Custom Event |
| Optional - Funnel step |
| Custom Event |
| Optional - Funnel step |
| Custom Event |
| Optional - Error tracking |
How to Create: Triggers → New → Custom Event → Enter event name exactly as shown
Priority Triggers (Create these first):
PBN - Appointment Booked- Main conversion (REQUIRED)PBN - Draft Appointment Created- Backend confirmationPBN - 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 |
|
| Appointment ID (for tracking after creation) |
|
| Date of appointment (YYYY-MM-DD) |
|
| Time of appointment (HH:MM) |
|
| Visit type ID number |
|
| Visit type name (e.g., "Cleaning") |
|
| Provider ID number |
|
| Provider name (e.g., "Dr. Smith") |
|
| Location ID number |
|
| Location name (e.g., "Downtown Office") |
|
| "new" or "returning" (generic only) |
|
| Payment method (e.g., "credit_card") |
|
| true/false if insurance provided |
|
| Practice identifier |
|
| UTM source parameter |
|
| UTM medium parameter |
|
| UTM campaign parameter |
|
| Error type (for booking_error event) |
|
| 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 appointmentsDLV - appointment_date- When appointment is scheduledDLV - visit_type_name- What type of appointmentDLV - 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 ConversionType: Google Ads Conversion Tracking
Trigger:
PBN - Appointment Booked
For Google Analytics 4:
Tag:
GA4 Event - PBN Appointment BookedType: GA4 Event
Trigger:
PBN - Appointment BookedParameters: Use
{{DLV - ...}}variables
Tag:
GA4 Event - PBN Widget OpenedType: GA4 Event
Trigger:
PBN - Widget Opened
Tag:
GA4 Event - PBN Patient Info EnteredType: GA4 Event
Trigger:
PBN - Patient Info Entered
For Facebook Pixel:
Tag:
Facebook Pixel - Base CodeType: Custom HTML
Trigger: All Pages
Tag:
Facebook Pixel - PBN Schedule EventType: Custom HTML
Trigger:
PBN - Appointment Booked
Tag:
Facebook Pixel - PBN Lead EventType: Custom HTML
Trigger:
PBN - Patient Info Entered
Tag:
Facebook Pixel - PBN ViewContent EventType: 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
Open your web browser
Click the blue "Sign in" button in the top right
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:
You'll see a welcome screen
Click the blue "Create Account" button
Fill out the form:
Account Name: Enter your practice name
Example:
Avondale Dental PracticeThis is just for your reference, patients won't see it
Country: Select your country from the dropdown
Check the box: ☑ "Share data with Google and others anonymously"
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:
Container name: Use your website URL
Example:
avondaledental.comThis helps you identify it if you have multiple websites
Target platform: Click the "Web" option
This is for your practice website
Don't choose Mobile, AMP, or Server
Click "Create"
Step 1.4: Accept the Terms
A popup will appear with Google Tag Manager Terms of Service
Check the box: ☑ "I also accept the Data Processing Terms"
Click "Yes" at the top right
Step 1.5: Get Your Container ID
After accepting terms, you'll see installation instructions:
Look at the code in the first box
Find the text that looks like:
GTM-XXXXXXXThe X's will be letters and numbers
Example:
GTM-ABC1234orGTM-K8HT6WM
Copy this Container ID - you'll need it in Part 2
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
Go to your PracticeByNumbers admin dashboard
Log in with your practice account
Step 2.2: Navigate to Widget Settings
In the left sidebar, click "Online Booking"
Then click "Widget Section" (or "Widget Settings")
Step 2.3: Scroll to GTM Section
Scroll down past all the settings
Look for a section titled: "Google Tag Manager (GTM) Conversion Tracking"
It should be below the "Google Reserve" section
Step 2.4: Enable GTM Tracking
Find the toggle switch labeled "Enable GTM Tracking"
Click it to turn it ON (it should turn blue/green)
Step 2.5: Enter Your Container ID
Look for the input field labeled "GTM Container ID"
Paste the Container ID you copied in Step 1.5
Format:
GTM-XXXXXXXExample:
GTM-ABC1234
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
Click the blue "Save GTM Settings" button at the bottom
Wait for the success message: "GTM settings updated successfully"
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
We automatically do this ✅:
Push
pbn_appointment_bookedevent to GTM's dataLayerInclude data like visit_type, appointment_date, etc.
You configure this in GTM ⚙️:
Create a trigger that listens for
pbn_appointment_bookedCreate a Google Ads Conversion tag
Link the tag to the trigger
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
Go back to the browser tab with Google Tag Manager
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:
In the left sidebar, click "Triggers"
Click the red "New" button in the top right
At the top, click the pencil icon next to "Untitled Trigger"
Name it:
PBN - Appointment BookedClick away to save the name
Click in the large box in the middle (it says "Trigger Configuration")
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
You'll see a form with one field: "Event name"
Type exactly:
pbn_appointment_booked⚠️ Must be all lowercase
⚠️ Use underscores
_, not hyphens-⚠️ Must match exactly including the
pbn_prefix
Leave "This trigger fires on" set to "All Custom Events"
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:
In the left sidebar, click "Tags"
Click the red "New" button in the top right
At the top, click the pencil icon next to "Untitled Tag"
Name it:
Google Ads - Appointment Booked ConversionClick away to save the name
Click in the box labeled "Tag Configuration"
In the popup, scroll to find: "Google Ads Conversion Tracking"
It's under "Google Ads" section with the Google Ads logo
Click it
You'll see a form with several fields. Fill them out:
a) Conversion ID:
This is a number like
123456789orAW-123456789You got this from your Google Ads account
Paste it here
b) Conversion Label:
This looks like a random string:
a1B2c3D4e5F6g7H8You 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:
100for $100Or leave blank to not track value
d) Currency Code (optional):
Only fill if you entered a Conversion Value
Example:
USDorCADLeave 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
Scroll down to the "Triggering" section at the bottom
Click in the box labeled "Triggering"
In the popup, find the trigger you created: "PBN - Appointment Booked"
Click on it
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:
Look at the top right corner of the screen
Click the blue "Submit" button
A popup appears asking for version details:
Version Name: Type
Added PBN appointment booking conversionVersion Description: Type
Tracks PBN bookings as Google Ads conversions(optional)
Click the blue "Publish" button in the top right of the popup
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:
In GTM, click the "Preview" button in the top right
It's next to the Submit button
A popup appears: "Tag Assistant"
In the field "Your website's URL", enter your booking widget URL
Example:
https://avondaledental.com/schedule/
Click "Connect"
A new tab opens with your booking widget
Go through a test booking:
Select location, visit type, provider, time
Fill out patient information
Click "Book Appointment"
Go back to the Tag Assistant tab
Look for the event
pbn_appointment_bookedClick on it
Look for your tag:
Google Ads - Appointment Booked ConversionIt 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
We automatically do this ✅:
Push booking events to GTM's dataLayer
Include data like appointment_date, visit_type_name, etc.
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
GA4 receives 📊:
Custom events like
pbn_appointment_bookedAll 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:
In the left sidebar, click "Variables"
Scroll down to "User-Defined Variables" section
Click the "New" button
Click the pencil icon at the top and name it (see table below)
Click in "Variable Configuration" box
Scroll down and click "Data Layer Variable"
In the "Data Layer Variable Name" field, enter the name from the table
Click "Save"
Create these 10 variables:
Variable Name (in GTM) | Data Layer Variable Name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
Click "Triggers" in left sidebar
Click "New"
Name it:
PBN - Widget OpenedClick "Trigger Configuration"
Select "Custom Event"
Event name:
pbn_booking_widget_openedClick "Save"
Trigger 2: Patient Info Entered
Click "New" again
Name it:
PBN - Patient Info EnteredClick "Trigger Configuration"
Select "Custom Event"
Event name:
pbn_patient_info_enteredClick "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:
Click "Tags" in left sidebar
Click "New"
Name it:
GA4 Event - PBN Appointment BookedClick "Tag Configuration"
Find and click: "Google Analytics: GA4 Event"
It's under "Google Analytics" section
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) |
| Select: |
| Select: |
| Select: |
| Select: |
| Select: |
| Select: |
To add each row: Click "Add Row", type the Parameter Name on left, click dropdown on right and find the variable
Scroll down to "Triggering"
Click the Triggering box
Select:
PBN - Appointment BookedClick "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 OpenedEvent Name:
pbn_booking_widget_openedParameters: Just add
practice_slug→{{DLV - practice_slug}}Trigger:
PBN - Widget Opened
Tag 3: Patient Info Entered
Name:
GA4 Event - PBN Patient Info EnteredEvent Name:
pbn_patient_info_enteredParameters: Just add
patient_type→{{DLV - patient_type}}Trigger:
PBN - Patient Info Entered
Step 4.5: Publish Your Changes
Click blue "Submit" button in top right
Version Name:
Added PBN events to GA4Click "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
Go to your Google Analytics 4 property at analytics.google.com
In the left sidebar, click "Admin" (gear icon at bottom)
Under "Data display", click "DebugView"
Open your booking widget in another tab
Complete a test booking
Back in DebugView, you should see events appear in real-time:
pbn_booking_widget_openedpbn_appointment_bookedetc.
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
Go to analytics.google.com
In left sidebar, click "Reports"
Click "Realtime"
Scroll down to "Event count by Event name" card
You should see your events listed:
pbn_appointment_bookedpbn_booking_widget_openedpbn_patient_info_enteredetc.
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
Go to analytics.google.com
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)
Click on
pbn_appointment_bookedto see detailsYou 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):
Look for the "Event parameters" section
You should see all the data we send:
appointment_dateappointment_timevisit_type_nameprovider_namelocation_namepatient_typeetc.
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?
In GA4, go to "Explore" (left sidebar)
Click "Blank" to create new exploration
Under "Dimensions", click the + and add:
Event namevisit_type_name(custom dimension)location_name(custom dimension)Date
Under "Metrics", click the + and add:
Event count
Drag dimensions and metrics to the report
Under "Filters", add:
Event nameexactly matchespbn_appointment_booked
Name it: "PBN Appointment Bookings"
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:
Go to GA4 → "Admin" → "Events"
Find
pbn_appointment_bookedin the listToggle "Mark as conversion" to ON
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:
✅ Did you create the GA4 Event tags in GTM?
Go to GTM → Tags
Look for
GA4 Event - PBN Appointment Booked
✅ Is your GA4 Configuration tag firing?
Use GTM Preview mode
Check "Tags Fired" section
Should see your GA4 Config tag
✅ Are events firing in GTM?
Use GTM Preview mode
Complete a test booking
Check for
pbn_appointment_bookedin "Messages" tab
✅ Is the GA4 Measurement ID correct?
In GTM, check your GA4 Configuration tag
Measurement ID format:
G-XXXXXXXXXXVerify it matches your GA4 property
✅ 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
We automatically do this ✅:
Push
pbn_appointment_bookedevent to GTM's dataLayerInclude data like visit_type_name, appointment_date, etc.
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
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:
Go to tagmanager.google.com and open your GTM workspace
In GTM left sidebar, click "Tags"
Click "New"
Name it:
Facebook Pixel - Base CodeClick "Tag Configuration"
Scroll down to "Custom HTML"
It's under "Custom" section at the bottom
In the HTML editor box inside GTM, paste this code:
⚠️ ReplaceYOUR_PIXEL_IDwith 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>Important: Replace
YOUR_PIXEL_IDwith your actual Facebook Pixel IDExample: If your Pixel ID is
123456789012345, the line should be:fbq('init', '123456789012345');This code stays in GTM - you're NOT editing PracticeByNumbers code!
Scroll down to "Triggering"
Click the Triggering box
Select "All Pages" (should be at the top)
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:
In GTM, click "New" tag
Name it:
Facebook Pixel - PBN Schedule EventClick "Tag Configuration"
Select "Custom HTML"
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 earlierGTM automatically replaces it with the actual visit type name
Optional: Change the
valueto your average appointment valueExample: If cleanings are $150, change
100to150Or remove the
valueandcurrencylines entirely
Scroll down to "Triggering"
Select trigger:
PBN - Appointment BookedClick "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:
In GTM, click "New" tag
Name it:
Facebook Pixel - PBN Lead EventClick "Tag Configuration"
Select "Custom HTML"
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
Scroll down to "Triggering"
Select trigger:
PBN - Patient Info EnteredClick "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:
In GTM, click "New" tag
Name it:
Facebook Pixel - PBN ViewContent EventClick "Tag Configuration"
Select "Custom HTML"
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
Scroll down to "Triggering"
Select trigger:
PBN - Widget OpenedClick "Save"
Step 5.5: Publish Your Changes
Click blue "Submit" button
Version Name:
Added Facebook Pixel for PBN eventsClick "Publish"
✅ Facebook Pixel is now live!
Step 5.6: Verify with Facebook Pixel Helper
Install the Facebook Pixel Helper Chrome extension
Search Google for "Facebook Pixel Helper Chrome"
Install it from Chrome Web Store
Go to your booking widget page
Click the Pixel Helper icon in Chrome toolbar
You should see your Pixel ID and "PageView" event
Do a test booking
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:
Load Facebook Pixel on all pages
Listen for our
pbn_appointment_bookedeventCall Facebook's API when the event fires
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 conversionAll 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:
In GTM, click "Preview"
Enter your booking widget URL
Complete a test booking
In Tag Assistant, verify:
☑
pbn_appointment_bookedevent appears☑ Your Google Ads tag fires (green checkmark)
☑ Your GA4 tags fire (green checkmarks)
☑ Your Facebook Pixel tags fire (green checkmarks)
Google Ads:
Go to Google Ads
Click "Tools & Settings" → "Conversions"
Find your booking conversion action
Click on it
Wait 24-48 hours
You should see conversion counts increase
Google Analytics 4:
Go to GA4
Click "Configure" → "DebugView"
Do test booking
See
pbn_appointment_bookedappear in real-timeClick on it to verify parameters are populated
Facebook Pixel:
Open your website with Facebook Pixel Helper extension
Do test booking
Click Pixel Helper icon
Verify "Schedule" event fired
Troubleshooting
Problem: Tag shows "Tag Not Fired" in GTM Preview
Possible Causes:
Trigger event name doesn't match
Container not published
Event hasn't fired yet
Solutions:
Check trigger event name is exactly:
pbn_appointment_booked(lowercase, underscores)Make sure you clicked "Publish" after creating tags
Complete a full booking to trigger the event
Problem: Google Ads conversions not showing
Possible Causes:
Wrong Conversion ID or Label
Takes 24-48 hours to appear
Tag firing before conversion action created
Solutions:
Double-check Conversion ID and Label from Google Ads
Wait 48 hours after first test
Create conversion action in Google Ads first, then set up GTM
Problem: Events not appearing in dataLayer
Possible Causes:
GTM not enabled in PracticeByNumbers
Wrong Container ID
Events not selected
Solutions:
Go to PracticeByNumbers → Widget Section → Make sure toggle is ON
Verify Container ID format:
GTM-XXXXXXXMake 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:
You need to create a GA4 Configuration tag first
This requires your GA4 Measurement ID (format:
G-XXXXXXXXXX)If you're not sure, contact your marketing agency or see GA4 setup docs
Problem: Facebook Pixel shows "No Pixel Found"
Possible Causes:
Base Pixel tag not created
Base Pixel tag has wrong Pixel ID
Container not published
Solutions:
Create the Facebook Pixel Base Code tag (Step 5.1)
Verify your Pixel ID is correct (no quotes, just numbers)
Publish your container changes
Appendix A: Creating a Google Ads Conversion Action
If you don't have a conversion action yet:
Go to Google Ads
Click "Tools & Settings" (wrench icon)
Under "Measurement", click "Conversions"
Click the blue "+" button
Select "Website"
Click "Create a conversion action manually"
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"
Click "Done"
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:
Go to Facebook Business Manager
Click "Business Settings" (gear icon)
Under "Data Sources", click "Pixels"
Click "Add" → "Create a Pixel"
Name it after your practice (e.g., "Avondale Dental Pixel")
Click "Continue"
Skip the manual installation (GTM will do this)
Copy your Pixel ID (it's a long number like
123456789012345)
