Google Analytics
Taavi Kalvi
We’ve recently come across lots of digital marketers scratching their heads and asking:
- Why am I seeing all these unconventional Facebook referrals (lm.facebook.com, l.facebook.com, m.facebook.com, web.facebook.com etc.) in Google Analytics?
- Why are they split across different rows in our Google Analytics reports?
- How can I combine all Facebook referrals in one for better reporting?
![How to Fix m/lm/l.facebook.com in Google Analytics (2) How to Fix m/lm/l.facebook.com in Google Analytics (2)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/1-l.facebook.com-and-lm.facebook.com-referrals.png)
This article will show you exactly what’s hidden behind these mysterious Facebook referrals and what can be done to avoid having your Facebook data split across several rows in your reports (how to fix m/lm/l.facebook.com in Google Analytics.)
![How to Fix m/lm/l.facebook.com in Google Analytics (3) How to Fix m/lm/l.facebook.com in Google Analytics (3)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/you-need-to-fix-this.gif)
Contents
- What’s hidden behind these baffling Facebook referrals?
a) What is l.facebook.com / referral in Google Analytics?
b) What is lm.facebook.com / referral in Google Analytics?
c) What is m.facebook.com / referral in Google Analytics? - Is it worth combining all those Facebook referrals together?
- How to combine all these mysterious Facebook referrals in one?
1. What’s hidden behind these baffling Facebook referrals?
Facebook’s primary goal is to protect its users from malicious and spammy content and that’s why they have built a powerful tool called the Link Shim.
l.facebook.com and lm.facebook.com are called Link Shim referrals. Their presence in Google Analytics indicates that your website was evaluated favourably by the Link Shim system developed by Facebook.
Every time a link is clicked on the site, the link shim system will check that URL against a huge internal database of malicious links.
If the system detects that the link you’ve clicked on is malicious, it redirects you to an interstitial page that warns you and gives you an option to return to Facebook.
![How to Fix m/lm/l.facebook.com in Google Analytics (4) How to Fix m/lm/l.facebook.com in Google Analytics (4)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/2-facebook-link-shim.png)
If everything is fine with the website you’re planning to visit, you’ll be automatically redirected from an interstitial page to the final URL.
Keep in mind, every user who clicks on an external link on Facebook, is temporarily redirected to a link shim page, before being sent to the final URL. This is because Facebook needs to rewrite referrer data for security reasons.
P.S. If you see lots of different referrals (l.facebook.com, lm.facebook.com, m.facebook.com etc) in your reports, it doesn’tnecessarily mean that you website is malicious or spammy.
There’s a number of reasons for this link shim interstitial page being served:
1. Facebook wants to keep you away from malicious websites
Like mentioned before, Facebook is able to run a check at the time of a click (i.e. when a user clicks on an external link) and if they detect a malicious website, they will give you a warning.
It prevents us from seeing malicious or spammy content and that’s great.
2. Facebook wants to protect its users’ privacy and identity
Facebook wants to hide personally identifiable information (PII) from third party websites and the link shim tool is used to rewrite Facebook referrers.
For example, it removes usernames from referrer URLs, before web browsers send you to external websites so that your 3rd party analytics tools (Google Analytics for example) are not able to reveal who it is that clicked on the link (meaning the owner of the 3rd party website will not know your name when you click on their link).
Businesses often use Google Analytics UTM parameters to track the performance of different marketing campaigns.
3. Facebook wants to make your external analytics tools more accurate
By default, HTTPS websites do not send referrer data to HTTP (non-HTTPS) websites due to security reasons. If someone navigates from a HTTPS website to your HTTP website, the browser doesn’t send a referrer header (the document.referrer will be empty). This means that you’ll see that he/she came to your site directly (you’ll see direct / none in Google Analytics).
It was a problem for Facebook because there was a huge number of users using the platform over HTTPS and lots of 3rd party analytics tools were not able to correctly record traffic coming from Facebook.
Facebook solved this problem by routing the click through the link shim page that is a non-HTTPS page. Users will stay on the temporary link shim page a few milliseconds before being redirected to the desired web page. This is why you see an anonymous Facebook referrer rather than a referrer from an unknown source (direct / none) in Google Analytics.
a) What is l.facebook.com / referral in Google Analytics?
It’s a link shim referral generated by Facebook.
![How to Fix m/lm/l.facebook.com in Google Analytics (5) How to Fix m/lm/l.facebook.com in Google Analytics (5)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/3-l.facebook.com_.png)
Facebook is not consistent with the naming conventions of its referral data and that’s why we’re seeing this l.facebook.com referral source in our Google Analytics reports. Technically, all the traffic from l.facebook.com, lm.facebook.com, facebook.com and m.facebook.com is the same – it’s all Facebook traffic. The prefixes l. ; lm. ; m just indicate different devices (desktop and mobile).
P.S. Again, these prefixes are added to the referral in Analytics because every user who clicks on an external link on Facebook, is temporarily redirected to a link shim page, before being sent to the Final URL.
b) What is lm.facebook.com / referral in Google Analytics?
It’s also a link shim referral and it has exactly the same purpose as l.facebook.com. It just indicates mobile traffic.
![How to Fix m/lm/l.facebook.com in Google Analytics (6) How to Fix m/lm/l.facebook.com in Google Analytics (6)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/4-lm.facebook.com_.png)
c) What is m.facebook.com / referral in Google Analytics?
This referral shows traffic that has come from mobile devices. The regular one “facebook.com” indicates traffic from desktop devices.
![How to Fix m/lm/l.facebook.com in Google Analytics (7) How to Fix m/lm/l.facebook.com in Google Analytics (7)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/5-m.facebook.com_.png)
2. Is it worth combining all Facebook referrals?
Yes, if you’d like to make it easier to gain valuable insights and you’re tired of seeing Facebook traffic split across multiple rows in Google Analytics.
Here’s how it looks like if you haven’t combined your Facebook referral data:
![How to Fix m/lm/l.facebook.com in Google Analytics (8) How to Fix m/lm/l.facebook.com in Google Analytics (8)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/6-facebook-referrals.png)
Here’s how it looks like if you’ve combined your Facebook referral data:
For analytics purposes, we recommend combining all Facebook referrals together so that you don’t need to use table filters or apply advanced segments to your reports every time to pull insights out of your data.
Keep in mind that if you combine these different sources together, you’re still able to segment your data later however you want (by the device, city, browser etc).
You can also keep one view unfiltered so that if needed you can analyze these separate referrals in the future.
3. How to combine all these mysterious Facebook referrals?
Here are some of the Facebook referrals that you should consider combining:
- m.facebook.com
- mobile.facebook.com
- l.facebook.com
- lm.facebook.com
- web.facebook.com
- touch.facebook.com
Here’s the step-by-step guide on how to combine them all:
1. Open the Admin section in Google Analytics by clicking the gear icon (⚙) in the bottom left corner.
2.Navigate to filters under the “View” column.
3.Create a new filter by clicking the “+Add Filter” button.
P.S. Only Google Analytics users who have Edit permission at the account level can:
- Create/edit filters at the account level
- Create/edit filters at the view level
- Apply filters to any view in the account
If you have Edit permission at the view level, youcan only apply existing filters to or remove them from that view, but cannot create new filters or edit existing filters.
If you don’t have sufficient permissions to apply new filters, get in touch with the person who has an administrator access to your account.
4. Configure a new filter in Google Analytics.
Here’s how your filter settings should look like:
1) Choose the right method: “Create new Filter”
2) Give it a name (make sure you remember the purpose of this filter later)
3)Filter Type: Custom
4) Filter Subtype: Search and Replace
5) Filter Field: Campaign Source
5.Fill in the “Search String” and “Replace String” fields.
1) Search String: ^.*facebook\.com$
2) Replace String: facebook.com
P.S. You can also combine only specific Facebook referrals as well if you want. For example, if you only want to combine lm.facebook.com, l.facebook.com and facebook.com sources together, you can use these strings:
1) Search String: ^(lm|l).facebook.com$
2) Replace String: facebook.com
If you’d like to dive even deeper, you should read more about regular expressions for Google Analytics.
6.If you’d like to see how it works, click the verify button.
This verification system shows you which sources will be combined and how the source will look like in your reports in the future if you apply it.
P.S. Google Analytics filters do not work retroactively on past data already collected in a View. Filters will start working only from the moment they are created and they are not going to change your historical data. You can use segments or table filters in Google Analytics to combine historical data.
7.If you’ve verified that the filter works properly, click the “Save” button.
![How to Fix m/lm/l.facebook.com in Google Analytics (16) How to Fix m/lm/l.facebook.com in Google Analytics (16)](https://i0.wp.com/holini.com/wp-content/uploads/2018/02/i-got-this.gif)
Final Thoughts
We hope this article will save you both time and tons of potential headaches in the future so you don’t have to struggle with those messy Facebook referrals anymore.
Here’s some additional reading on the subject written by Google Analytics specialists:
- lm.facebook.com in GA – What is it? – written by Ali Freezman, Seer Interactive (alumni)
- Understanding Facebook Referral traffic in Google Analytics – written by Himanshu Sharma, Optimize Smart
- Combine m/lm/l.facebook.com Referrals for Better Analytics Reporting – written by Carlos Escalera, carloseo.com
Feelfree to share this guide with your friends as well who might be struggling with the same problem. If you have any questions about the topic, please post them in the comments section below.👇
4 Shares
3 Comments.
Greetings! Very useful advice within this article!
It is the little changes that will make the biggest changes.Thanks for sharing!
Taavi Kalvi
February 21, 2018 1:53 pm
That’s great. Thanks!
November 13, 2019 10:36 pm
[…] https://holini.com/m-lm-l-facebook-com-referrals/ […]