Talk to one of our Senior Strategists
Send us a message, and we’ll get back to you shortly.
Join us on Thursday, December 5th, at 12:00 PM (GMT +2) to gain a deeper understanding of GTM server-side tagging. Read more.
We’ve recently come across lots of digital marketers scratching their heads and asking:
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.)
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.
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’t necessarily mean that you website is malicious or spammy.
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.
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.
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.
It’s a link shim referral generated by Facebook.
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.
It’s also a link shim referral and it has exactly the same purpose as l.facebook.com. It just indicates mobile traffic.
This referral shows traffic that has come from mobile devices. The regular one “facebook.com” indicates traffic from desktop devices.
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:
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.
Here are some of the Facebook referrals that you should consider combining:
P.S. Only Google Analytics users who have Edit permission at the account level can:
If you have Edit permission at the view level, you can 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.
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
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.
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.
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:
Feel free 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.👇
3 Comments.
Greetings! Very useful advice within this article!
It is the little changes that will make the biggest changes.
Thanks for sharing!
That’s great. Thanks!
[…] https://holini.com/m-lm-l-facebook-com-referrals/ […]