How to track Facebook ads and promoted posts with Google Analytics

[Updated: Jan 2020] Often I see quite significant amount of facebook.com and instagram.com referral traffic in Google Analytics reports that clearly is driven by paid advertising campaigns or post promotion. Usually that it either due to absence of tracking parameters or using inappropriate fields in Facebook Ads Manager.

Without tracking parameters you are losing valuable data on Facebook ad performance – one of the largest (Facebook and Google hold more than half of digital ad market) and efficient advertising platform. While Google has auto-tagging by default, in Facebook you have to set the tracking yourself.

I’ve covered the campaign naming and tagging topic in the previous article, so now will focus only on how to set it up for Facebook advertising. If you are not familiar with UTM link tagging, check that article first.

Always use the URL parameters field

When setting up ads, please, do not place the landing page link with UTM parameters in the Website URL field.

This is not good, please don’t do like that

Instead, put the link without tracking parameters in the Website URL field and UTM parameters in the URL parameters field below.

This is how you should do

That will ensure proper tracking, especially for such ad formats as Collections or Facebook Dynamic Ads, where your landing pages are set dynamically from data feeds. Also, it will be easier to manage both landing page and UTM parameter changes, since they will be in separate fields. Or, for carousel ads, you won’t have to add tracking for each link separately (that is not fun at all..). I will cover few more benefits with examples further.

Important! Note that you don’t need a ? symbol in URL Parameters. Start with the first key (before the =) and value (after the =) pair, separated by &.

Post Promotion: Promoted post has no UTM tracking

You need to promote a published Facebook page post with a website link that has no UTM tracking, so all the visits from the post will be attributed to facebook.com / referral, therefore you won’t be able to measure this exact post performance.

Should you delete the post and publish it again with UTM tracking? Not really (and often you may not have the right to do it). If you add the UTM parameters to the URL parameters field, once the ad goes live, they will be automatically added to the link.

Even if you have a link in the text, it will also be appended with the tracking parameters. Like in the example below, you see just the https://www.apasters.com/, but if you click, you will actually click on the link with the UTM parameters. Cool, right?!! (This won’t work with link shorteners like bit.ly, only direct links)

Facebook promoted post preview

As a result, clicks from organic post will be attributed to facebook.com / referral (or similar, based on there the click occurred). Clicks from promoted post will be attributed to facebook.com / social, also having additional data on campaign name from utm_campaign and article alias from utm_content. You won’t be able to attribute the organic performance to the exact post, while see the overall organic vs paid performance as well as paid post performance in detail.

Post Promotion: Promoted post has UTM tracking

So your promoted post already has UTM tracking in place as in the example below. All covered and can do nothing?

Facebook organic post

Yes. Or, if you want to have different values or parameters to separate paid and organic clicks, you can still add tracking parameters.

For example, I’ve changed utm_medium to paidsocial, added utm_term parameter and didn’t add utm_content (just for the sake of example).

As a result, for paid clicks there will be facebook.com / paidsocial, while organic will have facebook.com / organic source and medium. Also, there will be additional utm_term parameter and utm_content was inherited from organic link.

What way you will be able to track and attribute correctly both paid and organic website link clicks.

Instead of having multiple rows with similar source / medium variations (that only mess your data in Google Analytics)…

… you will have more detailed and structured data. Better data = better results (if used wisely).

URL tracking with dynamic parameters for ads and posts

Similarly, as for promoted post examples, use URL parameter field for Facebook Ad tracking and make sure you have the correct naming. When duplicating ads, don’t forget to update UTM tracking parameter values.

A while ago, Facebook introduced Dynamic URL Parameters that allow to setup a tracking template and almost forget about manual tracking update.

Facebook supports the following dynamic parameters:

  • {{ad.id}}
  • {{adset.id}}
  • {{campaign.id}}
  • {{ad.name}}
  • {{adset.name}}
  • {{campaign.name}}
  • {{placement}}
  • {{site_source_name}}

You can input them manually or use the “Build a URL parameter” option. When the ad is displayed, Facebook replaces the dynamic parameter with a value from the ad settings. So you can assign the same URL parameters template for all the ads and the values will change based on each ad campaign, ad set and ad settings.

Important! Once you publish the ad, campaign name, ad set name and ad name dynamic parameters will refer to the original campaign data. So if you will change those values, that won’t be reflected in the URL. Learn more about Facebook URL parameters here

I strongly suggest to use dynamic URL parameters, as they save time and ensure better data quality in Google Analytics.

Possible issues when using link shorteners

When using bit.ly and other link shorteners in Facebook post and ad content, tracking templates will be also automatically added to short links. Unfortunately, often those parameters are truncated and not passed to the destination page after the redirect.

As you can see in the example, short link is redirected to the final page and utm_ parameters are not passed to the destination page. As a result, this traffic will be attributed to facebook / referral or direct / (none) and you won’t be able to successfully analyse Facebook Ad performance in Google Analytics.

However, Facebook Click ID or fbclid (if present, omitted in this example for simplicity) is passed to the destination page, at least for the several tests made with bit.ly links.

Possible solutions:

  • Shorten links already with tracking parameters. If could be a challenge if you have many ads running with own tracking parameters to differentiate campaigns, ad sets, ad variations and etc.
  • Put your website directly in ad copy instead of short links.
  • Create your own customized branded short links, and make sure that they will pass all tracking parameters added to the short links.
  • Don’t use links in ad content, only full landing page links in Website URL Facebook Ad manager settings.

Summary & recommendations

  1. Always use UTM tracking parameters for paid and organic posts, as well as regular ad campaigns.
  2. Always use URL parameters field for UTM tracking.
  3. Have consistent naming across you campaigns and also between Facebook campaign names and UTM parameters. Ideally, UTM parameters should fully match Facebook campaign, ad set and ad names.
  4. Promote posts via Ads Manager, not Boost button. It will take a bit more time, but give better control on settings and eventually allow to better evaluate and improve performance.
  5. If using short links, ensure that tracking parameters are not lost during the redirects. Click on ad previews and check the parameters passed to the final landing page.
  6. Connect Facebook and Google Analytics data to evaluate Facebook visitor behavior as well as calculate CPA and ROI as attributed by Google Analytics. You may be surprised from the difference with Ads Manager conversion data due to Facebook attribution ;)
  7. Constantly check Facebook ad performance in Google Analytics. Analyse the data you collect, look for insights and improve ad performance.

Of course, it all works with any other Web Analytics platform you are using, not only Google Analytics. You will have different parameters, but the rest is the same.