GA4 & GTM Developer

Optimizer Troubleshooter

Follow me on
Category | Google Analytics
Difficulty |

What is and How to Put it in the Right Place in Analytics

If you use Instagram to drive traffic to your site you probably have seen the referral

  1. / referral
  2. / referral
  3. / referral
  4. / referral referral

This extra information is not useful for your Analytics. This post will help you understand the differences between them and most importantly how to combine them for better reporting. and

These 2 are the most common, the only difference between them 2 is the device used by the visitor, as you probably already know. The referral preceeded 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

What is and are equivalents to the previously mentioned referrals, the letter "L" before just means that the user passed through a Link Shim before arriving at your site.

link shim is a privacy measure that has two purposes:

  1. Protect the privacy of the user by removing any personal information in the referrer (URL) like IDs or usernames.
  2. Protecting the user from Malicious Sites: Instagram checks every for flagged sites and if they detect one it shows a warning to the user so he/she can continue or cancel the action.

Now, don't worry, if you see the l. or lm. in the referral that is very common, and chances are, they are 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 instagram, if you don't see any warning then it's OK.

Need help setting up a robust and reliable Google Analytics reporting for your website/business?

  • Filters for data quality 
  • User interaction tracking (events, goals)
  • E-commerce tracking
  • GDPR compliance
  • Google Tag Manager implementation
  • Integrations (Google Ads, Search Console, etc)
  • Custom reports (Dashboards, Data studio)
  • Monthly reporting and more...

How to Combine Instagram Referrals for Better Reporting?

Now all this extra information is not useful for your analytics, and it just splits the data. For example, you won't see different referrals for Twitter or LinkedIn.

You don't even need to differentiate the desktop ( and mobile (, Google Analytics has other more convenient ways of showing this. and

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

Filters only apply to data from the moment they are created, historical data is not to affected.

You have 2 options:

  1. Combine all Instagram referrals into one (Recommended): All your Instagram referrals will all show as in your reports.
  2. Combine Instagram referrals by device: If for some reason you want to keep the mobile and desktop version separate (although there are other better ways to differentiate devices in GA)
    • Web Referral: and to
    • Mobile Referral: and to

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

A. How to unify All Instagram Referrals

All Instagram referrals into one:

  1. Go to the admin section (gear icon at the bottom left) of your Google Analytics, click Filters under the View Column (Last one).
  2. Click the red button +Add filters and enter "Combine Instagram Referrals" as a name.
  3. Select Filter Type Custom
  4. Select Search and Replace (you might need to scroll a little)combine referrals google analytics
  5. Configure the filter as following
    • Filter Field find and select:  Campaign Source
    • Search String enter: .*instagram
    • Replace String enter: instagram

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

    Instagram referrals combined

    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.

  6.  After configuring your filter, click Save

Second option Instagram referrals by device:

B. Unify Instagram Referrals by Device

Split mobile and desktop Instagram 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: "Combine Desktop Instagram Referrals."
    • Filter Field find and select: Campaign Source
    • Search String enter: ^l\.instagram|^web\.instagram
    • Replace String enter: instagram
  2. Filter name: "Combine Mobile Instagram Referrals."
    • Filter Field find and select: Campaign Source
    • Search String enter: ^m\.instagram|^mobile\.instagram
    • Replace String enter: m.instagram

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

Wrapping it up

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

In Instagram's case, you can find up to multiple different referrals. This extra information will only split your data and make it more difficult to analyze.

To avoid this, you can easily combine them and get better reports from Instagram.

Improve the quality of your Analytics data

Answer the following basic questions:

  1. Do you have filters for ghost, crawler and language spam?
    • If yes, Are those filters efficient? meaning you don't have to create/update them constantly.
  2. Are you blocking good bots and spiders?
  3. Are you filtering development and test environments?
  4. Are you filtering internal traffic (traffic generated by you or your team)?
  5. Do you have a clean segment to remove spam from your historical data?

If any of your answers is "NO," then you probably are getting junk traffic that is corrupting your data.

The following guide will help you set everything your Analytics needs to receive not only clean but also meaningful data! Go to the guide and get your Google Analytics in shape.

Be the first to comment :)