How to Track Facebook Ads in Google Analytics 4: An Overview

GA4 Tracking Facebook Ads

icon Get in-depth insights

Navigating Data-Driven Marketing From Insights to Impact

icon Get in-depth insights

Navigating Data-Driven Marketing From Insights to Impact

Let's imagine you have a website connected to a Google Analytics 4 [GA4] account, and you run Facebook ad campaigns. People are clicking on your ads, visiting your website, and purchasing… or leaving. But how can you get more information about visitors, their Facebook ads and website activities? A common way is to gather data on social traffic and customer behavior in your Facebook ads account and Google Analytics 4.

Here are some reasons why you might be asking yourself about analytics right now:

  1. Facebook's data may not provide insights, as it focuses on events preceding ad clicks, and its reliability might be questionable.
  2. Google Analytics 4 offers valuable insights into post-ad click activities and provides visibility into website visitors originating from social media platforms.
  3. Google Analytics 4 shows all of your advertising channels so you can analyze and compare them.

This is why Google Analytics 4 is the most popular platform for tracking Facebook advertising campaigns in 2024. In the future of this article, we'll tell you about a way to integrate these two systems into one digital analytics instrument.

Importance of Tracking Facebook Ads in Google Analytics 4

Tracking Facebook ads in Google Analytics 4 is a good idea if statistics from different sources aren't aligned — for example, if you've found problematic data in Ads Manager and Google Analytics 4 that doesn't match.

Discrepancies between data in Ads Manager and Google Analytics 4 stem from different tracking approaches and other technical factors. Smartly combining data and insights from all analytical instruments is the only way to get data on what users do both before and after clicking on ads.

In addition, tracking Facebook advertising campaigns in Google Analytics 4 is crucial for investigating total marketing expenses and calculating return on ad spend (ROAS). You might suppose that you can improve your performance with social media advertising, but have no data to rely on in your estimates.

If you want to analyze reach, views, clicks, separate promotion cost, and events cost, then tools like Facebook Ads and Facebook Pixel will be enough. However, the Facebook → Google Analytics link will significantly expand your analysis options: views, clicks, ad costs, conversions, customer behavior tracking, comparative analysis with other marketing channels, audience insights, geo, device, landing page reports, etc.

Measure CPO and ROAS in GA4

Automatically link your Ad Platforms cost data to Google Analytics 4 conversion data, so you can analyze your marketing KPIs and make fully informed decisions

Start Free Trial
Measure CPO and ROAS in GA4

How Should You Prepare for Tracking Facebook Ads in Google Analytics 4?

To start tracking campaigns on Facebook in Google Analytics 4, you have to ensure that your website has a GA4 or GTM tracking code on each page you want to track. Also, you need to have administrator permissions to access your site and conduct all required Google Analytics 4 activities.

Keep in mind that with GA4, you'll be able to easily track only your campaigns, pages, and personal account activities in tight connection with your website. For instance, you won't be able to say for sure what people do before clicking the link to your site. But you can add a Facebook Pixel to easily track the cost of events on the Facebook side.

In addition, you can set goals and conversions in GA4. Keep in mind that both of these systems must have the same settings for importing data and uniting it in one database.

Also, you need to prepare an advertising campaign on Facebook and set it up especially for GA4:

  1. Collect all URLs and links you'll use in your campaign.
  2. Complete them with UTM parameters to mark them in a special way.
  3. Insert those URLs into your campaigns.

UTM tags are the key to working with different types of campaigns on a platform or Facebook. If you create your UTM tags correctly, the data will be marked properly, and you'll get the reports you want.

Collect All URLs and Links You'll Use in Your Campaign

Use a spreadsheet (Google Sheets, Excel, LibreOffice Calc, etc.) to start. Place all the URLs you need in one column and ensure that they lead to your site pages with Google Analytics 4 installed. You can also include things other than URLs that you need to track for the advertising campaign.

Add a Visit the Website button or the URLs of your main webpage to the informational block of your business page. All of these URLs will serve as entrance points from Facebook to your website, where Google Analytics 4 will collect traffic data.

Here's an example of a table you should create:

Set Up UTM tags

What are UTM tags? You see these in the long tail of URL text when clicking on ads and proceeding to another page. So what kind of marketing information can be included in URLs with UTM tags?

Source: Identifies the traffic source, such as a website, social media traffic, or advertising system. 

Exampleutm_source=facebook

Medium: Identifies the type of marketing medium, such as email or cpc

Exampleutm_medium=cpc

Campaign: Identifies the specific advertising campaign. 

Exampleutm_campaign=kids_toys

UTM ID: A unique identifier for a campaign (Campaign ID) that is required for GA4 data import

Example:utm_id=facebook_123abc

Important! If you are planning to import non-Google advertising cost data to Google Analytics 4, you need to add the utm_id (campaign identifier) parameter to the links in your ads.

There are also optional UTM parameters that can be added to links as desired:

Term: Identifies keywords for paid keyword campaigns. 

Example:utm_term=running+shoes

Content: Differentiates between links or ads that point to the same URL from the same source, medium, and campaign.

Example:utm_content=banner

That's enough to track even the most complicated Facebook campaigns:

  1. The source for a Facebook campaign is typically set as “facebook.”
  2. The medium for a may be “cpc” if it's a paid promo or “social” if it's Facebook organic.
  3. The name of the campaign you should choose for yourself. But keep in mind that URLs are case-sensitive, and you might not remember what “2023promo” means! So pay attention to ad campaigns names.
  4. The terms and content are optional and are used mostly in Google Ads campaigns.

Use a UTM Builder to Get Started

Once you've determined your source, medium, and campaign, it's time to add the UTM tags to your campaign links. You can do this manually by adding the parameters to the end of your URLs, or you can use a UTM builder tool to create the URLs for you.

We recommend using UTM builder by Google or this handy UTM Builder, which we use for ourselves & created keeping all the tiny nuances of GA4 in mind.

Uncover in-depth insights

OWOX UTM Builder

Download now

Bonus for readers

OWOX UTM Builder

To create UTM tags with UTM Builder:

  1. Enter the full URL of the webpage that users will be linked to.
  2. Add the parameters and values that will be used in the UTM tag.

Add the Generated UTM Link to the Facebook Ad Campaign

There are two ways to add generated links to your own campaigns or ads.

1. The most common option is to copy and paste the entire above URL into the website URL field.

Facebook Ads Tracking in Google Analytics 4

After you add UTM tags to your links, you can analyze traffic from Facebook visitors in the following Google Analytics 4 reports:

Acquisition Overview

This report summarizes all your traffic data, which consists of two parts: user acquisition and traffic acquisition. By clicking on the corresponding link, you can open each report separately.

User Acquisition

This report contains data about users who first visited your site. By default, it shows data broken down by channel groups, but you can change the settings to First user source/medium First user campaign to see more detailed statistics.

Traffic Acquisition

The traffic acquisition report will help you understand what brings users to navigate your website (sessions) based on whether they're new or returning users. This is different from the User acquisition report, which focuses on how users discovered your business or website for the first time only.

Explorations

For deeper analysis of your Facebook ad campaigns, you can create custom reports in the Explorations section with any metrics you need.

But without further integration of revenue and cost data, you won't see much regarding the value of your ads results, as you won't be able to see profitability. So let's go a little further to calculate ROAS with the help of cost data importing.

After you have set up cost data importing correctly, a Non-Google cost report with the imported data will appear in the Acquisition section of your Google Analytics 4 report. Data will continue to appear in the report almost immediately after the file has been successfully processed and imported by the system. And you can compare the performance of your track Facebook ads in Google Analytics 4 with other channels!

How to Import Facebook Ads Cost Data to GA4

There are three ways to import cost data from Facebook ads into GA4:

1. Import Facebook Ads Cost Data CSV File into Google Analytics 4

With this method, you have to put data from Facebook ads into a CSV file and upload it manually to Google Analytics 4 every time you need a report. If you have just two or three Facebook ad accounts, and you want to get a report every month, this manual method should work for you. But when it comes to having 10 ad accounts or having more advertising on other traffic channels, or if you want to get a report weekly or daily, it gets complicated and time-consuming.

Dive deeper with this read

How to Import Non-Google Advertising Costs to GA4 for Better ROAS

Image for article: How to Import Non-Google Advertising Costs to GA4 for Better ROAS

2. Import Facebook Ads Cost Data CSV File with the GA4 SFTP Method

This method can be called semi-automatic. Yes, Google Analytics 4 will automatically retrieve data from your SFTP server at the frequency you specify. However, you will still have to prepare a CSV file with Facebook ad cost and revenue data for uploading, periodically update it, and upload it to the SFTP server yourself, either manually or using an ETL/ELT tool such as OWOX BI Pipeline

There are a few reasons why managing a self-service SFTP server for importing Facebook ad cost data to GA4 may not be your best option:

  1. Technical expertise: Setting up and managing an SFTP server requires a certain level of technical know-how. It involves configuring the server, setting up the necessary security measures, and troubleshooting any issues that may arise.
  2. Time and resource investment: Setting up an SFTP server requires a considerable amount of time and resources. From purchasing the necessary hardware to allocating IT personnel for server management, the process can be time-consuming and expensive.
  3. Total cost of ownership (TCO): Although the initial costs of establishing a self-managed SFTP server on public cloud providers like Google Cloud, AWS, and Azure may seem economical at first glance (potentially less than $50 per month), it's critical to recognize the hidden expenses associated with ongoing maintenance. The true hidden costs lie in the time and effort required by IT personnel to manage, monitor, and troubleshoot your self-managed SFTP server.

Read more about how to import cost data from Facebook ads into GA4 using the SFTP method in our article.

Challenges in Importing Facebook Ads Cost Data to GA4

Both of the methods above require you to regularly prepare a CSV file yourself for uploading. This activity can be tedious and time-consuming, as you need to:

  1. Export your ad data from multiple ad accounts.
  2. Gather all the data in one place, in one document.
  3. Figure out how to clean the data, perform deduplication, and so on. In other words, you need to transform all data into one data structure that fits GA4 requirements.

A few more points on data preparation when creating a CSV file:

  1. You should prepare the data for a period of not more than 90 days.
  2. You should not use keyword- or ad Content-level data.
  3. All costs should be in one currency (the same currency as the GA4 property).
  4. There should be no empty fields.
  5. There shouldn't be any costs from Google services.

The good news is that with OWOX BI, you don't have to do it all. OWOX BI automatically prepares CSV files on a daily basis, and the OWOX team sets up your SFTP server and manages it with the highest level of security and performance.

Dive deeper with this read

Why OWOX BI is the best solution for importing cost data to Google Analytics 4

Image for article: Why OWOX BI is the best solution for importing cost data to Google Analytics 4

3. Automatically Import Cost Data into Google Analytics 4 with OWOX BI

With OWOX BI, you don't need to set up and manage the SFTP server yourself. We'll set up automatic importing and manage the whole process for you, with the highest level of security and performance.

Unique Advantages of OWOX BI:

  1. Unified cost data structure. With OWOX BI, you don't need to worry about cleaning, deduplicating, and formatting your data to match the required format. The service will transform your data into a unified structure required for GA4 importing.
  2. Historical data. Download data for the last two months from each supported ad service and evaluate your past campaigns.
  3. Updates. Within 21 days, OWOX automatically updates data if it has changed in the advertising service.
  4. Accuracy. OWOX BI processes dynamic parameters, checks existing UTM tags in your campaigns, and reports possible errors. OWOX BI can also expand shortened links.
  5. Quality. OWOX BI Data Monitoring checks the quality and compliance of data from Facebook Ads.
  6. Flexible customization for your business needs. OWOX BI is an out-of-the-box solution, but it is also an open and transparent system. This means you can make changes and customize data collection and transformation to meet your specific needs.
  7. Ability to load cost data from Google Sheets. If you cannot find the integration you need among OWOX BI's offerings, that's not a problem. You can easily supplement the data automatically collected by OWOX BI with data imported manually through Google Sheets.
  8. Manage the whole data flow in an analyst-friendly UI. With OWOX BI, you can control data processing and transformation in a convenient web interface with data lineage graphs.

Measure CPO and ROAS in GA4

Automatically link your Ad Platforms cost data to Google Analytics 4 conversion data, so you can analyze your marketing KPIs and make fully informed decisions

Start Free Trial
Measure CPO and ROAS in GA4

How to Measure Facebook Ad Performance Conversion in GA4

After you set up UTM tags and cost importing, you may notice that the number of conversions in Facebook Ads Manager and Google Analytics 4 is different. This is because these services count conversions differently. You can learn more about the reasons in this article.

Therefore, in order to track Facebook ad conversions in Google Analytics 4, we recommend creating conversions in GA4 that reflect your own Facebook ad performance goals.

In order to create a conversion in GA4, you need to initially send an event to the GA4 platform. Subsequently, you can mark the event as a conversion within the interface of the system.


You can learn how to create goals and conversions in GA4 in this guide to Google Analytics 4 conversion tracking and this video on how to configure GA4 goals and conversions.

We hope this article and video has helped you to clarify your needs and understand the possibilities of modern analytics. Good luck!

  1. How do I import advertising cost data from Facebook Ads to Google Analytics 4?There are three ways to import cost data from Facebook into GA4:
    1. How can Google Analytics 4 help me track my Facebook Ads campaigns?You can analyze Facebook advertising in Google Analytics 4 reports and compare its effectiveness with other advertising channels.
    2. How can UTM codes help me track the success of my Facebook ads campaigns?By utilizing UTM codes in your Facebook ads campaigns, you can effectively track and measure the success of your campaigns in terms of traffic, conversions, and other key metrics.

    FAQ

    Expand all Close all
    • How do I import advertising cost data from Facebook Ads to Google Analytics 4?

      There are three ways to import cost data from Facebook into GA4:
      1. Manually import CSV files via the GA4 interface
      2. Import cost data via the GA4 SFTP method
      3. Use the out-of-the-box solution from OWOX BI
    • How can Google Analytics 4 help me track my Facebook Ads campaigns?

      You can analyze Facebook advertising in Google Analytics 4 reports and compare its effectiveness with other advertising channels.
    • How can UTM codes help me track the success of my facebook ads campaigns?

      By utilizing UTM codes in your Facebook ads campaigns, you can effectively track and measure the success of your campaigns in terms of traffic, conversions, and other key metrics.

    icon Get in-depth insights

    Navigating Data-Driven Marketing From Insights to Impact

    icon Get in-depth insights

    Navigating Data-Driven Marketing From Insights to Impact