How to track Facebook advertising campaigns in Google Analytics

Let’s imagine that you have a website connected to a Google Analytics (GA) account. You also have the best Facebook ad campaign in the world. It’s really the best, which means it’s not the cheapest.

People are clicking on your ads, visiting your website, and purchasing or leaving. But how can you get more information about their Facebook and website activities? A common way is to gather data on customer behavior in your Facebook and Google Analytics. Here are some reasons why you might 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 shows you what happens after an ad is clicked and tells you who’s visiting your website from social media.
  • Google Analytics shows all of your channels so you can analyze and compare them.
Facebook and website activities

This is why Google Analytics is the most popular platform for tracking Facebook advertising campaigns. Later, we’ll tell you about a way to integrate these two systems in one digital analytics instrument.

Table of contents

Why should you track Facebook ads in Google Analytics?

  1. Tracking Facebook ads in Google Analytics 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 that doesn’t match whatsoever. Discrepancies between data from Facebook and Google Analytics stems from different tracking approaches and some other technical factors. Smartly combining all analytical instruments we have is the only way to get data on what users do both before and after clicking on ads.
  1. Tracking Facebook advertising campaigns in Google Analytics is crucial for investigating total marketing expenses and calculating return on ad spend (ROAS). You might suppose that somehow you can improve your social media advertising but have no data to rely on in your estimates.
  2. Tracking Facebook ad data in Google Analytics is a great idea if you’ve started your journey from SMM specialist to analyst and have decided to begin by analyzing Facebook data.

Let’s see what do you want to track with a help of Google Analytics or Facebook. What’s your main need? What are your aims? The deeper we go into these questions, the more details we reveal.

Analytics you needThe data flow you need
Reach, views, clicks, separate promotion cost, events costFacebook Business & Facebook Pixel
Views, clicks, ad costs, conversions, customer behavior tracking, comparative analysis with other channels, audience, geo, device, landing page reports, etc.Facebook → Google Analytics
All possible custom reports without data samplingFacebook → Google Analytics → Google BigQuery

If you’re experienced, want full-stack analytics, and are ready for an out-of-the-box solution, try OWOX BI. There are no risks of manual integrations, OWOX BI just works and saves you a great amount of time.

OWOX BI has created the Facebook → Google Analytics and Facebook → Google BigQuery pipelines to make your work with data easy and to let you completely concentrate on insights from reports. Or else you need to dive into detailed instruction and take up to 10 steps to at least upload data manually in your GA.

OWOX BI Facebook → Google Analytics
BOOK A DEMO

But if you want to know how you can do all these steps by yourself, read the instructions below!

What do I need before I start tracking Facebook advertising campaigns?

To start tracking Facebook advertising campaigns in Google Analytics, you have to ensure that your website has a GA or GTM tracking code on each page you want to track. Also, administrator permissions are a must for all of your Google Analytics activities.

Keep in mind that with GA, you’ll be able to track only your campaigns, pages, and personal account activities in tight connection with your website. You won’t be able to say for sure what people are doing before clicking the link to your website, for instance. But you can install a Facebook Pixel to track the cost of events on the Facebook side. And you can set goals and conversions in GA. Keep in mind that both of these systems have the same settings. This is necessary for further importing data and uniting it in one database.

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

  • 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 parameters are the key to working with different types of advertising campaigns on Facebook. If you create your UTMs correctly, the data will be marked properly and you’ll get the reports you want.

So let’s get started!

Collect all the 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 website with Google Analytics 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 web page to the informational block of your business page. All of these URLs will be like entrance points from Facebook to your website where Google Analytics will collect traffic data.

Here’s the table you should create:

the table you should create

Or just download our full-fledged UTM infographics to avoid errors.

bonus for readers

How to create UTM tags and track your ads campaigns

Download now

Complete links with UTM parameters

At last we’ll explain what UTM is! You’ve seen it as a long tail or URL text while clicking on ads and proceeding to another page. So what kind of information can be included in URLs with UTMs?

Here’s a table showing types of UTM parameters:

UTM parameterSyntaxMeaning
Sourceutm_sourceWhere your traffic is coming from
Mediumutm_mediumThe platform you’re using
Nameutm_campaignThe marketing campaign of this message
Term (Optional)utm_termWhat term you’ve set in ad campaign
Content (Optional)utm_contentWhich pieces of content this link leads to

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 «2018prompromo» means! So pay attention to ad campaigns names.
  • The terms and content are optional and are used mostly in Google Ads campaigns.

As UTM parameters and the creation of infused URLs are virtuoso tasks, let’s leave this to a special service: Google Analytics URL Builder.

Google Analytics URL Builder

Let’s look at how the table in your spreadsheet might look:

  • Link: www.owox.com/sale
  • Source: facebook
  • Medium: cpc
  • Campaign: sale2022
  • Ready-to-use link: www.owox.com/sale?utm_source=facebook&utm_medium=cpc&utm_campaign=sale2022

The last column is the URL you should use in your campaigns. Is that too complicated for you? If so, use dynamic parameters. What’s most important is to use them in the URL and point out which parameter you’d like to track in your campaign.

You can choose dynamic parameters in the Facebook Ads Manager.

dynamic parameters

Remember the syntax:

MeaningSyntax
The ID of the minimal elements of an advertisement: links from texts, pictures, etc.ad_id={{ad.id}}
The ID of the adset — ad settings with different audiences, targeting behavior, etc.adset_id={{adset.id}}
The campaign IDcampaign_id={{campaign.id}}
Names of entities (better not to change them after the campaign is launched)ad_name={{ad.name}}
adset_name={{adset.name}}
campaign_name={{campaign.name}}

So what’s the difference between static and dynamic parameters, you’re wondering? With dynamic parameters, Facebook will try to fill in the parameters you’ve requested. If you’re new to this, try it yourself to understand how this is reflected in your GA reports.

That’s the minimum you need to know for any type of Facebook and Google Analytics integration.

The simplest way to track Facebook advertising campaigns in Google Analytics

Let’s presume that the UTM stage is done. The next steps are:

Open your Google Analytics account. Go to Acquisition → Campaigns → All Campaigns.

Acquisition → Campaigns → All Campaigns

Then filter the view with the Source/Medium primary dimension. Or use the small search bar and type the Campaign Name you’ve used in your UTM tags.

You can also create the segment or a custom filter for social media campaigns or see how people are led to the checkout in Acquisition → Social → User Flow.

Acquisition → Social → User Flow

You can create a simple custom filter that contains only incoming Facebook traffic. It will help you to break down the data and get through it easier. Be aware that filters on the property level will ignore data that doesn’t match this filter and that you’ll lose filtered data in this property. So it’s better, easier, and safer to use segments.

In Acquisition → Social → Conversions → Facebook → Assisted vs Last Interaction Conversions you can find some insights, too.

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 import.

Set up Facebook cost data tracking in Google Analytics

There are two ways to do this. You can set it up manually or use OWOX BI. But manual setup without preparation and a complete understanding of the process often leads to errors in reports and additional worries.

Let’s see how we can track Facebook cost data in Google Analytics manually.

  1. Open your Google Analytics account and go to Acquisition → Campaigns → Cost Analysis Report. Let’s filter by facebook in the search line and see our campaigns for a certain period. Those zeros are okay, even if they’re quite depressing. These are campaigns we hope to enrich with cost data.
Acquisition → Campaigns → Cost Analysis Report
  1. Now go to Admin → Property → Data Import. This is the main menu where you can add cost data.
  1. Press the Create button. You should now be in the Data Set schema settings. Choose Cost data. Name it and choose the views in which you want to implement this piece of cost data.
  1. The next step shows you the requirements for the data schema that must be in a spreadsheet you need to prepare to work properly. As you can see, the date, medium, and source must be provided in your import spreadsheet. You must also add cost, clicks, and impressions lines in any combination. You can add additional fields at the bottom of the settings. Select Import Behavior from the Summation or Rewrite data uploading rules.
  1. After you’ve adjusted the settings, your new data schema will appear in the Data Import main menu. Now you’re ready for uploading from the Google Analytics side.
  2. Push the Get Schema button. This will download an Excel template. Feeling exhausted already? We are too.
  1. This is what the downloaded template looks like. And the most interesting part is filling these columns.
downloaded template
  1. Open the Ads Manager or Facebook Pixel. Check the date period: it must be the same as you’ve chosen in the Google Analytics profile. To fill our data schema correctly, we must break down the data by day, as we have the ga:date column. Then export the data in .csv format.
  1. Open the Facebook data file in a new spreadsheet and you’ll get something like this:
  1. Copy the data from this Facebook file into the Google Analytics schema file. Be sure that all the columns are filled in properly. You can see GA source and GA medium in the GA campaigns description. It’s always the same — the source is facebook.com and the medium is cpc for cost-per-click ad campaigns. Cost data is the amount spent. And unique clicks is shown in the clicks column. If something’s wrong, Google Analytics will send you an error. Or two dozen. Who knows?
  2. Export the spreadsheet file in .csv format as well. Now go back to the Data import menu in the Admin section and click the Upload File button. Upload the spreadsheet file you just exported and wait for it to be validated.
  3. Now Google Analytics will tell you what’s wrong. Edit the requested columns unless it won’t let you proceed further. After you upload a file without errors, Google Analytics will process your data within a day. What speed!
  4. If everything is okay, you’ll get back to where you started.

This is how you can import your Facebook ad costs into Google Analytics.

Even if you’re doing everything correctly and without errors, would you honestly like to do this each time you need a report? Or would you prefer spending 15 to 30 minutes just once setting up OWOX BI and forget about manual uploading?

With OWOX BI, you get the same report in half the time and get even better reports as a bonus! Here are the steps for setting up OWOX BI:

  • Log in to OWOX BI using your Google account.
  • Authorize OWOX BI to access your Facebook account.
  • Select Google Analytics as the data destination service.
  • Set the start date of data import and select the Google Analytics view you’d like to use.

OWOX BI Pipeline

  • Views: 233
  • 15 May 2017

End-to-end analytics with integrated data from Facebook, Google Analytics, and other channels

If you’d like to know about more end-to-end analytics, you should know about OWOX BI and how it works. You must know that end-to-end analytics is almost unattainable with a manual approach. So that’s why we suggest trying the FB → GBQ pipeline. This pipeline give you:

  • all possible custom reports — use all 200 Facebook parameters that we import into Google BigQuery for you;
  • add multiple Facebook accounts and combine their data;
  • get insights without any time restrictions in a safe and sound environment with a simple interface;
  • add data from advertising, call tracking, CRMs, and other digital systems to one database (allowing you to generate one comprehensive report).

We encourage you to raise your ambitions. Put a rocket on your analytics to launch it to new insights. And finally, find some valuable insights for business growth zones.

BOOK A DEMO

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