Google Tag Manager & Analytics

Track conversions and marketing attribution

Set up Google Tag Manager (GTM) or Google Analytics 4 (GA4) to track your entire booking funnel. The system auto-detects your tracking ID format and loads the appropriate scripts. All personal data is automatically filtered out for GDPR/CCPA compliance — you'll see behavioral data like step completions, not customer names or emails. When the booking form is embedded on your website, booking events are forwarded to your page so your website remains the single source of truth for conversion tracking.

Requirements

  • Google Tag Manager container (GTM-XXXXXXX) OR Google Analytics 4 property (G-XXXXXXXXXX)
  • Admin access to your PestBooker organization
  • For Google Ads conversion tracking: a Google Ads account with a configured conversion action
1

Get Your Tracking ID

  • Option A - Google Tag Manager: Go to tagmanager.google.com, create/open a container, copy your Container ID (GTM-XXXXXXX)
  • Option B - Google Analytics 4: Go to analytics.google.com, create/open a property, copy your Measurement ID (G-XXXXXXXXXX)
  • GTM is recommended for production — it allows adding Facebook Pixel, LinkedIn tags, etc. without code changes
  • GA4 direct is simpler and good for basic tracking or testing
2

Add Tracking ID to PestBooker

  • Go to Dashboard → Settings → Integration
  • Scroll to 'Google Analytics / GTM ID' field
  • Paste your tracking ID (either GTM-XXXXXXX or G-XXXXXXXXXX)
  • Click 'Save Changes'
  • The system auto-detects the format and loads the correct scripts
3

Understand the Events Fired Automatically

  • registration_started — User loads the booking page
  • registration_step_completed — Fires after each booking step (includes step_name and step_number)
  • Step names: address_selection, customer_creation, appointment_scheduling, billing_setup
  • registration_completed — Booking complete (includes planType, frequency, value, transaction_id)
  • magic_link_accessed — User clicks a magic link from email
  • magic_link_success — Data loaded, redirecting to booking
  • magic_link_expired — Link expired
  • magic_link_error — Error loading magic link data
  • abandoned_cart_resumed — User continues booking after magic link
  • When embedded on your website, these same events are also forwarded to your page so your analytics tools can pick them up
4

Set Up GTM Triggers

  • In GTM, create Custom Event triggers for: registration_started, registration_step_completed, registration_completed
  • Create a GA4 Event tag for each trigger to send data to Google Analytics
  • Use the Preview mode to test events before publishing
  • Publish your GTM container when ready
5

Create Conversion Goals in GA4

  • In GA4, go to Configure → Events → Mark as conversion
  • Mark 'registration_completed' as a conversion — this is your sale event
  • Optionally mark step events to track funnel drop-off
  • Use the Funnel Exploration report to visualize the booking journey
  • Set up audiences based on step completion for remarketing
6

Set Up Google Ads Conversion Tracking (Optional)

  • In Google Ads, go to Tools → Conversions → New conversion action
  • Choose 'Website' as the conversion source
  • Name it something like 'Pest Control Booking' and set the category to 'Purchase'
  • Set the value to 'Use different values for each conversion' — the booking form sends the actual service price
  • Copy the Conversion ID and Conversion Label for use in GTM
  • In GTM, create a new tag: Google Ads Conversion Tracking
  • Enter your Conversion ID and Conversion Label
  • Create a Data Layer Variable named "value" to pull the service price from the event
  • Set the tag trigger to your registration_completed Custom Event trigger
  • Set Currency Code to USD
  • Google Ads will use this value for ROAS (Return on Ad Spend) optimization
7

Verify Your Setup

  • Open your booking page in a browser
  • Open DevTools (F12) → Console tab
  • Look for '[Analytics] GTM initialized' or '[Analytics] GA4 initialized' message
  • Complete a test booking and watch for '[Analytics] Event pushed:' messages at each step
  • In GTM, use Preview mode to see events in real-time
  • In GA4, use DebugView (Configure → DebugView) to see events as they fire
  • For Google Ads conversions, verify the conversion tag fired in GTM Preview with the correct value
  • Google Ads conversions appear within 24 hours (test conversions may take 3 hours)

Pro Tips

  • Personal data is automatically filtered — names, emails, addresses, phone numbers are NEVER sent to analytics
  • UTM parameters and ad click IDs (gclid, fbclid, msclkid) are automatically captured and stored with the lead
  • The 'value' field in registration_completed contains the initial service charge — use this for revenue tracking and ROAS bidding
  • The 'transaction_id' field in registration_completed is the unique order ID — map it to your GA4 purchase event / Google Ads conversion so refreshes and back-button revisits don't double-count the same sale
  • If you configure both GTM and GA4 IDs, GTM takes priority
  • Use step_number in your funnel reports to see exactly where customers drop off
  • Track magic link recovery funnel: magic_link_accessed → magic_link_success → abandoned_cart_resumed → registration_completed
  • When embedded on your website, conversion tracking runs through your website's own analytics to prevent double-counted conversions
  • Your analytics must be installed on the same page as the embedded booking form for embedded conversion tracking to work
  • If you're running Facebook Ads too, add a Facebook Pixel tag in GTM triggered by registration_completed

Need help with setup?

Email us and we'll walk you through any integration or setup process.

Contact Sales