How to Track Facebook Ads in Google Analytics 4 (+ Attribute Sales Revenue)

Katie Holmes
28th February 2023

Track Facebook ads more effectively in Google Analytics 4 and attribute sales revenue to your campaigns, both online and offline.

Important Note: Google Analytics sunset Universal Analytics in July 2023 and replaced it with GA4 tracking. For this article, we focus mostly on GA4 to ensure you have the most up-to-date information.

Facebook is one of the most popular social networks worldwide, with roughly 2.85 billion monthly active users.

With that figure in mind, it’s no surprise that marketers are leveraging the opportunities of Facebook advertising to increase exposure and drive qualified leads.

As any marketer will tell you, it’s important to understand how your Facebook ads are impacting and influencing your customer acquisition and marketing ROI.

By following this guide, you will learn how to track the performance of your Facebook ads and will become better equipped to attribute your sales revenue back to your most valuable campaigns.

For this article, we’ll discuss:

💡 Pro Tip

Marketers have struggled to match data in Google Analytics and Facebook long before the iOS 14.5 update. Ruler acts as a bridge between Facebook and Analytics. It allows you to capture all interactions throughout a customer journey and provides a single source of truth about which ads, campaigns and landing are generating the most value.

Book a demo to learn more


Why track your Facebook ads in Google Analytics?

Tracking your Facebook campaigns in Google Analytics is essential as it shows you how users are interacting with your website and provides a bigger picture of your customer journeys.

While you can get some basic information from Facebook about your website, it’s nowhere near as extensive as Google Analytics.

Facebook Ad Manager does a great job at telling you how many people saw and clicked on your ad but loses complete visibility of those individuals once they navigate away from the platform.

With Google Analytics, however, you can gather valuable demographic data from your Facebook ad campaigns and track customer behaviour, device functionality and more once a user lands on your site.

Also, with the latest iOS 14 update and the recent changes to the attribution settings, advertisers can now expect to see up to a 40% reduction of reported conversions in Facebook Ads Manager.

Thankfully, Google Analytics can deliver a lot of information on conversions, clicks and sessions to help improve the performance of your campaigns.

💡 Pro Tip

Are you struggling with the discrepancies in your Facebook and Google Analytics data? Our guide walks you through the most common data discrepancies and explains why they occur. You’ll learn how to identify and fix these issues to make informed decisions about your campaigns.

[DOWNLOAD] Solving the data mismatch between Google and Facebook


What to do before you track Facebook ads in Google Analytics 4?

Now that we have established the need for using Google Analytics to track Facebook ads, let’s get started with the setup. To track and analyse Facebook ad performance in Google Analytics, you first need to complete the following steps.

💡 Pro Tip

For this guide, we’ll assume that you’ve already migrated over to your Google Analytics 4 account. If you haven’t, don’t worry. We have a complete guide on how to get started with Google Analytics 4.


1. Use URL campaign builder to get started

The first step to tracking your Facebook activity in Google Analytics is to generate a URL parameter for your ads.

Related: How to track links with Google Analytics

URL parameters provide more context and are the most useful method to measure and track your Facebook performance. The best way to build your URL parameter is with Google Campaign URL builder.

Google’s Campaign Builder has various fields that you can use to track key information: 

Once you fill out these fields, a campaign URL is generated. You can use this newly-generated URL to track Facebook traffic and conversions in Google Analytics.

But what should your UTM look like? Let’s go through it together.


2. Define your source, medium and campaign variables

Now that you’re up to speed with Google URL Campaign Builder, it’s time to create your trackable link. 

In all honesty, to track Facebook Ads in Google Analytics, all you need is: 

This is usually enough to track where your traffic and conversion events are coming from in Google Analytics. 

But, if you dive deeper into your ad performance, by all means, include “campaign term” and “campaign content”.

We recommend using campaign term to specify your ad sets and campaign content to differentiate your ad types.   

For now, we’re just going to focus on the mandatory fields in the URL Campaign Builder. 

In this example, we’re going to set up an ad for our marketing attribution product. 

First, we set up the URL. As we want people to book a demo, we’re going to copy and paste the URL to our marketing attribution product page. That way, users can click to learn more about the benefits of our solution before signing up for a demo. 

Next, we add “facebook” to the campaign source. At this point, it’s worth mentioning that UTM parameters are case-sensitive. 

So, you should always be consistent when tagging your links. We recommend using lowercase to ensure all your data is captured in Google Analytics correctly.

Once we’ve included the campaign source, we move onto campaign medium. Use “paid” for your social ads as Google Analytics defines “paid search” as cpc. If you were to use cpc for social paid, your traffic and conversions would be attributed to your paid search channels.

Last up we have campaign name. The campaign name should be the same as the name of your Facebook Ad campaign to avoid any confusion. 

Once these fields are filled, this is what our trackable link should look like: 

And the next step is to add it to your Facebook ad.


3. Add a trackable link to your Facebook ad

There are two ways you can add trackable links to your Facebook ads. 

1. The most common option is to copy and paste your whole URL in the “Website URL field”.

2. The other option is to include your link in your ad copy. You can convert your URL into a short link using a tool like Bitly.

Once you’ve shortened your link, it should look something like this:


How to track Facebook Ads in Google Analytics 4

Your Facebook traffic will get pulled in automatically by Google Analytics 4 as long as you’ve set up your UTM codes correctly.

To check, go to Reporting > Acquisition > Traffic Acquisition.

From the drop-down, change the channel group to view things like: 

You can also use custom templates in Exploration to gain deeper insights into your Facebook Ad performance, such as: 


How to track Facebook Ads in Universal Analytics

If you haven’t managed to migrate over to Google Analytics 4, don’t panic. Universal Analytics isn’t completely gone just yet. 

You have until July 2023 to make the most of UA and its reporting abilities. In fact, 30% of marketers aren’t planning to migrate until July 2023. 

We do advise you to move over at the earliest opportunity. Google Analytics 4 is coming whether we want it or not. You’re best off getting a jump on it now than risk being left behind. 

Here’s how to track Facebook Ads in Universal Analytics. 
Go to Acquisition Report > All Traffic > Source/Medium.

how to track facebook ads - step 4.i - www.ruleranalytics.com

If you’ve set up your UTMs correctly, then you should see that Google Analytics has attributed traffic and conversions to your Facebook channel and medium that you used when you set up your UTM parameter.

To drill down into your campaign and content performance, click on “Other” and select the parameter you want to analyse in the Acquisition report.

how to track facebook ads - step 4.ii - www.ruleranalytics.com

💡 Pro Tip

Follow Katie on LinkedIn for tips and tactics on attribution, analytics and all things digital marketing. Don’t forget to say hi. 👋


Why is it so hard to track Facebook ads?

Tracking your Facebook ads isn’t easy, especially if you have several other channels working together to drive new business. There are plenty of challenges you’ll face when attempting to measure the effectiveness of your Facebook ads, and some of these include. 

1. Inability to track individual users

Tracking conversions and traffic for Facebook is just the first step. Turning those clicks and leads into deals and revenue is what matters most.

If you sell products online, tools like Google Analytics can easily track your marketing revenue and ROAS. A little bit of code in your shopping system can help you to understand which of your Facebook Ads are driving the most sales.

Related: How to track ROAS in Google Analytics

For lead generation companies, the process is a little trickier. 

Google Analytics 4 can’t track the identity of individual visitors. 

The data is anonymised. Google Analytics uses first-party cookies to capture data on your website users and assigns them a unique anonymous id. 

Related: How to track individual users in Google Analytics

Anonymised data in Google Analytics makes it hard for marketers to track their customer journeys.

If you can’t see where visitors are converting into leads, you can’t effectively attribute revenue back to your Facebook campaigns and accurately measure your impact on pipeline generation

The link between your Facebook Ad campaigns and revenue is effectively broken. 

All you have to measure your Facebook campaigns is clicks and conversions. But as any reputable marketer will tell you, clicks and conversions don’t guarantee revenue.

2. The long-standing struggle with data walled gardens

Tools like Facebook operate a data-walled garden by controlling access to user data and limiting third-party access to its advertising platform. 

Briefly, a “walled garden” refers to a closed ecosystem where data is controlled and kept within a single platform rather than being easily shared with other platforms. 

Think of it like a walled garden in a physical sense. 

In a walled garden, there are walls surrounding the garden that protect it from outside influences. Only people who are allowed into the garden can enjoy the flowers and plants inside. 

Similarly, in a digital walled garden, data is protected and kept within the platform, and users can only access the data that the platform allows them to see.

Data-walled gardens make it hard to track ad performance for a couple of reasons: 

With Google’s announcement that it will phase out third-party cookies by 2024, you can expect data-walled gardens to get even higher.

3. The aftermath of iOS 14.5 and ATT

We couldn’t write about tracking Facebook ads and not mention the release of Apple’s iOS 14.5.

Related: iOS 14.5 update: How to best prepare as a paid marketer

In 2021, Apple rolled out iOS 14.5 and a new feature called App Tracking Transparency (ATT) that requires apps to ask users for permission before tracking their activity across other apps and websites.

And this update completely altered the dynamics of digital marketing and mobile advertising forever.

The ATT feature requires apps to display a prompt asking users if they want to allow the app to track their activity across other apps and websites. 

If the user declines to allow tracking, the app can’t access the device’s Identifier for Advertisers (IDFA), a unique identifier used to track user behaviour across different apps and websites.

Facebook uses the IDFA to track user behaviour and attribute conversions to specific ads. 

Without access to the IDFA, Facebook can’t track user behaviour across other apps and websites and cannot provide advertisers with accurate information about ad performance.

It’s believed that the ATT opt-in rate by iOS users worldwide is around 46%. That means advertisers are missing data on nearly half of Apple users.

This update has ultimately led to a decrease in the number of conversions attributed to Facebook ads, making it more difficult for advertisers to accurately measure the effectiveness of their campaigns. 


How to track your Facebook ad performance 

With the issues with data-walled gardens and the introduction of iOS 14.5, tracking Facebook ads has become more challenging. 

Does that mean we should give up on measuring our ad effectiveness? 

Absolutely not. 

Instead, we need to find new ways to get around the barriers to prove the value of our ads and ROI.

Here’s how we’re doing it: 

Capture qualitative research

First up on our list is qualitative research. 

In marketing, this process is often referred to as self-reported attribution.

This method relies on prospects and customers voluntarily reporting how they learned about your product or service. 

Most marketers capture qualitative research by: 

Self-reported attribution can be useful for small businesses that don’t have the resources to implement more advanced tracking methods. 

It provides a simple way to track where your customers are coming from and understand which marketing channels drive the most revenue.

While self-reported attribution offers visibility over referrals, word of mouth, and social sources, it’s not perfect. 

It’s important to keep in mind that self-reported data may not always be accurate or complete.

First, customers may not always remember or accurately report how they learned about a brand, particularly if they were exposed to multiple marketing channels. 

Second, the data from self-reported attribution is often too vague. We did a study on it. We found that 56% of the answers from self-reported attribution were either low value or useless. 

Overall, self-reported attribution is a good starting point, but eventually, you’ll need to explore more sophisticated tracking methods to gain a deeper understanding of your advertising performance, such as…

First party attribution tracking

Using a first-party attribution tool, you can overcome the walled gardens and better understand the role your ad campaigns play in the overall customer journey.

Take Ruler Analytics, for example. 

Ruler is a marketing attribution and analytics tool for B2B marketers looking to understand how their marketing impacts pipeline generation and drives revenue.

It tracks your website visitors (including those from Facebook) over multiple sessions and touchpoints. Whenever a visitor converts into a lead, Ruler will connect the dots to create a customer journey. 

Related: How to view full customer journeys with Ruler

Ruler does this by capturing the FBCLID and GCLID using first-party cookies.


“Since the iOS changes, we’ve been relying on the data we get from Ruler way more. Lately, we aren’t getting the right data from Facebook ads portal, so I’m starting to use Ruler to make sure I’m not turning off ads that are actually working (an actual thing that’s happening). For businesses with high value/low quantity leads, this is so key,” Kurt Dunphy, Growth Manager at Rally.



Ruler automatically sends the data you’ve captured on your Facebook leads to your CRM and other marketing tools. This lets everyone in your business track where your leads came from and determine which Facebook campaigns and ads are most valuable to your business.

As leads move from one stage to another, Ruler will keep a record of any changes in its dashboard. With this data, you can spot any bottlenecks in advance and optimise your Facebook campaigns for optimum results. 

When a lead is marked as closed as won, the revenue data is sent back to Ruler, allowing you to determine whether or not your ads are profitable and make changes as required to increase your returns.

Ruler also has a direct integration with Facebook. 

Related: How Ruler enriches your attribution reports in Google Analytics

This means you can send MQLs, opportunities, and/or closed revenue back to Facebook as conversions for reporting and algorithmic optimisation purposes.

You can use the data from Ruler to create targeted audiences and build more effective advertising campaigns to generate a higher conversion rate and ROI.

Invest in marketing mix modeling

Attribution can offer valuable insights into what’s working and what isn’t, but it does have a few blind spots: 

To fill in these gaps, we use marketing mix modeling. 

Let’s look at Ruler’s MMM, for example. 

Ruler’s marketing mix modeling (MMM) uses statistical analytics to help businesses analyse the impact of different marketing inputs or variables on their sales or other KPIs.

It collects data from various sources, including sales data, marketing spend data, and other external factors that may impact sales, such as economic indicators.

Ruler then applies advanced statistical techniques, such as regression analysis, to the data it’s collected to identify the relationship between the marketing inputs and revenue.

This allows businesses to gain a data-driven understanding of how different marketing inputs impact their business outcomes, and use that knowledge to optimise their marketing strategies for better performance.

Marketing mix modelling is becoming increasingly important for a few reasons:


Start tracking your Facebook ads the right way 

Tracking Facebook ads can be a tough gig due to the platform’s data limitations and changes in its ad tracking policies.

But by using a combination of attribution and marketing mix modelling, businesses can gain valuable insights into the performance of their Facebook ads and optimise their marketing for maximum results.

With a tool like Ruler, you can’t go wrong. Ruler is a marketing attribution and MMM tool. So you can get the data you need to measure your Facebook ads from one single platform. 

Learn more on how Ruler attributes revenue to your marketing or book a demo and see it in action for yourself.

This was originally published on the September 30th 2020 and updated February 28th 2023 for freshness.