How to Tag and Track Social Media Traffic For Google Analytics

If you are reading this, you most likely are involved in promoting your site through social media.  You or your social media team are posting on Facebook, Twitter, Pinterest, etc. to drive traffic to your site.   You want to find out what social media sites are sending the most traffic, what social media sites are performing the best, and understand what these social media visitors are doing on your site.

Tracking for social media has both strategic and technical elements, so this post will go deeply into both, along with a strong dose of practical considerations.

Quick links:

 

PART 1: IDENTIFY YOUR SOCIAL MEDIA TRAFFIC

Find traffic from your social media sources by navigating to Traffic Sources > Sources > Referrals.  This will bring up a list like this:

traffic sources

 

Look through this list to identify your site’s social media traffic.  In addition to this, think through the sites your company has a social presence on, or sites where it makes sense for you to foster some kind of community.  There are two important points to keep in mind:

1) You can see from this example that social media sites are represented by a few different URLs. m.facebook.com is Facebook’s mobile site, and t.co is actually Twitter’s shortened URL service.

Shortened links for a few popular URLs:
fb.me –> Facebook
linkd.in –> LinkedIn
goo.gl –> Google
t.co –> Twitter

2)  YOU decide yourself what constitutes a “social media” source.  For example, the above list contains online fashion community polyvore.com. You probably don’t need to track this for your electronics site, but if you have a fashion-related site, then it’s probably quite relevant.  It’s up to you to decide what you want to identify as social media traffic, though a “standard” list would probably include Twitter, Facebook, Google+, Pinterest, LinkedIn, YouTube, Reddit, Tumblr, and a few more that have come out by the time you’re reading this :).

Note: If you navigate to Traffic Sources > Social > Overview, you will in fact find a predetermined standard list of “social” traffic, as well as several other reports centered around social traffic.  I don’t usually use these reports because I like to see social in the context of all the other traffic, not sectioned off by itself.  But I recommend taking a look so you know what’s available. This guide is specifically for people using the standard Traffic Sources report, NOT the Social reports.

PART 2: FIND YOUR DATA

OK, you’ve made your list of social media sites you want to track. Now what?

The first thing you can do is click on the Advanced search box above the Traffic Sources > Sources > Referrals report we were already looking at.

advanced-filter

This will bring up a dialog box as follows, where you can add in the right criteria to isolate just the social media sites you’re interested in (be careful with t.co since that will match a lot of sites if you’re not careful).

advanced-filter-social

You’ll probably notice that this method will get tiresome after more than a few sites have been entered, so you can instead take a shortcut by choosing Include Source Matching RegExp and then copying and pasting the following (no spaces): (facebook.com|linkedin.com|lnkd.in|pinterest.com|plus.url.google|tumblr.com|twitter.com|^t.co$|youtube.com)

In RegExp syntax, a pipe (“|”) means “or” so if you have additional social media sites you want to track, you can append them by adding a pipe and then the site URL.

regex filter

Now your report will be filtered for just your social media sites.

Expert Tip: click “Shortcut” towards the top menu bar to save this configuration so you can easily access the filtered report again next time.

Out of the box, you’ll be able to see visits, pages/visit, and other key site usage metrics. If you’ve enabled ecommerce or goal tracking, you can switch to the right metric set for those for those by clicking to the appropriate tab at the top of the page.  This is actually just one of a few ways to view the data, but it should give you a good way to jump into comparing and understanding the traffic quality of your various social media sites.

metric selector

 

PART 3: PITFALLS AND PROBLEMS (or WHY YOU SHOULD TAG YOUR LINKS FOR GOOGLE ANALYTICS)

If you are only interested in analyzing social traffic that arrives at your site because your fans (or perhaps enemies) are posting links back to your site, you can check your data as described above and stop reading now.  However, for everyone else actively managing social media accounts on Twitter, Facebook, Google+, and others, I’m sorry, but it’s not quite as easy.  Note — if you are already tagging your links, you can skip ahead right  now to Part 4: HOW to Tag Your Links for Google Analytics .  If, instead, you’re posting on social media sites but not putting special tags on your links, or if you didn’t know what a “tag” was before now, keep reading as this will apply to you 🙂

As you can see from the filtered report we created above, you can get a wealth of information on social media traffic and performance out of Google Analytics, all without adding a single tag.   There’s only one catch – social media is by definition social. Your social media team may be out there posting links (“come check out our Winter promotion”), but so are other people.  It takes a lot of time, money, and effort to sustain an active social media presence, so at some point you will want to understand how much social media traffic is coming from the links YOU post on social media sites versus links that get shared by your site fans and visitors.   Let’s call the first type “active social” and the second type “organic social”.

A tag is Google Analytics’ way of allowing you to control the way traffic to your site shows up in the reports – more on that shortly.  In short, if you don’t tag your links, you can’t tell active and organic social traffic apart. It all gets rolled up together.

This also means you frequently can’t identify what specific posts and status updates drove your social traffic.  You’ll see you have a big spike in traffic from Facebook, but won’t be able to drill down further than that because Facebook doesn’t supply a deeper level of granularity.

These issues are resolved by tagging your social media links.  Which brings us to….

 

PART 4: RECOMMENDATIONS FOR TAGGING SOCIAL MEDIA TRAFFIC

If you’re already posting on social media sites and adding tags for Google Analytics, congratulations 🙂 As stated before, tags let you explicitly identify how traffic will show up in your GA traffic source reports.

In brief, there are 5 slots you can use to add information about every link you post out in the world.  When users click on these links and arrive at your site, any original values will be overwritten by those 5 values, which can then be looked up in the reports.  The 5 slots are utm_medium, utm_source, utm_content, utm_campaign, and utm_term, and directly correspond to the Medium, Source, Ad Content, Campaign, and Keyword fields in GA.

Every time you or your social media masters are posting links that link back to the site, they can append detailed data into these slots.    This also means you can overwrite default values.  For example, by default, social traffic comes in with a medium of “Referral” in the Traffic Sources report.  However, if you are tagging your links, you get to choose what medium name to use.

In the above case, I see many companies choose “Social”.    This means you’re out there carefully appending ?utm_medium=social&utm_source=twitter.com&utm_campaign=todays-awesome-post to the daily link, so that anyone who clicks on it gets stamped with Medium = Social.  Meanwhile your site visitors don’t know what a tag is (except MY site visitors :D) so they’re out there in the world, posting naked links back to your site that get the default stamp of Medium = Referral.

There is nothing inherently wrong with this, but it causes a split in the data that you need to be cautious about.  If you follow this strategy, make sure anyone looking at the data is aware that social data now appears under two separate mediums, and must be summed for an accurate count of overall traffic.

social mediums

In practice, I find that it is easier to avoid data misinterpretations if you tag your social links as “referral” so it all rolls up together.  You can then differentiate active from organic social by adding a tag into another slot like “utm_content”.

Also be aware of maintenance.  You need to tag every post you make, and ideally with tags that change for every post or update so you can identify the traffic. This can be a significant overhead in terms of time and effort.  Reduce the time and effort associated with producing tags by creating a centralized tagging document (your company intranet or a Google doc should work well) that everyone is on board with.  You may also benefit from some automated system for creating the tags, either built internally or via some software designed for this purpose.  Whatever system you use, make sure there is in fact a SYSTEM.

Summarized Recommendations for Tagging Social Media

Create a centralized tagging document.  And then tag your links using the following values:

utm_medium=referral //this will make both active social and organic social roll up together

utm_source=<sitename.com> (e.g. facebook.com) // this will again ensure that your active and organic social are rolling up together

utm_campaign=<date>_<post or update identification> (e.g.  20130204_Winter_Promotion) // this will let you identify what specific post drove the traffic

utm_content = social // this will let you easily differentiate your active and organic social from each other

See the Google Analytics URL builder if you still need help constructing these custom URLs.

 

PART 5: A NOT TOTALLY FINAL P.S. FOR GOOGLE ANALYTICS NERDS

There is one remaining subtle tracking issue related to how Google Analytics works.  Ironically, when you tag your links, you can actually get LESS information than what you had before!  This is because, by default, Google Analytics gets the full referrer URL (out of the document.referrer property), and populates the Source and Referral Path fields with the info.   However, when you add campaign tracking tags, you only get the information you placed in the tags.

As an example, here are the full referral paths for untagged traffic coming from Twitter.  These are the original referring URLs, meaning we can click all the way through to see the exact status update that drove the traffic.

referral paths

However, when you add campaign tracking tags, you overwrite this original referrer information and no longer have access to this extremely granular information.

Despite this, I still believe the drawback of potential data loss is outweighed by the benefit of tagged links.  This is especially true since Facebook doesn’t provide full links anyway.

How do you tag and track social media for Google Analytics? Any favorite custom reports to share?

Comments:11

  1. Hi Ana,
    Great overview. I’m curious how your advice above relates to the “Social” tab and the Social settings you can now add in GA? If I’m using a custom tag like “social-media” or something, does that mess up with getting the data included in the Social reports? Would love to hear your thoughts!

    1. Hi Steve, sorry for the delayed response and thanks for the question. YES, using custom tags does mess up the Social reports. You can only use utm_medium=referral or utm_medium=social if you want them to be included in these reports. I personally don’t really like the social reports because I like to see all the sources together with all the same attribution logic, but I may revise this article to better address GA’s built-in social reports.

  2. Ana – How about if you are testing multiple posts per campaign (variations, or timing). Typically you would use utm_content to differentiate each distinct post for the campaign. How would you do that while still setting medium = referral.

  3. Ana, I see many examples of using the URL builder that only include the domain name in the utm_source parameter (e.g. facebook). In your tagging structure you recommend including the TLD (e.g. facebook.com). Does that make any difference or would your tagging system work with or w/o the TLD ending?

    1. Hey Marco, you can do it either way. The only reason I include the .com part is for consistency, since on untagged links, GA displays the full domain name. That means if you tag your URLs as just “facebook”, your tagged URLs would appear as “facebook” while your untagged URLs appear as “facebook.com”. That may or may not be fine depending on your preferences and how you intend to report.

  4. How about if you are testing multiple posts per campaign (variations, or timing). Typically you would use utm_content to differentiate each distinct post for the campaign. How would you do that while still setting medium = referral.

Leave a Reply

Your email address will not be published.