Social Traffic Sources Fixed with Google Analytics Filters

See how to implement filters and channel grouping settings to clean up messy social traffic sources.

Social Traffic Sources Fixed with Google Analytics Filters

Have you seen reports from Google Analytics with messy social sources that look something like this:

Source URLs from Pinterest:

pinterest sources in GA

Source URLs from Instagram:

instagram sources in GA

Source URLs from Facebook:

facebook sources in GA

Or even traffic from Facebook, Instagram, or Pinterest lumped into your (Other) Channel?

You’re not alone!

While not the end of the world, it can cause some annoyance for your dashboards if you’re pivoting off of Source / Medium, Source, or don’t have your have your Channel Groupings setup to capture these variations.

This how-to guide includes a few quick updates in Google Analytics to fix your social traffic source attribution by:

  1. Implementing search & replace filters in GA to combine these into single source rows
  2. Modifying your Channel Grouping Settings to catch these multiple URLs

Pinterest Filter

In Google Analytics > Admin > Account (or View) > Filters > Create New Filter >

  • Filter Type: Custom > Search & Replace
  • Filter Field: Campaign Source
  • Search String: ^.*\.pinterest\..*|^pinterest\..*
  • Replace String: pinterest

Then click Verify Filter and you should see something like this (assuming you have traffic from Pinterest 🙂 ):

pinterest verify filter

If all looks good then click Save!

Instagram Filter

In Google Analytics > Admin > Account (or View) > Filters > Create New Filter >

  • Filter Type: Custom > Search & Replace
  • Filter Field: Campaign Source
  • Search String: ^.*instagram\.com$
  • Replace String: instagram

Click Verify Filter to see this:

instagram search and replace filter

Facebook Filter

In Google Analytics > Admin > Account (or View) > Filters > Create New Filter >

  • Filter Type: Custom > Search & Replace
  • Filter Field: Campaign Source
  • Search String: ^.*facebook\.com$
  • Replace String: facebook

Click Verify Filter one more time and you should see the same type of confirmation as the examples above.

Common Questions

You might be thinking that keeping sources like m.facebook vs facebook can help differentiate from mobile vs desktop visits – which is valid – however if you want to break this down then you can do so via secondary dimensions:

source-secondary-dimensionAlso, it’s important to note that these filters are not retroactive. They will only clean data up going forward 🙁 .

Modify Social Channel Grouping Settings

If you prefer to live in the Acquisition > Channel Grouping reports then you might need to tweak your Channel Grouping settings to give you the attribution breakdown you’re expecting.

This is especially true if you have unexpected traffic that is grouped into the (Other) Channel Grouping within your reports (see how to fix (Other) channel traffic in this related guide).  And what’s worse – you click into the (Other) group and you see traffic sources from Facebook, Instagram, etc!


If this sounds familiar then you probably have a channel grouping settings issue.

In GA > Admin > View > Channel Settings > Channel Grouping you should see your own Default Channel Grouping settings which will look something like this:

default channel grouping

Your Social Group (#6 from image above) should look like this:

social channel grouping If you are overriding the campaign source/medium on your links embedded within various social channels then you might need to add an “OR” rule that looks like this:

custom social grouping

The pipe symbol (“|”) is the regex symbol of OR.

So Facebook OR Instagram OR Pinterest etc. (here’s a great guide on regex for GA)

Bonus: If you prefer to break out Paid Social from Social (non-paid) then you can define another Channel called Paid Social with the rules below which will catch your paid links first (if you use “paid” in the campaign medium URL):

Paid social channel group

In this example, if visits have Source = facebook and Medium = social then they will not match this channel and will fall into your “Social” channel.


Unfortunately we can’t control referral hostname URLs from the plethora of social sites driving traffic to our sites. But we can unify these via the powerful filtering capabilities of Google Analytics.

The example filters above can be applied to any other traffic sources where you encounter this problem.

Be sure to always test these on test view in Google Analytics first so you don’t corrupt your production data!

If you’re interested in other ways to clean up channel and campaign reporting, read this guide on how to use GTM lookup table variables to automate campaign tagging for you.

More Analytics Tips

Sign up to be notified when we release more helpful analytics & eCommerce tips.

We respect your inbox.

Get Exclusive Elevar Insights directly to your inbox.

Get free analytics tips and resources delivered directly to your inbox.

Shopify Tagging Experts

Learn how Elevar helps Shopify brands scale with expert server side tagging.

Learn More

Brad Redding

Brad, Founder of Elevar, has lived in eCommerce for nearly 15 years. Today Elevar helps thousands of eCommerce brands like Rothys, Vuori, Cuts Clothing, and Vessi maximize the value of their onsite data collection. He specializes in data analytics and conversion optimization to help brands exceed their business goals.

  1. Thanks for the detailed explanations, we can see more clearly in the sources of traffic of Google Analytics with this trick, a pity that it is not retroactive.

  2. Thanks Brad, The Pinterest filter is useful for sure.

    I have a question for you if you don’t mind,

    For drilling down into Pinterest “Campaign Source” and looking at the “Campaign Referral Path” data to display individual Pinterest Pin URL’s bringing traffic.

    You will notice that URL’s for the Pinterest Pin’s
    “Referral Path” are duplicated upon arrival depending on where the click came from on Pinterest.

    I often see many duplicate URL’s ending with and without “/”


    To clarify both these URL’s report differing “User” volumes and information depending on where your pin was clicked on the Platform.

    My question is how would you go about consolidating these rows of data using custom filters in Google Analytics to allow row data such as “Users” & “Bounce Rate” etc to be combined totals for the Pinterest “Refferal Path” URL ending with no “/” ?

    Thanks again,

    1. Hi Mark – thank you for the comment! It’s a common issue that you’re experiencing and usually something you can’t control from inbound links. But what you can do is implement a custom filter in GA to add a trailing slash into your GA reports so you don’t have these mixed rows. I have an article on how to fix this circumstance here –

      That should do the trick – let me know if I can help with anything else!

  3. Absolutely great content, it helped me so much! I want to contribute with filters for Twitter and LinkedIn, using your model. I am no expert in RegEx, so please correct me if I’m wrong and feel free to add them in the article if you wish so.



  4. Thanks for this great article!

    The formula doesn’t combine source such as & facebook together. Is there maybe a fix in the formula for it ?

  5. Thanks for this, those m.facebook and so on were messing my reporting dashboards. This saved me a lot of time

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Articles