How To Track Facebook Advertising Campaigns in Google Analytics

Published May 12, 2014
Facebook ads can be a powerful source of traffic for a website. But measuring and amplifying their performance is harder if they aren’t properly tracked in Google Analytics.
No worries! We’re here to help you improve your Facebook ad tracking.


Facebook Advertising and Google Analytics


How To Track Facebook Ads in Google Analytics

Here are the quick steps:

  1. Use Google’s URL builder to generate a landing page URL with tracking parameters.
  2. In the builder enter the URL of your chosen landing page where it says “Website URL”.
  3. Name “Facebook” as the “Campaign Source”.
  4. Use “ppc” or “cpm” as your Campaign medium depending on your objective (i.e clicks or impressions)
  5. Name your campaign in a way that will help distinguish it from other campaigns you may be running
  6. Create your ad in Facebook Ad Manager
  7. In Ad Manager enter the URL you generated with the URL builder, including the tracking parameters, as the landing page in the field that says “Enter URL to promote”
  8. Complete your ad, start your campaign and measure

That’s the short version. But for a step by step guide and some insights into common problems, read on.

How Campaign Tagging Works

Google does a pretty good job of explaining how they use URL parameters to identify and classify referral traffic. But essentially, When a Facebook user clicks on a link that has been tagged in this way, those parameters are detected by Google Analytics and used to correctly classify the traffic as coming from Facebook.

Google’s Campaign URL builder is a convenient way to help you construct a tagged link to your landing page, so you never have to worry about what parameters it should have.

Step-by-step: Tagging a Facebook Ad Campaign

Here is the detailed process, with screenshots that you can use to create a Facebook ad which is correctly tagged for tracking in Google Analytics. First, open your Facebook Ads Manager and click Create Ad as you normally would.


Start creating the Facebook ad


For this example, let's assume that you want to optimize for clicks to your website. So, select that option from Facebook.


Select the option to generate clicks to website


Now, Facebook asks you to enter the URL of the landing page where ad clicks should send the visitor. If you haven’t already created your parameter based landing page URL at this point head over to the Google Campaign URL Builder and fill out the form to add tagging to your landing page.

As we said earlier, this is the place where you will enter your landing page URL where it says “Website URL”. Then identify “facebook” as the “Campaign Source”. In this case, I’m using “cpm” as the “Campaign Medium” because Facebook is going to charge me for impressions, not just clicks. But if this were a pay-per-click campaign, I would use “ppc” instead. Lastly, give your campaign a name where it says “Campaign Name”.


How to fill in the form for the Google URL builder


When you click "Submit", Google will give you an enhanced landing page URL with the parameters properly added for accurate classification by Google Analytics.

Google URL builder returns the tagged landing page URL

This is the URL that you enter into the Facebook ad builder when prompted to "Enter URL to promote".

Enter the tagged URL when prompted by Facebook

Now, complete the creation of your Facebook ad as you normally would. Start the campaign, and observe what happens in Google Analytics.

Facebook Advertising Traffic - Properly Classified

After a few hours, check your Google Analytics. You should start seeing traffic from Facebook classified as "facebook/cpm" or "facebook/ppc".


Facebook advertising traffic showing up correctly


Now, if you click through on the "facebook/cpm" row in Google Analytics, you can see the campaign information that you entered in the Google URL builder. Make sure that you select "Campaign" as the Primary Dimension in the Google Analytics report. This will show you the name of your campaign. As you can see below, it shows clicks coming from the "Clicks to Website 1" campaign - which is what we entered into the Google URL builder.


Viewing your Facebook campaign name in Google Analytics


What if Your Facebook Traffic isn’t Showing Up?

If you skipped the parameter generation, your Facebook traffic could be getting classified incorrectly in analytics. A client of mine recently ran some Facebook ads and was perplexed that there was no big bump in their referral traffic from Facebook. Here's a screenshot showing a typical day during the campaign.


Referral traffic from Facebook shows up as (mobile), (desktop) and (link shim traffic from FB). The 24 sessions shown here were much less than expected.

Facebook Traffic May Show Up As Direct

However, this client was seeing a big bump in their direct traffic. A typical day would have 10-15 direct, but here they were seeing 123. The problem was that Google Analytics was classifying a lot of the Facebook advertising traffic as direct.

In Google Analytics, direct traffic is traffic for which a referrer wasn’t specified. GA gets the referral information from the HTTP header. However, if the HTTP header does not include a referrer field, then GA cannot figure out where the request is coming from.

For many reasons, traffic from Facebook ads often do not include a referrer, and that causes GA to classify the traffic as direct. So, in order to accurately classify traffic coming from Facebook, you need to take a different approach.


It’s relatively easy to properly track traffic from a Facebook campaign, there are just a few extra measures that will help you get better more accurate data and avoid the misclassification of traffic.


When the client first came to you, you talked up the value of Google Analytics. You emphasized the importance of seeing where your traffic was coming from. You went on and on about how Google Analytics can show traffic sources to pinpoint whether people came from search, social media or a specific site referral, and how valuable this data was. You sold them on it, so much so that your client looked forward to receiving that first report, the magical day when they would finally understand where visitors were coming from.
But then the report came, and it looked like this:



It showed that 10% of your client’s traffic came from “(direct)/(none)”. What does this label mean? How do you explain Direct traffic to your client? Better yet, how do you explain “none”?
Let’s take a closer look at understanding Direct traffic in Google Analytics and how we can address it with clients.
Digital marketers spend a lot of time focused on PPC and SEO campaigns in order to drive desirable traffic to a website. The phrases we’re ranking for and bidding on get meticulous attention, so much so that we often forget about some of the other ways that visitors find us.

We put a tremendous amount of the effort we put into reviewing organic search data and PPC campaign performance in analytics. But how closely do we monitor referral reports?

If that’s not a channel you review regularly, you may be missing out on seeing traffic that is coming directly from links you’ve obtained around the web, local business listings, news mentions, and more. Many times, links are only considered as a means to an end, a metric that Google uses in determining how to rank sites in the SERPs (search engine results pages). But the fact is, many of a site’s links may be directly contributing to its traffic.

In this article, we’ll review how to look at referral reports in Google Analytics, and some of the many ways to use that data to better inform your web marketing decisions.


Remember how your mom told you not to stand too close to the television because it might hurt your eyes?

The same rules can apply to data. If you’re too close, you may miss the patterns and trends that are crucial to understanding your website’s performance. You can’t judge a site’s performance looking at data in the bubble of a single day, you must consider any day’s traffic compared to the days before and after.

Google Analytics makes it fairly easy to analyze trends over long periods of time. But it also allows you to stand right in front of that TV, to look at more granular levels of time, right down to the hour.
There’s a better way to get that close to the data, without burning your retinas. We’ll cover how to analyze traffic effectively in today’s post.