Tracking social networks with Google Analytics using filters
GA Hacks, GA specific November 3rd, 2008
This is not really a hack - rather the application of a simple (yet powerful) filter that allows you to compare visits from social networks side by side next to other referral mediums. The result allows you to have a quick comparison of the significance of social networks to your site in your Google Analytics reports, rather than having to drill down into each referrer. For example:
Background on social networks and user generated content
(taken from a recent Bowen & Craggs presentation)
Social networks have exploded on the Internet. The vast numbers of people now participating in them has resulted in a huge influence over brand perception. Hence their importance when considering your digital strategy. Some companies such as Dell*, Harley Davison and Starbucks, to name a few, use social networks as a direct feedback mechanism to actively drive their on and offline marketing strategies.
Key facts:
- There are an estimated 250 million internet users on a social network, from zero 5 years ago.
- MySpace alone claims over 200 million registered users, more than the population of Brazil or Russia. For Myspace in the US, think Facebook and Bebo in the UK, Orkut in Brazil and India, CyWorld in Korea, Mixi in Japan, Lunarstorm in Sweden and so on.
- Around 120,000 blogs are created each day - that’s blogs, not posts!
- In a mid-2007 IBM survey of online adults (aged 18+), the percentage of people claiming to have contributed to a user-generated content site was 9% in Germany, Australia and the UK; 7% in the US and 4% in Japan.
- Of those who contributed content, 58% did so for recognition and community, not monetary gain.
- 6 hours of video are uploaded to YouTube every minute - it would take you a whole year to view one day on uploaded content.
*The Dell Hell story that started with Jeff Jarvis in 2005 is now part of Internet history. It first starts as a story of how bad customer service was with a computer manufacturer, but then becomes a success story as Dell first listened to what was being said about them on the web, and then acted with huge investment. Not only did they invest to correct the problem (poor customer service) but they also invested in bringing the voice of their customers closer to the company by setting up their own social networks around Dell products.
So social networks are important - how do we track them?
In Google Analytics, all visits that originate from a social network are tracked - just like any other referral to your site. That is, if someone writes about you on a site such as Facebook or LinkedIn and creates a link to your web site that others click on, you will see this traffic and its associated source in your Traffic Sources > Referral reports.
Its tracked by default - so why the fuss?
The dichotomy here is that visits from the plethora of social network sites are grouped together with the plethora of visits from all the other referral links to your site. You literally cannot see the wood for the trees as this screenshot shows.

Even for this relatively small site, there are more than 194 referrers with
visits from social networks mixed in.
Applying the social networks filter
I use the following regular expression to match social networks that are relevant to me:
wikipedia|stumbleupon|netvibes|groups\.google|bloglines|groups\.yahoo\.com|linkedin|facebook|webmasterworld|del\.icio\.us|digg|feedburner|twitter|technorati|blog|faves\.com|wordpress|newsgator|PRweb|e-consultancy|toprankblog|forums\.searchenginewatch
Note the use of the “|” character for the logic OR operation i.e. match textA OR textB OR textC etc. You will want to build your own regular expression list around the networks that are important to you. Note, Google Analytics has a limit of 255 characters in its filter pattern matching field.
Applying the above in the Google Analytics Filter Manager is shown below:

This filter simply re-labels the medium associated with visits from my list of social networks from “refrerral” to “social network” - you can use any naming convention you wish.
The result is a report that aggregates all visits from your social network in a similar way to how organic visitors or Google AdWords visitors are automatically aggregated by default. It provides an at-a-glance view to ascertain the importance/activity of social networks to you. In this case, visits from social networks are clearly important - the third most important medium accounting for 17.65% of visits to this site. Without the filter, that would be difficult to ascertain, requiring the manual identification and counting of each social network referral. As always, you gain further detail by clicking the report link.
Update: If you are a blogger, another hack to help you analyse your social network visitors is the Social Media Metrics Grease Monkey plugin from the guys at VKI Studios in Canada. It allows you to include the Digg count of a page right within your Google Analytics reports with new social networks continuously being added (StumbleUpon, Del.icio.us etc.)
Are you doing anything clever with Google Analytics filters? Please share your experiences with a comment.
Email This Post
Print This Post



November 4th, 2008 at 5:06 pm
Hi Brian,
Thanks. That’s a really useful one to know. Will try out asap.
Nikki
November 4th, 2008 at 9:21 pm
Social networks are our primary focus, this is a GREAT idea and we will implement asap.
all the best,
sandy
Megastarmedia.com
November 5th, 2008 at 7:18 pm
Hi Brian, why did you do this with a filter and not with an advanced segment?
November 5th, 2008 at 7:24 pm
Joost: yes you can do something similar now with the Advanced Segments feature that is in beta.
The main difference is that Advanced Segments are on a per GA user basis, where as the filter is set on a per profile basis.
November 5th, 2008 at 7:49 pm
Added bonus of using segments is that you can compare them in one screen.
November 11th, 2008 at 2:25 pm
Very very useful and, as far as I can tell, not available in other analytics solutions, at least not in the side by side way. Rocks. Thanks.
November 21st, 2008 at 10:43 am
@Brian: The fact, that the segments only apply to the user account and not to a profile is really a missing feature in my view.
November 25th, 2008 at 10:55 am
Great tip! I tried it out right away using your regular expression to set up an Advanced Segment.
November 26th, 2008 at 2:00 pm
Excellent tip Brian. This is the first time I enter your blog but certainly it won’t be the last.
Thanks
November 26th, 2008 at 5:02 pm
Not bad Brian. I guess is a great way to have an eye of the evolution of these kind of sites more than to trust the accuracy of the concept it self.
I will definitely try it. Thanks!