Tracking Social Media with Web Analytics
02/08/2011 | Written by | Categories: Analytics Set-up

Image of a Social Sharing button

Social Media has developed into the next big thing in online over the past couple of years and that means it needs to be measured.  Specific tools have been and are being developed to understand where/how/what people are saying about your brands across the internet.  But web analytic tools should be used to understand social media interactions on your own website.

This post will detail four specific areas for understanding social media using web analytics tools such as Google Analytics, Omniture SiteCatalyst or WebTrends.  Examples provided will be for Google Analytics but the same approach can be used with any tool.

Identifying traffic from your social media activity

A key element in a social media strategy is sharing links to your website across social media networks.  These links should be treated like any other marketing campaign (e.g. paid search, email, display) and include web analytics campaign parameters to identify the traffic.

This requires adding one or more URL query parameters to the landing page URL that you are using.  The number and names of these query parameters varies by web analytics tool.  Traffic that clicks through on these links is identified within your web analytics tool and can be analysed to understand impact on business performance, however that is defined.  Insights can be extracted to understand the most popular/high quality network, topic and even the person who shared the content.

For Google Analytics, I recommend using these definitions for the campaign parameters:

  • Medium – social media campaigns
  • Source –  network e.g. twitter, facebook
  • Campaign – topic e.g. blog post, news article, competition, customer service
  • Content – name e.g. Peter O’Neill

This would generate a URL for this blog post of’neill&utm_campaign=blog%2bpost

Links can be generated using the Google Analytics URL Builder or using an Excel tool such as the one I have created.  The links should be shortened using your preferred shortening tool before being shared.

Download Google Analytics Social Media URL Builder

Tracking use of social media sharing buttons

Various Social Media buttonsButtons to share content on social media networks can be found on blog posts, news article and information pages across the internet these days.  Tracking clicks on these buttons can provide insights into what content is most interesting/useful to visitors, not just which content was able to attract the most traffic.

Google Analytics recently released specific code to capture these clicks but equivalent custom variables can be used in other web analytics tools.  For Omniture SiteCatalyst, I would recommend a s.Prop which records a unique code per button and then expand using SAINT classifications.

The GA code is called Social Engagement and more details can be found by clicking through on the image below.  It is automatically integrated with Google+ but needs to be added to any other social sharing buttons.  I am hoping that the people who develop these plugins are busily working away, adding code so that the GA event measurement is automatically generated and dynamically populated.

Google Analytics Social Engagement Code

Identifying traffic generated from social media sharing buttons

So you are now tracking the clicks by visitors to share links on social media networks but are these links generating any traffic for your website.  Campaign parameters can be applied to the links generated in exactly the same way as is done for links that you create yourself.  It just requires adding some code to dynamically insert the campaign parameters when the links are generated.

The naming convention if you use GA should look fairly familiar

  • Medium – social media sharing
  • Source –  network e.g. twitter, facebook
  • Campaign – topic e.g. blog post, news article, competition, customer service
  • Content – type of button e.g. tweet, facebook share, facebook like

So clicking to Tweet this blog post should generate a URL on twitter of

Identifying other social media traffic

That’s two social media traffic sources identified, links that you generate yourself and links that people generate through clicking on a social media sharing button.  But you can still get traffic through to your website from social media websites from links that other people choose to share.  Based on the referring domains, this traffic can also be identified and grouped accordingly.

In Google Analytics, create a profile filter that renames the medium for all visits with a medium of referral and a source that matches social network domains (via a regular expression) e.g. twitter|facebook|linkedin|youtube|digg.  In Omniture SiteCatalyst, define this channel in Marketing Channels using the exact same approach, just listing out all the networks.

Google Analytics profile filter for identifying untagged traffic from Social Media Websites

Note that a visitor who clicks through to your website from an untagged link within a social media application such as Tweetdeck is likely to be recorded as a Direct Entry visit as described on the blog.

The end result

Setting up your web analytics in this way will give you three new channels in your traffic source report providing much greater insights into what is driving traffic to your website and how that traffic is performing.

  • Social Media Campaigns
  • Social Media Sharing
  • Social Media Websites

This traffic data will be complemented by information on whether sharing buttons are being used on your website and to what extent.  I admit that I am only partially there myself with implementing all this tracking myself due to a lack of technical skills.  But it is what needs to be done for an understanding of how content is being consumed and shared.

4 responses to “Tracking Social Media with Web Analytics”

  1. The importance of those adding those tags is absolutely critical, as the article you link to from makes clear. Without them a frightening number of those visits will be reported as direct.

    But the problem remains that we can only ever tag actual campaigns where we post the links ourselves.

    It seems reasonable to suggest that unsolicited links posted by normal visitors to the site will carry even more weight with their friends and followers. That’s certainly the argument which vendors of product review systems advance with as much backup research as they can muster. And it’s one that makes sense.

    So these unsolicited links may well be the most valuable benefit of sharing and yet we can only record the ones which carry referral information which is a small proportion (30% in my own test).

    It’s a big problem. Relying on tags and referral information only tells a part of the story.

    There’s another excellent post on this subject from Thomas Baekdal here:

    • Peter O'Neill says:

      I agree, we are never going to be able to get all the information. Adding campaign code to links generated from sharing buttons will help but we need the social network app developers to include some hint as to where untagged traffic is coming from to get a more complete picture. In the meantime, need to just work with what we have got.

      Another option is to create a segment for for visits that are reported as Direct Entry but land outside the homepage. It is likely these are referred from elsewhere and up to your business if you can assume these are from Social Media. Thanks for the comment Tim

  2. Johann de Boer says:

    Hey Peter, thanks for writing this article, it’s really helped me in understanding the approaches needed and hurdles to overcome. I greatly appreciate it.

Leave a Reply

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

Looking to improve your digital analytics or conversion rate optimisation?
Contact us today on +44 (0)20 7148 5970

Alternatively, come visit us in London and we’ll buy the coffee!
Get in touch
Leave us a message
Use the form below to leave us a message.

Lindsey Street