Table of contents
Overview of Facebook Ads Tracking in Google Analytics 4
Olga Mirgorodskaya, Creative writer @ OWOX
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 their Facebook ads and website activities? A common way is to gather data on 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:
- Facebook can only tell you what happened before an ad was clicked, and this data isn’t as reliable as it should be.
- Google Analytics 4 shows you what happens after an ad is clicked and tells you who’s visiting your website from social media.
- 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 this article, we’ll tell you about a way to integrate these two systems in one digital analytics instrument.
Find out the real value of ad campaigns
Automatically import cost data to Google Analytics 4 from all your advertising services. Compare campaign costs, CPC, and ROAS in a single report and make fully informed decisions.
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 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 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 channels, audience, geo, device, landing page reports, etc.
How should you prepare for tracking Facebook ads in Google Analytics 4?
To start tracking Facebook advertising campaigns 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 conduct all required Google Analytics 4 activities.
Keep in mind that with GA4, you’ll be able to 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 website. But you can add a Facebook Pixel to 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:
- Collect all URLs and links you’ll use in your campaign.
- Complete them with UTM parameters to mark them in a special way.
- Insert those URLs into your campaigns.
UTM tags are the key to working with different types of advertising campaigns on 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 website 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 information can be included in URLs with UTM tags?
Identifies the traffic source, such as a website or advertising system. Example: utm_source=facebook
Identifies the type of marketing medium, such as email or cpc. Example: utm_medium=cpc
Identifies the specific advertising campaign. Example: utm_campaign=kids_toys
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 parameters that can be added to links as desired:
Identifies keywords for paid keyword campaigns. Example: utm_term=running+shoes
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.
- The source for a Facebook campaign is typically set as “facebook.”
- The medium for a Facebook campaign may be “cpc” if it’s a paid promo or “social” if it’s Facebook organic.
- 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.
- 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.
Google Analytics 4 Compatible UTM-builderDownload now
To create UTM tags with UTM Builder:
- Enter the full URL of the webpage that users will be linked to.
- 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 Facebook ads.
1. The most common option is to copy and paste the entire URL into the Website URL field.
2. Another option is to include your link in your ad copy. You can convert your URL into a short link using special tools.
Tracking Facebook ads data in Google Analytics 4
After you add UTM tags to your links, you can analyze traffic from Facebook in the following Google Analytics 4 reports:
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 of these reports separately.
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 or First user campaign to see more detailed statistics.
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 website for the first time only.
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 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 reports. Data will 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 Facebook ads 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 channels, or if you want to get a report weekly or daily, it gets complicated and time-consuming.
Read more about how to manually import costs from Facebook ads into GA4 in our article on importing non-Google advertising cost data.
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 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:
- 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.
- 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.
- 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:
- Export your ad data from multiple ad accounts.
- Gather all the data in one place, in one document.
- 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:
- You should prepare the data for a period of not more than 90 days.
- You should not use keyword- or adContent-level data.
- All costs should be in one currency (the same currency as the GA4 property).
- There should be no empty fields.
- 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.
3. Automatically import cost data into Google Analytics 4 with OWOX BI
With OWOX BI, you don’t need to 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:
- 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.
- Historical data. Download data for the last two months from each supported ad service and evaluate your past campaigns.
- Updates. Within 21 days, OWOX automatically updates data if it has changed in the advertising service.
- Accuracy. OWOX BI processes dynamic parameters, checks existing UTM tags in your campaigns, and reports possible errors. OWOX BI can also expand shortened links.
- Quality. OWOX BI Data Monitoring checks the quality and compliance of data from Facebook Ads.
- 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.
- 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.
- 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.
Use OWOX BI to automatically collect and merge all advertising data in one place. Our platform helps you to avoid constant manual work on making marketing reports.
How to measure Facebook ads 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 Facebook goals.
To create a conversion in GA4, you must first send an event to GA4. You can then simply mark the event as a conversion in the system interface.
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 has helped you to clarify your needs and understand the possibilities of modern analytics. Good luck!
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:
- Manually import CSV files via the GA4 interface
- Import cost data via the GA4 SFTP method
- 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.