This article was published on April 25, 2011

How to track Social Media within Google Analytics


How to track Social Media within Google Analytics

For all the information and insight Google’s powerful Analytics tools can provide, they’re still only providing some top level figures, primarily Direct, Search and Referral traffic. Think, “Traffic is traffic?” well think again, as more and more marketers and private individuals are drilling deeper to gain a better understanding of what social media actions are resonating well with their communities, and which aren’t.

But how do we separate the social media wheat from the day-to-day chaff? By adding a few Advanced Segment filters to your Google Analytics account, you can easily pinpoint social media interactions, and thus the associated traffic sources for your web property.

Let’s get started…

First and foremost, you’ll need a fully functioning Google Analytics account, meaning, your tracking code is installed correctly, and Google provides the, “All systems are a-go!” message. Once your code is up and running, it’s time to start pulling social media out of those numbers. To do this, we’ll need to set up a Custom Segment.

To set up a custom segment, first navigate to Traffic Sources in the list of available options from the left column. Once highlighted, in the top right corner, just above the date range, click on the drop down labeled “All Visits”. This will toggle the option to bring up the Advanced Segments dialogue. This is the area where we’ll “Create a new advanced segment.”

Once in “Create Advanced Segment,” we’ll now need to define the parameters for our custom filter. That sounds a lot more scientific than it actually is. In barroom speak, what we’re doing here is telling Google Analytics what sources we want specific data for; in this case, social media variables.

Again in the left column, select “Traffic Sources” from the available options. Here you’ll be presented with a number of options, and we’re after the “Source” variable. Select and drag “Source” into the dotted “dimension or metric” box in the work area. Once you’ve done this, you’ll now need to define the Condition and Value of this Source segment. Under the “Condition” dropdown, select “Contains” from the available options. We’ve selected “Contains” in this area, as there are often multiple permutations of a single site, i.e. facebook.com, facebook.com/mobile, etc.

The “Value” field is where we’re specifying exactly which social media channels we want to track. Let’s start off with Facebook by entering facebook.com into the “Value” field. Before adding any more social media sources, let’s go ahead and make sure we’re on the right path. Click “Test Segment” in the top right corner. Analytics will then apply the filter, and should provide you with an exact number of visits from the social media domain. To apply more social media filters, rinse and repeat the process above by clicking “Add ‘or’ statement”. And while there are various lists of social media sites to be had, some top figures should come to mind immediately. Here’s a suggested, but by all means, non-complete, list of social media sites/traffic you’ll most probably want to apply to your social media filters:

  • Facebook
  • LinkedIn
  • Twitter
  • HootSuite
  • TweetDeck
  • StumbleUpon
  • Wikipedia
  • Reddit
  • Digg
  • Flickr
  • YouTube

Naturally, any region specific social networking sites, VKontakte, for example, should also be included in your custom segment filters.

Now that all of your values are entered, click “Test Segment” once again, just to double-check everything is functional. You should see numeric values next to your traffic sources. If you’re seeing a red 0 visits, this simply means that for the specified date range, you’ve received no traffic from the particular social media source. Time to devote more efforts to this channel, or abandon it altogether?

At the very bottom of your filters list, give this segment a name, Social Media, for example, and save.

Apply the Magic!

Now that your Social Media filter has been defined and created, it’s time to apply the magic. Return to your Analytics dashboard, and repeat the process of clicking on “Advanced Segments: All Visits.” From here, simply check the “Social Media” box from your custom segments options, and click apply. The end result is that you’ll now have a direct view of all of your site’s traffic with an additional layer of social media filtering. If your social media interactions are working according to plan, you should find a direct correlation between a rise (or fall) in overall traffic and the social media contribution. Likewise, if you’d like to look at just the social media traffic, uncheck “All Visits” from your Default Segments.

That’s all there is to it! By applying this custom segment to your Google Analytics account, you can still take full advantage of all of the systems’ tools, but now have a much narrower focus of which data you’d like to work with. Likewise, this filtering method can be applied to just about any link source you’d like.

Now that you’re an experienced filter pro, why not see which free, popular blogging platforms are sending traffic your way; WordPress, Tumblr, or Blogger? If it’s Livejournal, and you’re receiving traffic via vKontakte, maybe it’s time you started addressing your Russian speaking audience?

Get the TNW newsletter

Get the most important tech news in your inbox each week.

Also tagged with