How to Connect Facebook Leads to Google Analytics
Tracking the journey from a Facebook ad click to a website conversion is fundamental, but what happens when the conversion occurs directly on Facebook? Sending lead data from your Facebook Lead Ads into Google Analytics bridges a critical gap, allowing you to see which campaigns are not just generating form fills, but are also bringing high-quality users to your website. This guide will walk you through exactly how to set up this connection, from a simple first step to a more robust, professional solution.
Why Bother Connecting Facebook Leads to Google Analytics?
By default, your Facebook Ads data and your Google Analytics data live in separate silos. Facebook Ads Manager is great at telling you how many people filled out your lead form, but it loses visibility the moment that user clicks over to your website. Google Analytics is fantastic at analyzing on-site behavior, but it won’t know that a user who just landed on your site came from a specific lead form submission on Facebook. Connecting the two gives you a much clearer picture of your marketing performance.
Here’s what you gain:
- Full-Funnel Attribution: Finally connect the ad that was clicked to the behavior of the lead once they land on your website. You can finally answer questions like, "Do leads from my 'Ebook Download' campaign spend more time on my site than leads from my 'Contact Us' campaign?"
- Deeper Understanding of Lead Quality: A lead is more than just an email address. By tracking their on-site behavior in GA4, you can see if leads from certain campaigns are more engaged. Do they visit your pricing page, browse multiple blog posts, or sign up for a webinar? This context helps you identify your best-performing campaigns and scale them with confidence.
- Smarter Retargeting: When Google Analytics knows which users came from a specific Facebook lead campaign, you can build powerful retargeting audiences. For example, you could create an audience of users who submitted a lead form for a specific service and then build a targeted Google Ads campaign showing them testimonials for that service.
- Centralized Reporting: Stop jumping back and forth between Facebook Ads Manager and Google Analytics trying to piece together the story. Sending Facebook lead events to GA4 helps you consolidate your conversion data in one primary location, simplifying your reporting workflow.
The Problem: Closing the Gap Between Facebook and Your Website
The core challenge is straightforward: a user sees your ad, clicks, and fills out the lead form. This entire interaction happens within the Facebook ecosystem. After they submit the form, Facebook shows them a "Thanks!" screen, which often includes a button to visit your website.
When they click that button and land on your thank-you page, Google Analytics sees them simply as traffic from an l.facebook.com or m.facebook.com referrer. It has no built-in knowledge that this specific user just completed a lead form for "Campaign X." Our task is to pass that context from Facebook over to Google Analytics, building a bridge between the two platforms.
Method 1: Add UTM Parameters in your Facebook Instant Form
This is the quickest and easiest way to start sending some basic information from your Facebook Lead Ads to Google Analytics. It involves adding special tracking codes, called UTM parameters, to the website link in your lead form’s completion message.
UTM parameters are tags you add to a URL. When a user clicks that URL, the tags are sent to your Google Analytics property, giving you more detail about where the visitors came from.
Step-by-Step Guide
1. Build the UTM-Tagged URL
A UTM tagged URL is just your website link with some parameters added to the end. The main ones are:
utm_source: The platform that sent the traffic (e.g.,facebook).utm_medium: The marketing medium (e.g.,cpc,paidsocial).utm_campaign: The name of your specific campaign.utm_content: Often used to differentiate ads within the same campaign.
Instead of manually typing the campaign and ad names for every ad you create, you can use Facebook’s dynamic parameters. This way, Facebook will automatically insert the correct name for you.
Here’s an example URL structure:
https://www.yourwebsite.com/thank-you?utm_source=facebook&utm_medium=paidsocial&utm_campaign={{campaign.name}}&utm_content={{ad.name}}When a user clicks this link, Facebook will replace {{campaign.name}} and {{ad.name}} with the actual campaign and ad names from your setup.
2. Add the URL to Your Facebook Instant Form
In Facebook Ads Manager, navigate to the ad level where you created your Lead Ad.
- Find the Instant Form section and edit your chosen form.
- Go to the Message for Leads section at the end of the form flow (sometimes called the "Completion" screen).
- For the "Call-To-Action Button," paste your complete UTM-tagged URL into the Link field.
- Save and publish your changes.
3. Find the Data in Google Analytics 4
After your campaign has generated some leads and clicks to your website, you can find the data in GA4:
- Navigate to Reports > Acquisition > Traffic acquisition.
- The main table will show data grouped by "Session default channel group." Change the primary dimension to Session campaign to see a list of your campaign names.
- You can also click the small "+" icon next to the primary dimension to add a secondary dimension like Session creative format or Session manual ad content (this corresponds to
utm_content).
Limitation of this method: This method is a great start, but it has one big flaw. It only tracks users who explicitly click the button on the post-submission screen. It tells you how much traffic that button generates, but it does not send the actual "lead generated" event itself to Google Analytics. For that, you need a more advanced approach.
Method 2: Use an Automation Tool and GA4 Measurement Protocol
This method offers a true, accurate integration by sending a "lead" event directly from an automation tool (like Zapier or Make.com) to Google Analytics 4 whenever a new lead is submitted on Facebook. This happens on the back-end and doesn’t rely on the user clicking anything.
The workflow looks like this:
- A user submits your lead form on Facebook.
- The form submission triggers Zapier.
- Zapier takes the information from the form submission.
- Zapier sends a correctly formatted event called
generate_leaddirectly to your Google Analytics 4 property using the Measurement Protocol.
Let's walk through setting this up with Zapier.
Step-by-Step Guide
1. Get your GA4 Measurement Protocol API Secret
First, you need to generate a key in GA4 to securely receive data from tools like Zapier.
- In Google Analytics, go to Admin (the gear icon on the bottom left).
- In the Property column, click on Data Streams and select your website’s data stream.
- Scroll down and click on Measurement Protocol API secrets.
- Click Create, give your new secret a name (e.g., "Facebook Lead Form Zap"), and copy the generated Secret value. You’ll also need your Measurement ID, which starts with "G-" and is visible on the Data Stream details page.
2. Set Up the Trigger in Zapier
- In your Zapier account, create a new Zap.
- For the Trigger, search for and select Facebook Lead Ads.
- For the Event, choose New Lead and click Continue.
- Connect your Facebook account, then select the Page where your ads are running and the specific lead form you want to track.
- Follow the prompts to test the trigger. Zapier will attempt to pull in a recent lead as sample data. It's crucial that this test is successful before moving on.
3. Set Up the Action in Zapier
- For the Action step, search for and select Google Analytics 4.
- For the Event, choose Send Event and click Continue.
- Connect your Google Analytics 4 account if you haven't already.
- Now it's time to map the data from your Facebook Lead to the GA4 event. This is the most important part:
- Measurement ID: Paste the "G-" code you noted down from your GA4 Data Stream earlier.
- API Secret: Paste the API secret value you created in the first step.
- Client ID: This field helps GA4 associate this backend event with a user’s browser session. For simplicity, this example leaves it blank. GA4 can still record the event, but it might not stitch it perfectly back to the user’s original traffic source.
- Event Name: Use
generate_lead. All lowercase with underscores.
- Event Parameters: Pass valuable details from your Facebook lead to GA4. Add them under Parameters:
- Parameter Name:
campaign_name| Parameter Value: Map this to the Campaign Name from the Zapier trigger. - Parameter Name:
ad_name| Parameter Value: Map this to the Ad Name from the Zapier trigger. - Parameter Name:
source| Parameter Value:facebook. - Parameter Name:
medium| Parameter Value:paidsocial.
- Test your action. Zapier will send a test event to GA4.
5. Check DebugView in GA4 and Turn on Your Zap
Here's how to make sure the test came through correctly. In Google Analytics, while you run the test, go to Admin > DebugView. Within a minute, you should see your generate_lead event appear with all the parameters you configured. If it looks good, go back to Zapier and publish your Zap!
How to Use Your New Data in GA4 Explorations
Once you start collecting events, the real value lies in building custom reports to analyze performance. GA4's Explore section is perfect for this.
- In GA4, go to the Explore tab and start a new "Free form" exploration.
- In the Variables column (on the left), you need to import the dimensions you want to use.
- In a new tab of your exploration, drag your custom dimensions (e.g.,
campaign_name) from the Variables column over to the "Rows" area in the Tab settings. - Drag "Event Count" from the Variables column over to the "Values" area in Tab Settings.
- In the filter tab, add "Event name" matches "generate_lead".
You now have a custom, dynamic report that shows a count of all the leads you generated, broken down by their original Facebook campaign!
Final Thoughts
Connecting your Facebook Lead Ads to Google Analytics transforms your reporting from fragmented guesswork into a cohesive story. The UTM method provides a useful, if incomplete, first glimpse, but using an automation tool like Zapier to send an event gives you a reliable and accurate source of truth for measuring lead generation right inside GA4.
Of course, this is just the first step in unlocking insights. We built Graphed to remove the next layer of complexity. Once we're connected to your Google Analytics and Facebook Ads accounts, you can skip building reports in GA4 Explore and simply ask questions in plain English like, "show me how many leads I got from Facebook advertisers in the last 30 days" or "what are my top-performing Facebook campaigns by leads this month?" We deliver the answers, charts, and dashboards instantly, turning your newly connected data into actionable insights without the headache.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.