Analytics Expert. Passionate about SEO and User Experience or what he calls UX-SEO

Follow me on

Facebook referrals: lm.facebook, l.facebook and m.facebook,,

If you use Facebook to drive traffic to your site you probably came across to one or more of the following referrals:

  • / referral
  • / referral
  • / referral
  • / referral
  • / referral
  • web.facebook / referral

This post will help you understand the differences between them and most importantly how to combine them for better reporting.

What is the meaning of the letters in the referrals (.l .lm .m)

First let's explain the more simple and , the only difference between these 2 is the device used by the visitor, as you probably already know. The referral preceding by an m. comes from mobile devices, while the other come from a desktop/laptop computer. That one was easy.

In some occasions, you may see them as or

Now the other two referrals are the same but with a letter l at the beginning. This letter means that the user passed through a Link Shim before arriving at your site.

What is a Link Shim?

Link shim is a measure introduced by Facebook in 2008 and has two objectives:

  • Protect the privacy of the user by removing any personal information in the referrer (URL) like IDs or usernames. This way facebook still let you know the user is coming from their site without giving sensitive information
  • Protecting the user from Malicious Sites, facebook checks every link and if it finds it on their list of dangerous sites the user will see a message warning him that he will be redirected to a site flagged as malicious, the user can continue or cancel the action.

Now, don't worry, if you see the l. or lm. in the referral, most likely will be because of the first reason. 

In case you want to make sure you are not flagged, just open one of your links from Facebook, if you don't see any warning then it's ok.

However, all the extra information about this referrals is not needed, so I'll show you how to fix this.

How to combine the Facebook referrals for better reporting?

This extra information is not useful for your analytics, and it just splits the data. You don't see other referrals (Twitter, LinkedIn, etc) splitting the visits.

You don't even need to differentiate the desktop ( and mobile (m.facebook), you don't see other sources split like this, Google Analytics has other more convenient ways of showing this.

Combine, and referrals Google Analytics

So to avoid this you can create a simple filter search and replace to combine them. You have to options:

A. Combine all six referrals to one (Recommended): All your Facebook referrals ( and will all show as in your reports.

B. Combine facebook referrals by device: If for some reason you want to keep the mobile and desktop version separated (although there are other better ways to do differentiate devices in GA) 

  • Referral 1: and to
  • Referral 2: and to

Note: Before proceeding, I highly recommend you to create an unfiltered view if you haven't done it. This is a best practice that every analytics user should follow.

A. How to create a search and replace filter to unify All Facebook referrals

All Facebook referrals in one:

  1. Go to the admin section of your Google Analytics, click filters under the View Column.
  2. Click the red button +Add filters and enter "Unify Facebook Referrals" as a name.
  3. Select Filter Type Custom and select Search and Replace
  4. Configure the filter as following
    • Filter Field find and select:  Campaign Source
    • Search String enter: .*facebook
    • Replace String enter: facebook

    If you click the verify button, you will get a quick glance of how the filter will work.

    unify and Google Analytics

    Note: You may get the message "This filter would not have changed your data" don't worry the filter will still work, this happens when there is no match in the small sample data used by this feature.

  5.  After configuring your filter, click Save

Second option facebook referrals by device:

B. How to create a filter to unify Facebook referrals by device

Split mobile and desktop Facebook referrals:

You will need two filters for this. Follow the same steps above, and adjust the filter configuration for each filter like this:

  1. Filter name: "Unify Desktop Facebook Referrals."
    • Filter Field find and select: Campaign Source
    • Search String enter: ^l\.facebook|^web\.facebook
    • Replace String enter: facebook
  2. Filter name: "Unify Mobile Facebook Referrals."
    • Filter Field find and select: Campaign Source
    • Search String enter: ^m\.facebook|^mobile\.facebook
    • Replace String enter: m.facebook

That's it now your Facebook referrals will be better reported and your data won't be split.

Wrapping it up

Most of the time you will see your referrals with only one name (like Twitter or LinkedIn).

In Facebook case, you can find up to 6 different referrals (,,,,, and web.facebook). This extra information will only split your data and make it more difficult to analyze.

To avoid this, you can combine these referrals and get better reports from Facebook.


Analytics Expert. Passionate about SEO and User Experience or what he calls UX-SEO

Follow me on
Be the first to comment :)