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!

WTH!

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.

Conclusion

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.


Brad Redding

Brad, co-founder of Elevar, has lived in eCommerce for over 12 years. He's helped design, build, and optimize over 100 websites in his career. From new retail startups to well-known brands like Le Creuset, Signature Hardware, Rebecca Minkoff, Char-Broil and more, he specializes in data analytics and conversion optimization to help achieve business goals.

Leave a Reply

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