Complete Guide to Google Analytics for Facebook

 

In this article you will learn about:

#1 Facebook Link Shim referrals in Google Analytics

#2 The truth about Facebook mobile traffic

#3 Tracking Facebook ad campaigns in Google Analytics

#4 Creating your own Facebook channel for tracking Facebook traffic in Google Analytics

#5 How Facebook traffic moves through the checkout process or complete a goal conversion

#6 Determining top traffic generating web pages shared on Facebook

#7 Tracking Assisted and last click conversions from Facebook

#8 Understanding Facebook Users Flow

#9 Tracking Facebook ‘likes’ and ‘unlikes’ in Google Analytics

#10 Understanding the data discrepancy between Facebook and Google Analytics data

This article is in conjunction with the article ‘Guide to Social Interactions Tracking in Google Analytics‘ where I introduced the concept of social interactions tracking in Google Analytics and explained in great detail, what social interactions are and what are the requirements, for such type of tracking set up.

If you have ever looked into Google Analytics, to track the performance of Facebook campaigns, you know that Facebook generates, way too many referrers:facebook referrals

I discovered 43 different Facebook referrers in the Google Analytics report of the last one year alone.

So let us start with understanding what these different referrers are and why Facebook generates so many referrers.

 

Introduction to Facebook Link Shim

‘Link Shim’ is a tool used by Facebook to achieve following three objectives:

#1 To check whether a clicked link is spammy/malicious. If yes, then warn user of the malicious website ahead.

#2 To rewrite referrer in order to hide personally identifiable information and thus protect users’ privacy.

#3 To preserve Facebook referrer data esp. when a user navigates from HTTPS to Non-HTTPS website.

 

Link shim tool check for spammy / malicious links

Every time a user clicks on an external link on Facebook, the ‘Link Shim’ tool checks whether the clicked link is spammy / malicious. The link is checked against Facebook own internal database of spammy / malicious links.

If Facebook detects that the clicked link is malicious, then it redirects the user to an intermediate page, which warn user of the malicious website ahead and give him the option to return to Facebook:

please be careful

 

Link shim tool rewrite Facebook referrers

Facebook is very wary about protecting its users’ privacy and going to great length, in making sure, that it hides personally identifiable information from third party websites.

In Facebook own words:

Facebook is one site where referrers don’t really belong.

As part of our continued efforts to protect users’ privacy, we proactively protect our users from exposing how they navigated to an external site.

Source: https://www.facebook.com/notes/facebook-engineering/protecting-privacy-with-referrers/392382738919

The ‘Link Shim’ tool is actively used to rewrite Facebook referrers, in order to hide personally identifiable information like removing user IDs from referrer URLs, before web browsers send them to external websites.

 

Link shim tool preserve Facebook referrers

By default, a referrer is dropped when a user navigate from https website to a http website. This is done, in order to follow the secure protocol which states that:

If a website is accessed from a HTTP Secure (HTTPS) connection and a link points to anywhere except another secure location, then the referer field is not sent.

Source: https://en.wikipedia.org/wiki/HTTP_referer

Facebook is on HTTPS but many websites are not.

So in the past, Facebook wasn’t able to send referrer data to non-HTTPS websites, as referrer can not be passed from a HTTPS website to non-HTTPS website.

In order to fix this problem, Facebook started using an internal redirect script, that first redirects a visitor to a non-HTTPS page (which creates its own referrer data) before sending the visitor to the actual URL on a HTTP website.

For example,

When you click on an external link say: http://www.eventeducation.com/forming-event-company.php on Facebook, you will be first be redirected to an intermediate non-HTTPS page like:

http://facebook.com/l.php?u=http%3A%2F%2Fwww.eventeducation.com%2Fforming-event-company.php&h=1AQGREEXZ&enc=AZOFTubs48cxGeO0qt2G1BRSP4dIKtxGE3iw3qRxJo9F1n5wvjNGriJd2WY4VBpO6xw_kYtWTeKZLwHhlHN5VjYv-hbh0EeAJppnApx1N8eCxOSUjW-yd3upyNt_J9rrMZAfD5YbqWtMwFkDJ0EPRtOB5emrpi8GS0OHOH-DevWabRLC6GiCDevNtQO0ZETLA-9CkdcooVrT6sbkr6kIaON4BcbrZYm1StqEsIqc79xcQyOKLMLdtM2yyXOqVlYkT0Q&s=1

Before you are sent to the actual URL.

This temporary redirect to the intermediate page: facebook.com/l.php last for only milliseconds. Because of this reason, you can’t see this redirect taking place. What you really see, is the final destination URL.

Now since Facebook is not sending the original referral data from a HTTPS website to a HTTP website, it is honouring the secure protocol and at the same time, also able to send the referrer data.

Google and twitter follow the same tactic. They create and send their own referrer data instead of the original referrer data.

Now since Facebook does not send the original referrer data, they can rewrite the referrer data, whatever way they want and can hide any information they like. Another obvious advantage of using this tactic is that, Facebook can easily hide personally identifiable information and can thus protect users’ privacy.

 

Facebook Link Shim pages

Facebook link shim page is the non-HTTPS web page where a user is temporarily redirected (for few milliseconds) before being redirected to the desired web page.

Following is the example of a URL of a link shim page:

http://facebook.com/l.php?u=http%3A%2F%2Fwww.eventeducation.com%2Fforming-event-company.php&h=1AQGREEXZ&enc=AZOFTubs48cxGeO0qt2G1BRSP4dIKtxGE3iw3qRxJo9F1n5wvjNGriJd2WY4VBpO6xw_kYtWTeKZLwHhlHN5VjYv-hbh0EeAJppnApx1N8eCxOSUjW-yd3upyNt_J9rrMZAfD5YbqWtMwFkDJ0EPRtOB5emrpi8GS0OHOH-DevWabRLC6GiCDevNtQO0ZETLA-9CkdcooVrT6sbkr6kIaON4BcbrZYm1StqEsIqc79xcQyOKLMLdtM2yyXOqVlYkT0Q&s=1

You do not see the link shim page URL, when you mouse over an external link on Facebook. What you see on mouseover, is the URL of the destination page.

Facebook uses onmousedown handler that modifies the link (into link shim link), after a user has clicked it. So your web browser see the link shim link first, before it is redirected to the destination link.

All of this happen so fast, that as user, all you see is the URL of the final destination page.

Following are the two most common URIs of a link shim page:

  • /l.php
  • /lsr.php

link shim pages

Other less common URIs are: a.php, home.php etc.

 

Facebook link shim referrals

All link shim pages rewrite and send Facebook referrer data to web browsers. So technically speaking, all link shim referrers are same as the Facebook referrers, we see in Google Analytics reports.

However there are, some Facebook referrers which contain the letter ‘l’ somewhere.

For easy reference, I call such referrers as link shim referrers.

Following are some examples of such referrers:

  • l.facebook.com/l.php
  • l.facebook.com/lsr.php
  • facebook.com/l.php
  • m.facebook.com/l.php
  • lm.facebook.com/l.php
  • lm.facebook.com/lsr.php

 

Every user who clicks on an external link on Facebook, is temporarily redirected to a link shim page, before being sent to the destination page.

How do I know this for so sure?

This is because, Facebook can not rewrite referrer data otherwise.

According to facebook documentation on link shim, the link shim tool is also used to protect users’ privacy and identity.

Therefore we can not conclude that:

#1 Only the traffic from l.facebook.com or lm.facebook is directed through link shim page.

#2 All the traffic from facebook.com or m.facebook is not directed through link shim page.

The only thing we can safely conclude, at this point, is that, Facebook is not consistent with the naming of its referral data.

Since Facebook does not send the original referrer data, they can rewrite the referrer data, whatever way they want, whenever they want and can hide any information they like.

It seems they keep dropping and introducing new referrers.

I discovered 43 different Facebook referrers in the Google Analytics report of the last one year alone.

Following are some examples:

  1. p.facebook.com / referral
  2. cstools.facebook.com / referral
  3. pt-br.facebook.com / referral
  4. fb.m.facebook.com / referral
  5. intern.facebook.com / referral
  6. 0.facebook.com / referral
  7. our.intern.facebook.com / referral
  8. apps.facebook.com / referral
  9. our.cstools.facebook.com / referral
  10. touch.facebook.com / referral
  11. business.facebook.com / referral
  12. mbasic.facebook.com / referral
  13. web.facebook.com / referral
  14. similarweb.facebook.com
  15. mobile.facebook.com
  16. m.facebook.com
  17. lm.facebook.com
  18. static.ak.facebook.com

Most of these referrers are legitimate, in case you are wondering, it could be a referrer spam. Some of these referrers no longer exist.

For example:

  • web.facebook.com redirects to facebook.com
  • Apps.facebook.com redirectes to facebook.com/games/

 

Not all mobile traffic from Facebook is actually from mobile devices

You may be under the impression that, all of the traffic from m.facebook.com, mobile.facebook.com or lm.facebook.com is from mobile devices.

But this is not always the case.

First of all, you can access following so called mobile websites directly through desktop:

Go ahead and try it yourself. Once you have visited the website, check the Facebook referrer data. You will see Facebook traffic from mobile websites.

You can also confirm my observation by applying a ‘desktop and tablet traffic’ and ‘mobile traffic’ advanced segment to Facebook referrer data:tablet and desktop traffic

From this data we can conclude that people do access mobile version of Facebook from desktop devices.

One reason could be, some people are forced to use the mobile version of Facebook, when the JavaScript is disabled on their browser.

I concluded that, because Facebook desktop version stopped working, the moment I disabled JavaScript in my browser:

javascript required

Here, reloading the page, won’t solve the problem and I don’t want to log out. So next best thing I can do, is click on the ‘mobile-optimized website’ link and go to the mobile version of the Facebook website from desktop.

It is during this time, I discovered the full url of link shim page.

Whenever JavaScript is disabled, you can see the full URL of a link shim page on mouse over an external link.

 

Facebook traffic can be labelled as direct traffic in Google Analytics

Facebook traffic can end up as direct traffic, esp. if your website is not on HTTPS.

Facebook’s mechanism of passing referrer data from a HTTPS website to a HTTP website is not foolproof and referrer can drop during a redirect from a HTTPS website to a HTTP website.

Whenever a referrer is not passed, the traffic is treated as ‘direct traffic’ by Google Analytics.

Moreover, Facebook is accessed by people using variety of apps (on both desktop and mobile) and not all of these apps (esp.the mobile one) send referrer data.  

Following are the two most effective way to preserve Facebook referral data:

#1 Move your entire website (both desktop and mobile version) to secure connection (HTTPS). Referrer data is more likely to pass from one HTTPS website to another.

#2 Always tag your Facebook ad campaigns.

 

Tracking Facebook ad campaigns in Google Analytics

In order to track the performance of various Facebook ad campaigns in Google Analytics, add following UTM parameters at the end of the destination URL of each Facebook ad:

#1 utm_source – use this parameter to specify traffic source.

For example: utm_source= facebook

Note: utm_source is a required parameter.

#2 utm_medium – use this parameter to specify traffic medium.

For example: utm_medium= social

Note: utm_medium is a required parameter.

#3 utm_content – use this parameter to differentiate various Facebook ads or links that point to the same destination page.

For example: utm_content=ad1

 #4 utm_campaign – use this parameter to specify the name of the Facebook campaign.

For example: utm_campaign= pdf-book-campaign

Note: utm_campaign is a required parameter.

Following is an example of Facebook ad URL which contains UTM parameters:

https://www.optimizesmart.com/book-maths-and-stats-for-web-analytics-conversion-optimization/?utm_source=facebook&utm_medium=social&utm_content=ad1&utm_campaign=pdf-book-campaign

facebook ad utm

Always use Google URL builder to add UTM parameters to the destination URL of your Facebook ads.

Always use Facebook Power Editor to create and manage Facebook ads.

Many people use Facebook boost post to create and publish ads.  While it is easy to create ads via the boost post feature, it lacks many advanced features, like adding UTM parameters to the Ads’ URLs.

Without adding the UTM parameters to the ads’ URLs, you won’t be able to measure the performance of various Facebook ad campaigns in Google Analytics.

 

Tracking Facebook traffic in Google Analytics

In order to track Facebook traffic in Google Analytics, follow the steps below:

Step-1: Navigate to All Traffic report (Acquisition > Source / Medium) in your GA view:

all traffic report

Step-2: Type ‘Facebook’ in the search box on the reporting interface and then press enter. You will then see all of the Facebook traffic:

type facebook

facebook referrals

However this is not the best way to look at the Facebook traffic data every day.

So what I suggest is to create a custom channel grouping just for Facebook.

Follow the steps below:

Step-1: Navigate to the ‘Admin’ of the main view in GA and then click on Channel Settings > Channel Grouping under the ‘view’ section:

channel grouping

Step-2: Click on the ‘New Channel Grouping‘ button:

channel grouping button

Step-3: Create new channel grouping with following configuration:facebook channel

Channel Grouping Name: Facebook Channel

Channel Name: Facebook

Define Rules

Source / Medium contains facebook

Step-4: Navigate to Acquisition> All Traffic > Channels report; select ‘Facebook Channel’ from the drop down menu and then click on the ‘Facebook’ link:

facebook channel2

You can then see all of the Facebook traffic sources:

facebook traffic sources

 

Understanding how Facebook Traffic moves through the checkout process

One of the best ways to analyse Facebook traffic data in Google Analytics, is through filtered view.

If you use filtered view, you will never forget to segment the data and segmenting the data is very important in order to get better understanding of the Facebook traffic.

If you use advanced segment (to filter out Facebook traffic), then you need to consciously remember to use this segment each time, before you begin your analysis. 

Moreover, Google Analytics does not let you apply advanced segments, on Funnel visualization report and multi-channel reports. So you would never know, how Facebook traffic moves through the checkout process or complete a goal conversion.

Create a new view in Google Analytics and apply following filter to it:

facebook filter

This filter will include only the Facebook traffic.

 

Determining top traffic generating web pages shared on Facebook

You can determine top shared web pages (in terms of driving traffic to your website) on Facebook through ‘Network referrals’ report in Google Analytics.

Navigate to Acquisition > Social > Network Referrals in your GA view and then click on the ‘Facebook’ link:

network referrals

You can now see the website usage data of top shared web pages on Facebook:

top shared url

 

Tracking Assisted and last click conversions from Facebook

Facebook, just like any other marketing channel, not only helps in completing conversions but also help in assisting conversions.

So while evaluating its overall performance as a marketing channel, we need to look beyond the last click.

Through ‘social conversions‘ report you can track the overall performance of Facebook by analysing the following metrics:

  1. Assisted Conversions
  2. Assisted Conversion Value
  3. Last Click or Direct Conversions
  4. Last Click or Direct Conversions Value
  5. Assisted / Last Click or Direct Conversions

If you are not sure what these metrics mean, then read this article: Google Analytics Attribution Modeling – Beginners Guide

Navigate to Acquisition > Social > Conversions in your GA view and then look at the data row for Facebook:

facebook assisted conversions

From the report above we can conclude following:

#1 Facebook helped in generating 557 conversions of value $28,233.40 in the last one month.

#2 Facebook directly completed 556 conversions of value $24,890.30 in the last one month.

#3 The assisted / last click or direct conversions is 1. What that means, Facebook is equally good in both assisting conversions and directly completing conversions.

So for Attribution modelling, the  ‘social conversions‘ report in extremely important.

 

Understanding Facebook Users Flow

Through ‘Social Users Flow’ report in Google Analytics, you can determine the paths users took through your website, from Facebook.

Basically, you can determine how users browsed your website, after finding you on Facebook.

This is a good report to understand the behaviour of Facebook users on your website.

Navigate to Acquisition > Social > Users flow in your GA view, click on the Facebook white box and then select ‘View only this segment‘:view only this segment

You can then see the Facebook users flow on your website:

facebook user flow

 

Tracking Facebook ‘likes’ and ‘unlikes’ in Google Analytics

In this article, I will explain tracking only Facebook ‘like’ and ‘unlike’ events in order to keep the article short.

Once you understand how to track ‘like’ and ‘unlike’, you can then easily track other Facebook events like: ‘send’, ‘comment added’ and ‘comment removed’.

Following is the process for tracking Facebook ‘likes’ and ‘unlikes’ in Google Analytics, in a nutshell:

code sequence

Step-1: Install Facebook JavaScript SDK on your website.

Step-2: Add Facebook Social Interactions tracking code on your website. Place this code right below the Facebook Social Interactions tracking code.

Once you have implemented Facebook SDK and social interacting codes and tracked few Facebook social interactions (like Facebook ‘like’), you can then see the data in your GA view by navigating to: Acquisition > Social > Plugins report and then clicking on ‘Social Network and Action’ tab:

facebook like unlike

 

Get the App ID before Installing Facebook JavaScript SDK

You can also track Facebook social interactions in Google Analytics without using Facebook App ID. However I would strongly suggest to get Facebook App ID first, because it has many advantages beyond social interactions tracking.

Through Facebook App ID, Facebook can identify your website, which can later be used for adding open graph protocol data, Facebook authentication, Facebook app analytics etc.

In order to get the Facebook App ID, you first need to create a new Facebook App for your website.

 

Create a new Facebook APP for your website

We are going to create a new Facebook app just to get the app ID, which will later be used in installing Facebook JavaScript SDK on your website and to install various Facebook plugins (like the Facebook ‘like’ button).

Follow the steps below to create a new Facebook APP:

Step-1: Login to your Facebook account.

Step-2: Go to https://developers.facebook.com/apps  and then click on ‘+ Add a New App‘ button:

add a new app button

You will now see a dialog box like the one below:

add a new app for website

Since we are creating Facebook app for website, click on the ‘WWW‘ website icon.

Step-3: Type the name of your new APP and then click on ‘create new Facebook App ID’.

create new facebook app id


Step-4
: Enter your contact email, select ‘Business‘ from the ‘category‘ drop down menu and then click on ‘Create App Id’ button.

create new app id

Note: You need to enter your contact email, so that later you can make your Facebook APP available to the General Public.

You will now see the code for setting up ‘Facebook SDK for JavaScript’:

facebook APP ID

You don’t need to add this code to your website at this time, in order to install Facebook JavaScript SDK. Just pay close attention to the code and look for the unique Facebook APP ID and the special method called window.fbAsyncInit.

Note down your Facebook App ID.

The window.fbAsyncInit method is very important because it calls the FB.init() method.

The method FB.init() is used to initialize and setup the Facebook JavaScript SDK. This is the method which enables Facebook API for you.

 

Step-5: Scroll down the page, enter the URL of your website (in the ‘site URL’ text box) and then click on the ‘next’ button:

about your website

Step-6: Click on the ‘Skip to Developer Dashboard’ link as shown below:

skip to developer dashboard

Step-7: Click on the ‘App Review’ link, found in the left hand navigation menu and then switch the toggle button to ‘Yes’:

make app public

Now your Facebook APP is available to the general public.

 

Link your Facebook App with your existing Facebook Fan Page (Optional)

Note: This is a bonus section. It has nothing to do with tracking Facebook events in Google Analytics. I have added this section to this article because I find it very useful and worth sharing.

Following are the advantages of linking your Facebook App with your existing Facebook Fan Page:

 

#1 Your Facebook Fan Page will turn into a powerful Facebook App Page, which can not only enhance your users’ experience on Facebook but also give you the ability to use Facebook Analytics for apps in addition to Facebook Insight:

facebook analytics app

#2 When a user likes an article on your website, it will show up on the user’s timeline activity, which can then be seen by user’s friends. In this way your article can get additional exposure on Facebook.

 

To link your Facebook App with your existing Facebook Fan Page follow the steps below:

Step-1: Go to your Facebook Fan page, click on the ‘About‘ link.

Step-2: Under the ‘Page Info‘ section, change the category to ‘Brands and Products‘ and sub-category to ‘App Page‘ as shown below:

fan page category

Step-3: Go to https://developers.facebook.com/apps and then click on your app.

Step-4: Click on ‘App Details‘ link as shown below:app details

 

Step-5: Scroll down to ‘Contact Info’ section, click on the ‘Select an existing page‘ drop down menu:

select an existing page

Step-6: select your Facebook fan page and then click on the ‘save changes’ button:

select facebook app page

 

Install Facebook JavaScript SDK on your website

One you have got your Facebook App ID, you now need to install Facebook JavaScript SDK on your website, in order to track Facebook events in Google Analytics.

Follow the steps below:

Step-1:  Go to https://developers.facebook.com/docs/plugins/like-button, enter your Facebook Fan Page URL in the ‘URL to Like’ text box and then click on the ‘Get Code’ button:

facebook like button code

Once you have clicked on the ‘Get Code’ button, you will then see the Facebook Javascript SDK code (which contains your Facebook APP ID) along with Facebook Like and Share button code, as shown below:

select facebook app id


Step-2
: Copy-paste the Facebook JavaScript SDK code, right after the opening <body> tag on each page of your website.

Step-3: Copy-paste the plugin code (Facebook ‘like’ button code), wherever you want the plugin to appear on your website.

Note: You can track only those Facebook actions for which you have installed the right Facebook plugin on your website.

For e.g. if you want to track Facebook ‘send’ event then you first need to install Facebook ‘send’ button on your website. If you want to track Facebook ‘comment’ then you first need to install Facebook ‘comment’ plugin on your website.

In order to learn more about social interactions tracking in general, read this article: Guide to Social Interactions Tracking in Google Analytics

 

Add Facebook App ID to your Facebook SDK code

If the Facebook SDK code is already installed on your website, then you need to find it and add your APP ID to it.

In following cases, the Facebook JavaScript SDK is already installed on your website:

#1 If you are already using a Facebook Plugin (like Facebook Like button) on your website.

#2 If you are using a SEO plugin which let you add Facebook open graph protocol meta data to your website. As soon as you enable the open graph meta data setting, via your plugin, Facebook SDK is automatically installed on your website.

But even if the Facebook SDK is already installed on your website, you should still add your App ID to it.

Since I use the ‘wordpress SEO by Yoast‘ plugin on my website, all I have to do to add the App ID to my Facebook JavaScript SDK code, is to navigate to: WordPress Admin panel > SEO > Social > Facebook and enter my Facebook APP ID: 

facebook app id wordpress

Note (1): Even if you use Google Tag Manager, you still need to copy-paste the Facebook JavaScript SDK code right after the opening <body> tag on each page of your website. This is because Facebook JavaScript SDK code can’t be deployed via GTM.

Note (2): You need to add Facebook JavaScript SDK code only once on your website.

Note (3): You can also track Facebook social interactions in Google Analytics without creating a new Facebook App and without using Facebook App ID. I have used Facebook App ID because it has many advantages, as explained before.

Note (4): You don’t need to add the Facebook JavaScript SDK code every time you install a new Facebook plugin on your website. Though Facebook will ask you to do so.

 

Introduction to Facebook Social Interactions Tracking

Before you can track Facebook likes and Unlikes in Google Analytics, you first need to capture them.

You can capture these events by using a method called FB.Event.subscribe(). This method is used to subscribe to a Facebook event (like liking a page) and to define callback function:

Syntax: FB.Event.subscribe(event, callback)

Here event is the name of event type. It can be:

#1 edge.create – this Facebook event is fired when someone likes the page using Facebook like button

#2 edge.remove – this Facebook event is fired when someone unlikes the page using Facebook like button

#3 message.send – this Facebook event is fired when someone use the Facebook ‘send’ button.

#4 comment.create – this Facebook event is fired when someone posts a comment using Facebook Comments Plugin

#5 comment.remove – this Facebook event is fired when someone deletes a comment in the Facebook Comments Plugin


callBack
is the callback function which is triggered when a Facebook event is fired.

Through callback function, you can send Facebook events to Google Analytics via the ‘send’ command or push Facebook events into GTM data layer.

Following is an example of how you can use the callback function to send Facebook ‘like’ event to Google Analytics via the ‘send’ command:

FB.Event.subscribe(‘edge.create’, function(targetURL){

 ga(‘send’, ‘social’, ‘Facebook’, ‘like’, targetUrl);

});

 

Similarly, you can use the callback function to send Facebook ‘unlike’ event to Google Analytics via the ‘send’ command:

FB.Event.subscribe(‘edge.remove’, function(targetURL){

 ga(‘send’, ‘social’, ‘Facebook’, ‘unlike’, targetUrl);

});

 

Add Facebook Social Interactions tracking code on our website.

At this stage, we now have the new Facebook App ID and we have the Facebook JavaScript SDK and Facebook Social Plugins installed on our website. All we have to do now, is to add the Facebook Social Interactions tracking code on our website.

Copy paste the following code right after your Facebook JavaScript SDK code on each page of your website:

Remember the sequence in which, the various tracking codes will be added to your website:

code sequence

Following is a visual summary of tracking Facebook social interactions tracking in Google Analytics:

tracking facebook likes without gtm

 

Understanding data discrepancy between Facebook and Google Analytics data

#1 Facebook ad Clicks and Google Analytics Sessions are different metrics.

There is always a very strong probability that the number of Facebook ad clicks don’t match with the number of resulting Google Analytics sessions.

This is because Facebook ad ‘clicks’ and Google Analytics ‘sessions’ are fundamentally different metrics.

A click is a hit (user’s interaction) with Facebook ad. Whereas a GA session is a group of hits recorded for a user in a given time period.

On top of that, Facebook track ‘clicks’ whereas Google Analytics track ‘ sessions’.

 

#2 Google Analytics tracking code did not fire on landing pages

Whenever Google Analytics tracking code does not fire for some reason on the landing page of an Facebook ad, Google Analytics does not track session resulted from an ad click but Facebook will still track and report the ad click.

Google Analytics tracking code may not fire under following situations:

#1 the tracking code is not valid

#2 the tracking code is missing

#3 the tracking code is valid but did not fire because of some client/server side issue.

 

#3 Google Analytics is treating some of the Facebook traffic as direct traffic

Lot of people access Facebook via mobile apps. And it is quite common for mobile apps, not to pass referrer data. Whenever the referrer data is not passed, the traffic is treated as direct traffic by Google Analytics.

 

#4 Fundamental difference between Facebook and Google Analytics attribution modelling

Google Analytics attribution modelling is based on single device and single browser. Once a user changes his device/browser, GA treats him as a new user.

This is not the case with Facebook whose attribution modelling is based on multiple devices and multiple browsers. Since you can not use Facebook without login in. It can effectively track users across devices and browsers, thus providing very robust cross device tracking.

Because of this reason , the Facebook sales data reported by Google Analytics may be different from the sales data reported by Facebook. Whenever in doubt, trust the sales data from Facebook, as it is more likely to be correct.

 

#5 Google Analytics data sampling issues

Your Google Analytics data is only as accurate as the amount of traffic data not being sampled. If GA is sampling your data badly, then the reported metrics could be 10 to 80% of the mark.

In that case you can’t trust the data reported by GA and certainly can’t compare it with the Facebook data. Any such comparison, can result in making wrong marketing decisions and even loosing money.


Quick announcement about my new books

maths and stats bottom banner email analytics bottom banner The role of maths and statistics in the world of web analytics is not clear to many marketers and web analysts. Not many talk or write about the usage of statistics and data science in conversion optimization. That is why I have written this book Maths and Stats for Web Analytics and Conversion Optimization to fill this knowledge gap.

If you wish to dramatically reduce your cost per acquisition and increase marketing ROI, you need to become extremely good at tracking the performance of the various KPIs and metrics used for email marketing. My book 'Master the Essentials of Email Marketing Analytics' can help you with that.This book focuses solely on the ‘analytics’ that power your email marketing optimization program.



 

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses in finding and fixing their Google Analytics and conversion issues.
  • More than ten years' experience in SEO, PPC and web analytics
  • Certified web analyst (master level) from MarketMotive.com
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com
I am also the author of the book Maths and Stats for Web Analytics and Conversion Optimization If you have any questions or comments please contact me