Track Facebook, Twitter & Social Networks in Google Analytics – Social Network Marketing Analytics

A cornerstone of any organization's overall social marketing strategy should be reliable web analytics – that is, accurate tracking of traffic coming from networking sites on which you're conducting marketing efforts. This will enable you to slice and dice statistics for those visitors, and hopefully align those numbers with your marketing goals!

Google Analytics will automatically track referrals from other websites, including Facebook, LinkedIn, and other networking sites. In your Traffic Source reports, you'll see your social network visits grouped under referrals from that site – sources like LinkedIn or stumbleupon. However, these sites are grouped in with all other referring traffic! What if you want to track statistics for incoming traffic from ALL social network sites? It'll be hard to do that if you have to sift through all your other referral traffic.

Grouping Social Network Traffic in Google Analytics

Google naturally defines traffic as being organic, direct, referral, etc – so what we're doing here is telling Analytics to place certain sites within a certain category, or "medium." Chances are, this is how your Traffic Medium report looks right now if you have not applied any custom filters – visits are grouped by 3 or 4 mediums. Organic traffic covers non-paid visits from search engines, (none) means direct traffic (IE, a visitor typed in your website's URL straight into their browser), and all your social networks are grouped under referral traffic.

We want a separate category for those sites though! Using a filter, we can tell Analytics to remove specific sites from the "referral" classification and group them under a new medium.

(Note: This technique involves creating a filter. Create a duplicate profile before proceeding – any mistakes can screw up your historical data. We'll install the filter on the new, duplicate profile.)

Once you've got the profile set up, click "Filter Manager" from the Overview Screen (the one that lists all your profiles), then "Add Filter".

Name your filter something descriptive, then select "Custom Filter" from the Filter Type drop down box. We are advanced analytics ninjas, so select the "Advanced" button and configure the filter like so:

Field A -> Extract A

In the first drop-down, select "Campaign Source". In the second field, you'll be entering which sites you'd like Analytics to automatically group into your new social networks category. For best results here, we're going to be using the Regular Expression character (directly below your Backspace key), which means "or" – this allows us to select multiple domains that traffic would be coming from. If, for example, you wanted all your referral traffic from Stumbleupon, Facebook, Twitter and EzineArticles to appear in this new, social-media-only category, you'd enter "stumbleupon | facebook | twitter | ezinearticles" (without the quotes) into this field. Adjust this to fit your needs.

Field B -> Extract B

These fields will be empty: in the first drop-down, select "-". Nothing in the second field.

Output To -> Constructor

In the first drop-down, select "Campaign Medium". In the second, enter the name of your new category – this can be anything you want, but make it simple and descriptive. "Social" is always a good choice!

Radio Buttons

Field A Required: Yes

Field B Required: No

Override Output Field: Yes

Case Sensitive: No

You're done! After you've applied the filter, you should see a spiffy little line in your Traffic Medium report – in this example, "social" would show up, and by clicking on it, all your visits from Stumbleupon, EzineArticles, Twitter, and Facebook are in one, social-media-only category, separate from your Google Image referrals (man, that's a lot of cat pictures).

Now all your metrics in this category will accurately reflect social-media-sourced visitors only, without all your other referrals skewing the data. Analyze away!