How to Add Facebook to Google Analytics

Cody Schneider7 min read

Tracking Facebook ad performance without seeing what happens after the click is like only knowing the first half of a story. You need to connect that ad data to Google Analytics to understand how those clicks translate into actual site engagement, leads, and sales. This guide will walk you through exactly how to link your Facebook campaigns to Google Analytics for a complete picture of your marketing ROI.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why You Need to Connect Facebook to Google Analytics

Before diving into the "how," it's important to understand the "why." By default, Facebook Ads Manager and Google Analytics operate in separate silos. Facebook tells you all about ad engagement - clicks, impressions, cost per click (CPC) - while Google Analytics tells you all about website behavior - sessions, conversions, bounce rate, and revenue.

Combining them gives you an invaluable, unified view.

  • See the Full Customer Journey: Did that click from a Facebook video ad lead to a user who viewed five pages and signed up for your newsletter? Or did they bounce immediately? Facebook can't tell you this, but Google Analytics can.
  • Get Accurate Attribution: By default, Google Analytics often misattributes traffic from Facebook ads, lumping it into "Direct" or "Referral" traffic. This under-reports the value of your social campaigns. Proper tracking ensures Facebook gets the credit it deserves.
  • Calculate True ROAS (Return on Ad Spend): By seeing which specific Facebook campaigns drive revenue and goal completions in Google Analytics, you can accurately measure your true return on ad spend and make smarter budget decisions.
  • Compare Channels Apples-to-Apples: Viewing Facebook performance alongside Google Ads, organic search, and email within Google Analytics gives you a single source of truth to evaluate your entire marketing mix.

The Key to Tracking: UTM Parameters

The entire process of tracking Facebook traffic in Google Analytics hinges on one simple but powerful concept: UTM parameters.

UTM (Urchin Tracking Module) parameters are simple tags that you add to the end of a URL. When someone clicks a link with these tags, the parameters are sent to Google Analytics, giving it specific information about where the click came from. It turns a generic website visit into a highly detailed data point.

There are five standard UTM parameters you can use:

1. Campaign Source (utm_source)

This tells Google Analytics where the traffic is coming from. For Facebook ads, this is simple and should always be consistent.

  • What it is: The specific source of your traffic.
  • Example: utm_source=facebook
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

2. Campaign Medium (utm_medium)

This explains the type of marketing channel your traffic came from. Consistency is key here. Pick a value and stick with it for all your paid social efforts.

  • What it is: The general marketing channel.
  • Example: utm_medium=cpc (for "Cost Per Click") or utm_medium=paid-social

3. Campaign Name (utm_campaign)

This identifies the specific campaign you are running. This should match the name of the campaign you created in Facebook Ads Manager.

  • What it is: Your specific promotional effort.
  • Example: utm_campaign=summer-sale-2024

4. Campaign Content (utm_content)

This helps you differentiate ads or links within the same campaign. It’s perfect for A/B testing creative. Did your video ad perform better than your carousel ad?

  • What it is: Distinguishes between different creative or links.
  • Example: utm_content=video-ad-version-a or utm_content=blue-button-image

5. Campaign Term (utm_term)

While originally intended for paid search keywords, in the context of Facebook ads, utm_term is commonly used to identify the Ad Set Name. This helps you track which audiences or targeting groups are performing best.

  • What it is: Often used for the Ad Set.
  • Example: utm_term=lookalike-audience-top-1-percent

When combined, they create a URL that looks something like this:

https://www.yourwebsite.com?utm_source=facebook&utm_medium=cpc&utm_campaign=summer-sale-2024&utm_content=video-ad-a

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step-by-Step: Adding UTMs in Facebook Ads Manager

Manually creating a long URL for every ad would be a nightmare. Thankfully, Facebook Ads Manager has a built-in tool that uses dynamic URL parameters. This lets Facebook automatically populate your UTM tags with the correct Campaign, Ad Set, and Ad names, saving you immense time and preventing typos.

Here’s how to set it up:

  1. Navigate to the Ad creative level of your campaign in Facebook Ads Manager.
  2. Find the Destination section. You should already have your website URL filled in here.
  3. Scroll down to find the “Tracking” box. You'll see a section called “URL Parameters,” which is where the magic happens.
  4. Click “Build a URL Parameter.” A new window will pop up, allowing you to easily build your UTM structure without any manual coding.
  5. Fill out the fields using a mix of static and dynamic values. Here is a recommended, effective setup:

Once you’re done, your setup should look like this. Click “Apply.”

Once you click "Publish," every ad using this setup will automatically have perfectly formatted URLs for Google Analytics tracking. It works seamlessly whether you're working with a single ad or hundreds.

Finding Your Facebook Ad Data in Google Analytics 4

Once your ads are live with UTMs, the data will start flowing into GA4. Here is where you can find and analyze it.

1. In the Traffic Acquisition Report

This is the primary location for seeing how different channels are performing.

  • From the GA4 sidebar, navigate to Reports > Acquisition > Traffic acquisition.
  • The default primary dimension is usually 'Session default channel group.' Click the dropdown arrow next to it and change the primary dimension to Session source / medium.

You will now see a line item for facebook / cpc (or whatever medium you chose). Here, you can analyze Sessions, Engaged users, Engagement rate, Conversions, and Total revenue from your Facebook ads right alongside all your other traffic sources.

2. For Deeper Analysis

  • Add a secondary dimension: While viewing by Session source / medium, click the small “+” sign next to the primary dimension header and add “Session campaign.” Now you can see performance broken down by each individual Facebook campaign.
  • Create Explorations: For more flexible analysis, use the 'Explore' section in GA4 to build custom reports. You can create a free-form report filtering specifically for utm_source contains facebook and then drag and drop dimensions like Campaign, Ad Content, and metrics like Revenue and Conversions.

Advanced Step: Importing Facebook Cost Data to GA4

UTM parameters are fantastic for seeing engagement and conversion data from Facebook, but they're missing one crucial piece of the puzzle: cost. Without cost data, you cannot calculate ROAS or cost per acquisition directly inside of Google Analytics.

Google Analytics doesn’t automatically import spend data from non-Google platforms. To do this, you have two primary options:

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

1. Manual Data Upload

Google Analytics allows for the importing of cost data via a CSV upload. The process involves:

  • Exporting your campaign data (including spend, clicks, impressions) from Facebook Ads Manager.
  • Reformatting that data into a specific CSV template that Google Analytics requires. The template must include the utm_source, utm_medium, and utm_campaign, along with date and cost metrics.
  • Navigating to Admin > Data Import in GA4 and uploading your CSV file.

This method is free but is extremely time-consuming and needs to be repeated frequently (daily or weekly) to have up-to-date data. It’s also prone to human error when formatting the files.

2. Automated Connectors

A better and much more scalable solution is to use a third-party data integration tool. These platforms act as a bridge, automatically connecting to the Facebook Ads API and the Google Analytics Data Import API. They fetch your cost data from Facebook on a set schedule and push it into Google Analytics for you. While these services have a monthly fee, they save hours of manual work and ensure your data is always accurate and updated.

Final Thoughts

Connecting your Facebook ads to Google Analytics is no longer a "nice-to-have", it's a fundamental step for any business that relies on performance marketing. Using a consistent UTM strategy lifts the veil, allowing you to see exactly how your ad spend translates into meaningful business outcomes on your website and enabling you to optimize your campaigns with confidence.

Of course, building and managing all of these connections, UTM parameters, and data imports can still be time-consuming, especially as your marketing mix grows. This is exactly why we created Graphed. We connect directly to your data sources like Facebook Ads, Google Analytics, Shopify, and more in one click. You can instantly ask questions in plain English - like "Show me a dashboard comparing Facebook spend vs Shopify revenue by campaign" - and get a real-time answer without ever having to set up a UTM parameter or format a CSV file again.

Related Articles