Unfortunately in default Google Analytics setup, traffic source from social media are fragmented, i.e. one source is spitted into several rows. This makes it hard to analyze the sources efficiency.

Fortunately it is easy to fix this with the following Google Analytics filters. These filters merge all the rows of one social network. Additionally, you can change the Medium from referral to social to make the Medium more meaningful.

Merge Facebook Referrals

  • Filter type: Search and Replace
  • Filter field: Campaign Source
  • Search String: (^.+\.|^)facebook\.com$
  • Replace String:  facebook.com

Merge Instagram Referrals

  • Filter type: Search and Replace
  • Filter field: Campaign Source
  • Search String: (^.+\.|^)instagram\.com$
  • Replace String:  instagram.com

Merge Twitter Referrals

  • Filter type: Search and Replace
  • Filter field: Campaign Source
  • Search String: (^.+\.|^)twitter\.com$|^t.co$
  • Replace String:  twitter.com

Merge Pinterest Referrals

  • Filter type: Search and Replace
  • Filter field: Campaign Source
  • Search String: (^.+\.|^)pinterest\.com$
  • Replace String:  pinterest.com

Rewrite Medium to Social for Social Referrals

  • Filter type: Advanced
  • Field A -> Extract A
    • Campaign Source: youtube|stumbleupon|netvibes|groups\.google|weebly\.com|groups\.yahoo|linkedin\.com| lnkd\.in|facebook\.com|twitter\.com|instagram\.com|pinterest\.com
  • Field B -> Extract B
    • Campaign Medium: referral
  • Output To -> Constructor
    • Campaign Medium: social
  • Checked:
    • Field A Required
    • Field B Required
    • Override Output Field