Analytics

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

Brad Redding

Brad Redding is the Founder & CEO of Elevar. Specializing in analytics, tracking, GTM, and conversion optimization.

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!

More Analytics Tips

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

We respect your inbox.

  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 “/”

    Example:
    /pin/355925176784714370
    /pin/355925176784714370/

    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 – https://www.getelevar.com/how-to/fix-duplicate-url-google-analytics/

      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.

    Twitter:
    ^.*twitter\.com$|^.*t\.co$|^.*tweetdeck$|^.*com\.twitter\.android$

    LinkedIn:
    ^.*linkedin\.com$|^.*linkedin$|^.*com\.linkedin\.android$

  4. Thanks for this great article!

    The formula doesn’t combine source such as facebook.com & 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

  6. has this functionality been removed on UA? i don’t seem to be able to get the find-replace to execute, when verifying, the data is correct, but then in the view it reverts to m. l. and lm. ?

  7. Новинки фільми, серіали, мультфільми 2021 року, які вже вийшли Ви можете дивитися українською на нашому сайті Link

  8. Новинки фільми, серіали, мультфільми 2021 року, які вже вийшли Ви можете дивитися українською на нашому сайті Link

  9. Нові сучасні фільми дивитися українською мовою онлайн
    в хорошій якості HD Link

  10. Новинки фільми, серіали, мультфільми 2021 року, які
    вже вийшли Ви можете дивитися українською на нашому сайті Link

  11. Новинки фільми, серіали, мультфільми 2021 року, які вже
    вийшли Ви можете дивитися українською на нашому сайті Link

Leave a Reply

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

You may also like