Skip to main content

Facebook Pixel Tracking for Online Booking (Optional)

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 to Facebook (Meta) Pixel.

This allows you to:

  • Track appointment bookings as Facebook conversions

  • Track form fills as leads

  • Build remarketing audiences from booking activity


Where This Happens

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

  • What you’ll add: Facebook Pixel tags (Custom HTML)

  • What you won’t touch: Practice by Numbers code

    All tracking code lives in GTM, not in PbN


How It Works

What Practice by Numbers Does Automatically ✅

  • Sends booking events to GTM’s dataLayer

  • Events include:

    • pbn_appointment_booked

    • pbn_patient_info_entered

    • pbn_booking_widget_opened

  • Includes helpful data like visit type and appointment date


What You Configure in GTM ⚙️

  • Add the Facebook Pixel base code

  • Create tags that:

    • Listen for PbN events

    • Call Facebook’s fbq() function

  • GTM sends those events to Facebook


What Facebook Receives 📊

  • Schedule event → Appointment booked

  • Lead event → Patient info submitted

  • ViewContent event → Booking widget opened

Facebook can now:

  • Track conversions

  • Optimize ads

  • Build remarketing audiences


Prerequisites

Before starting, make sure:

✅ You have a Facebook (Meta) Business account
✅ You have created a Facebook Pixel
✅ You have your Pixel ID

  • Looks like: 123456789012345

Don’t have these yet? See Appendix B: Create a Facebook Pixel at the end of this guide.


Install the Facebook Pixel Base Code in GTM

📍 Important: This is done in Google Tag Manager, not in Practice by Numbers.

The base code loads the Facebook Pixel and tracks page views.

Create the Base Pixel Tag

  • Open your GTM container

  • Click TagsNew

  • Name the tag:
    Facebook Pixel – Base Code

  • Click Tag Configuration

  • Select Custom HTML

Paste the Base Code

Paste the code below into the HTML box.

⚠️ 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!

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

Example

Set the Trigger

  • Scroll to Triggering

  • Select All Pages

  • Click Save

✅ Facebook Pixel base code is now installed via GTM.


Track Appointment Bookings (Schedule Event)

This sends Facebook’s Schedule event when an appointment is booked.

Create the Schedule Event Tag

  • Click New (Tags)

  • Name:
    Facebook Pixel – PBN Schedule Event

  • Tag Type: Custom HTML

Paste the Schedule Event Code

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

What This Does

  • Sends a Schedule event to Facebook

  • Includes the visit type name (from GTM variables)

  • Optionally sends a value

💡 Optional: Change 100 to your average appointment value. Or remove value and currency entirely

Set the Trigger

  • Trigger: PBN – Appointment Booked

  • Click Save


Track Form Submissions (Lead Event)

This sends Facebook’s Lead event when a patient submits their information.

Create the Lead Event Tag

  • Click New

  • Name:
    Facebook Pixel – PBN Lead Event

  • Tag Type: Custom HTML

Paste the Lead Code

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

What This Does

  • Sends a Lead event to Facebook

  • Ideal for remarketing users who started booking

Set the Trigger

  • Trigger: PBN – Patient Info Entered

  • Click Save


Track Widget Opens (ViewContent Event)

This tracks when users open the booking widget.

Create the ViewContent Tag

  • Click New

  • Name:
    Facebook Pixel – PBN ViewContent Event

  • Tag Type: Custom HTML

Paste the ViewContent Code

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

Set the Trigger

  • Trigger: PBN – Widget Opened

  • Click Save

Publish Your Changes

  • Click Submit

  • Version Name:

    Added Facebook Pixel for PBN events

  • Click Publish

✅ Facebook Pixel tracking is now live.


Verify Using Facebook Pixel Helper

Install the Facebook Pixel Helper Chrome extension

  • Search Google for "Facebook Pixel Helper Chrome"

  • Install it from the Chrome Web Store

  • Go to your booking widget page

  • Click the Pixel Helper icon in the 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!


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_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

  • 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 a test booking

  • See pbn_appointment_booked appear in real-time

  • Click on it to verify parameters are populated

Facebook Pixel

  1. Open your website with the Facebook Pixel Helper extension

  2. Do a test booking

  3. Click the 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 the first test

  3. Create a 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

Did this answer your question?