Segmenting Social Traffic in Google Analytics&nbsp

The author's views are entirely his or her own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

If you use Google Analytics, you've undoubtedly seen a report like this:

The problem is, there's no breakdown of "social media" in this view of traffic sources, and with the dramatic rise of social media marketing, marketers need an easy way to segment and "see" this traffic separately from the rest of their referrers. We know it's mixed in with "referring sites" and "direct traffic" but luckily, there's a way to extract that data in just a few simple steps.

Step 1: Create a Custom Segment

Custom segments are the way to go for separating traffic into filter-able buckets for deeper analysis. GA makes this fairly painless:

From any of the "Traffic Sources" sections, just click the "Advanced Segments" in the upper-right hand corner and then the link to "Create a new advanced segment."

Step 2: Add Social Sources

This is the most crucial part, and requires that you have a full list of the sites/words to include. I don't recommend using just the domain names or URLs of the most popular social sites, but instead, some clever "catch-all" words using the "source" condition, as shown below:

Make sure to continue adding "OR" statements, not "and" statements - the latter will require that both conditions are met vs. any one of the "ORs". Here's the list of words I used, though you can certainly feel free to add to it:

twitter

tweet

facebook

linkedin

youtube

reddit

digg

delicious

stumbleupon

ycombinator

flickr

myspace

hootsuite

popurls

wikipedia

Depending on your niche, it might be valuable to run through your top 2-500 referring domains looking for any obvious matches. You could also refer to Wikipedia's list of popular social sites.

Step 3: Test & Name Your Segment

In order to create a fully functional segment, you'll want to test the logic you've created to be sure results are returning. Before you do that, though, GA requires naming your segment (I used "social media"):

Once it's complete and working properly, click "save segment." You'll be returned to the prior screen with the segment ready to rumble.

Step 4: Filter Traffic by "Social Media"

Your new segment is ready to be applied. You can now filter social media exclusively or see it in comparison to other traffic sources on any report in GA. Just use the advanced segments drop-down and choose "social media" under the custom segments list like so:

Of course, just having data is useless unless there's some action you can take from it. Segmenting social traffic is useful for reporting, particularly to gauge value (if you have action tracking on commercial activities set up in GA, for example) and see growth/impact over time. But, there's more you can learn than just raw traffic and conversions numbers.

Here's some examples of reports I ran, along with the value/intelligence extracted from the data:

It can be tough to "see" the social sites between other referring domains, but once they're broken out, combing through and finding the sites where your efforts are working is vastly more simple. If you then compare this against traffic "opportunity" from these sites (using a combination of traffic data and gut check), you'll be able to find which sites have the greatest chance to improve. For SEOmoz, Facebook, LinkedIn, Reddit and Wikipedia stand out to me as places where we likely have more opportunity than we're currently capturing.

This next chart compares search vs. social traffic over time:

If I'm looking to evaluate progress and make comparisons, this view is fairly useful. I can tell if my share of social media is growing or shrinking and how it compares to overall traffic and search individually. I'm only looking at a short timeframe here, but over the course of weeks or months, I can quickly gauge whether my efforts in social are paying off with traffic and whether they're improving my performance in search engines (through new links, citations, etc). When someone asks if social helps search, showing these two segments over time can be persuasive.

Next, I'm reviewing the level of engagement of social media visitors:

At first, I can compare this against other segments (like "search" or "direct") as a measure of comparative value. But, I also want to compare this over time, particularly if I'm making tweaks to my site to encourage greater engagement and click-through to see if those efforts are successful.

Just because I'm curious, I'll check out some browser stats:

Admittedly, this isn't especially actionable, but it is fascinating to see the browser "savvy" of social users. Dominated by Firefox and Chrome with very little Internet Explorer use. If I'm trying to see what the cutting edge users are shifting towards, this is where to look. I suspect Rockmelt will soon be joining the list. (BTW - I love that 5 people came with the user-agent "Googlebot" - awesome).

Last, let's peek at the pages social visitors see:

These are all potential opportunities to create more customized landing experiences based on the referrer path, and the report can also give me insight about what content I need to continue producing if I want to draw in more social traffic.

If social media marketing is a focus of your organization, segmenting that traffic in reporting is critical to determining the value of your efforts and improving. So get into GA, segment, and start seeing your traffic for what it really is.

Small hint for setting up the custom segment: Change the drop down from "Contains" to "Matches regular expression" and then use a pipe to separate each referrer, e.g. it should read "Source matches regular expression facebook|twitter|linkedin|....|wikipedia"

It'll shave a cool 15 seconds off the process, but make your life 4% more complete.

We also make sure to tag up all posted links using the Google tracking URLs, and then convert using bit.ly (old school!).

Reason being we can tag up in great detail, and then in reporting segment down to the medium (social), source (facebook), content (wall post/group message/discussion board etc), and the specific story or campaign.

This way we can get even more detail on which content our market(s) are interacting most profitably with.

Hi, Thanks for the info. However, my client is using google analytics to track the campaigns I am running for him in Yahoo and Facebook and the reports from this have a 30-50% variance with the reports directly from Facebook and Yahoo. I even created the link using the google tracking url and it still showing major discrepancy between both reports. My luck, he will pay me in accordance to the google analytic reports. Any sugestions?

I probably repeated myself many times already, but I see you guys giving great answers if their is no variances in the reports by google and in this case Facebook. For the first time, I am having a 50% discrepancy in the result. It is a costly discrepancy. Any sugestions?

You have to be careful on this. Facebook hits can come from m.facebook.com or www.facebook.com. Twitter hits can come from twitterfeed.com, twitter.com, and a few other sites too. If you want to take a more refined approach, I suggest you search through your referring sites reports using your keywords (facebook, twitter, etc.) and make sure you aren't excluding relevant domains.

One of the big reasons I used the keyword rather than the domain is due to all the secondary sources that send traffic from Twitter/Facebook (in particular, though there are others). You can see some of these in the screenshot - stuff like "tweetdeck" or "twittercounter" or "facebookapps", etc. Using the raw keyword captures all of these, along with the main domain.

When implementing on your own sites, you could filter through your site URLs reports and look for any sub-domains, domains, or sub-folders that include a facebook, twitter, etc and aren't actually social sources, but may be a sub-folder on a blog.

You can then add an "and" statement to the end of your custom segment and use the "does not match" or "does not contain" conditions to filter out erroneous URLs.

For the more advanced, you can use the "matches regular expression" condition.

Also important to consider here is if you want your campaign traffic from these sources to be tracked in the same report. If so, the utm source needs to be labeled with the same source ("facebook", "twitter", etc) in order to be counted. If they aren't, they won't be counted, even if they're coming from facebook.com or twitter.com.

Thanks for the in-depth information on segmenting with Google Analytics. Lately Twitter claimed the App they are working on SEO is far more better than Google Analytics, waiting for it will it challenge Google Analytics, its getting interesting.

Remember, with Google's URL tag builder tool, you can also track content and specific social media elements like:

a. Blog on Analytics

b. Blog on Pay per click

OR

a. Facebook Fan page

b. Facebook ad

OR

a. YouTube Channel URL

b. YouTube Promoted video

And of course, by setting up conversion goals you can take your analyses to the next level and track conversion rates and per visit goal values. I do this all the time for my clients. There's so much you can do and track by segmenting audiences and make valuable decisions on where to spend time with your marketing.However, the one caveat is that Google Analytics defaults to "last click" metrics. Social Media attribution is a factor with other kinds of conversions attributed to pay-per-click, SEO, or direct visits. Companies struggle with this issue and sometimes looking at overall site traffic trends and growth of overall conversions is the best measure of all.

Yes, you can track ads on Facebook. However, it will not be an accurate tracking compared to the source. (in this case Facebook). It is annoying and costly when the clients uses the Google analytics to track and his report is 30% less than your and they want to pay you by their report.

My question: does your segmentation includes also other "sources" for Twitter and Facebook? I'm talking of desktop Apps like Tweetdeck. I suppose it is somehow a rethorical question as - correct me if I am wrong - that traffic is probably going to be counted as Direct by analytics (as it is, with some differences, counted so by the Bit.ly metrics).

On a side note, it is interesting how from these middle november metrics we can see how the longest time on site is from the Mobile Apps of Facebook (first is r Hootsuite); could be a sign that maybe has to be planned a Mobile Version of the site (at least of the blog?).

Thank you so much for the incredible post, randfish. I've only started using GA recently and have been doing copious amounts of Googling trying to figure out how to operate its nuances and this is by far the best post I've read about recently.

Rand i need to ask you one question. Do you ever read youmoz posts ???????? I wrote a similar post on your own blog: http://www.seomoz.org/ugc/segmenting-important-data-through-advanced-segments back in August of this year which talked about the exact same thing you have mentioned here in your blog post i.e. segmenting social traffic in Google Analytics. My post deserved a promotion. Anyways

but I don't think this is the correct tone... you could have said something like: "Hi Rand, I'm glad you are suggesting something I really preach to do, as I wrote in my YOUmoz post here (link to your YOUmoz). Next time I suggest you to check out YOUmoz more frequently ;) and it would be great to read more your and others SEOmoz staff comments there :)".

The same message, but better tone.

You're a great guy with great ideas and really able in explaining them, but sometimes you let yourself be guided by the "Dark Side" ;).

My tone has bit of frustration and anger. The post that was not considered to be promoted is now being used for the main blog by a different author on the very same blog. How do you expect me to react? Just sit silent??

I hear you, but, IMHO, you have no prove Rand used your post as a base for his.

And, secondly, it is human to feel anger and frustation: I felt somehow the same when my second YOUmoz finally was not promoted, even though it had been wonderfully welcome and commented. But I've learnt - I know I sound paternalistic - that frustration and anger by themselves are improductive... use them to push yourself even more further in your writing, researches and so on, because compensation will surely come.

Taking again as example my second YOUmoz, I preferred to see the positive... I preferred to think: Wow, my post not only has been published but also has received comments by people I admire (Will & Tom Chritchlow, Rand himself, Richard Baxter, Dr Pete, Brian Brown... I mean, I was able to push Sly-grr commenting it too after so many weeks not commenting nothing). And that positive actitude, despite of not seeing it published in the main blog, pushed me to be even more active with the community, pushed me to abandon once at all my personal shyness when it comes to approach someone I admire... that is what I mean to turn something not productive into productive and beneficial.

I can kind of understand why himanshu is angry but to be honest this is not his blog, this blog is owned by SEO MOZ, I mean I have made a few posts for Youmoz that just sit their for months and months and then people who work for Distelled or SEOMOZ have free raign to post what ever they want when they want even if it is similar content. The thing is if you want your posts to be noticed you have to make your own blog high traffic and bring out your own name and not rely on some one elses website for promotion becuase in the end of the day getting a blog post on Youmoz or SEO MOZ is something you should be thankfull for as in the end of the day they own this property.

But a funny thing is "Gfiorelli1" are you like Rand's person spokes person or something lol...

Hehehe... that's something I've thought too after published the comment.

No, I think the reason I wrote those two comments is because I know well the value of SEO-Imanshu, I know what means to write a YOUmoz and "live the thrill" when it is published (and when it is bounced, as happened with my first attempt in my SEOmoz beginnings) and I know the honesty of Rand and of the SEOmoz staff: that's all :)

Could Rand Fishkin actually be Judith Griggs?!?!?! ;-) I definitely think there are more YOUMOZ posts that deserve promotion than get them, but just because Rand posted on it doesn't make your post any less valuable. In fact, it just shows you are a couple months farther ahead of the curve than SEOMOZ :)

I ended up trying this out based on your YOUMOZ post himanshu, and then Rand's post reminded me about it. I just checked and found out that social traffic has increased by 20% since August! Hellllls yeah!

My apologies - that wasn't cool. I don't read every YOUmoz post, particularly when things are overwhelming (that week was our seminar in Seattle, and I'm sure I was scrambling, though that's no excuse). Your post was great, too - love what you did with the stacked charts over time.

I promise to be more cautious next time. For now though, can I say "great minds think alike?" :-)

If you mean that you scale to just an 5% your trust to what is written in YOUmoz, I remember you that those posts are screened by SEOmoz before being published. You miss great gems not reading it... and try to look back in the history of YOUmoz and you will find many of the most reputed people out there who wrote in that blog, maybe the best unsuspected secret of SEOmoz.

Yeah, since SEOmoz stuff read and approve Youmoz posts, all posts have, like a same value. Well noticed, Gianluca. And acording to interest in Youmoz vs SEOmoz in coments on this post, maybe it's a good idea for SEOmoz stuff to write one post with data about how many percent of Youmoz submited posts are approved, how many submitions they get monthly, percentage of posts promoted to SEOmoz, etc.