Measuring Social Media with Google Analytics

Originally produced and presented by Graeme Benstead-Hume and SiteVisibility for the Brighton Digital Marketing Festival event September 2011. Measuring social media with Google Analytics covers a number of ways to segment your Google Analytics data to better measure the success of your social media campaigns.

Handouts for this presentation are available below or as a download here Measuring Social Media with Google Analytics Handout.

Creating Campaign Tracking Code

Visit or alternatively search for ‘URL builder’ in Google.

Website URL – Enter the URL you will be linking to from your social media activity.

Campaign Source – Enter the name of the social channel / site you are linking from, e.g.

Campaign Medium – Will group your campaign sources together in your reports so enter Social or Social Media.

Campaign Name – Choose a more specific identifier for your campaign, e.g. twitter outreach.

Click on Generate URL and copy and paste the resulting text instead of your usual URL.

You can find your campaign report in Google Analytics under ‘Traffic Sources’ and ‘Campaigns’

This even works when the URL with tracking code is minified.

Creating an advanced segment for social media traffic

Login to Google Analytics and navigate to your dashboard report.

Find and click on the Advanced Segments drop-down button at the top right hand side of the report.

Choose the ‘Create a new advanced segment’ option in the drop-down menu

Advanced segments in Google Analytics are constructed from blocks which allow or disallow certain segments of traffic; in this case we need just one block.

Open the traffic sources drop-down categorised beneath the dimensions filters. Find the Source box and drag it up in to the empty dimension or metric box.

Change the condition to read matches regular expression

Under value input the following regular expression:||linkedin|del\.icio\.us|delicious\.com|technorati||hootsuite|stumbleupon|netvibes|bloglines|||friendfeed|blinklist|fark|furl|newsgator|prweb|msplinks|myspace|||||poprl|tinyurl|ow\.ly| reddit

This should cover most of the social sites you might receive referring traffic from. If you promote yourself on any other social sites you can add them on to the end of the list using the pipe character | to separate each entry.

Finally give the segment a nice name and create the segment. You can check that the segment works properly by visiting your traffic sources report with the segment enabled.

Filtering Social Media Traffic

Navigate to the Analytics Settings screen where you should see your existing profiles.

Create a new profile with the Add new profile button.

Warning – if you do not create a new profile you may irretrievably lose data.

Add a profile for an existing domain and choose the domain you want to filter in the select domain dropdown. Give the new profile a nice name such as Social Media Filter and click finish.

Once you have created the new profile return to the Analytics Settings screen and find the edit button by the new profile:

Scroll down to the filters box and click the add new filter link.

Referring Traffic Filter

First set up a filter which only tracks referring traffic (We don’t want to miss any potential new social referrers!)

On the filter setup screen:

Select Add new Filter for Profile

Filter Name – Referrer Traffic Only

Filter Type – Choose Custom Filter – Exclude

Filter field – Choose Campaign Medium

Filter Pattern – Enter organic|(none)|direct|cpc|image

Case Sensitive – Select No

Social Media Medium Filter

Next we will group all of our known social media channels into a new medium named Social Media.

Click the add new filter link again and on the filter setup screen enter the following details:

Filter Name – Referrer Traffic Only

Filter Type – Choose Custom Filter – Advanced

Field A -> Extract A – choose Campaign Source and add our social networks regular expression as the value:||linkedin|del\.icio\.us|delicious\.com|technorati||hootsuite|stumbleupon|netvibes|bloglines|||friendfeed|blinklist|fark|furl|newsgator|prweb|msplinks|myspace|||||poprl|tinyurl|ow\.ly

Field B -> Extract B – leave these blank

Output To -> Constructor – Choose Campaign Medium and name it Social Media

Field A Required – Yes

Field B Required – No

Override Output Field – Yes

Case Sensitive – No

Please note that our regular expression above has been truncated as we are allowed at most 255 characters in our field extract value.

Full Referral Path Filter

Finally we create a filter which will provide the full path of our referrers so that we can identify traffic from various campaigns even if they from the same social channel. This data is crucial if you are trying to compare the traffic arriving from two distinct profiles on Twitter.

This filter provides this data in the user defined report under visitors.

Filter Name – Full Referral Path

Filter Type – custom filter – advanced

Field A -> Extract A – choose referral and enter the value (.*)

Field B -> Extract B – none

Output To -> Constructor – choose user defined and enter the value $A1

Field A Required – yes

Field B Required – no

Override Output Field – yes

Case Sensitive – no

Posted in Uncategorized | Leave a comment

Forecasting Search Traffic

I had the opportunity to give a short talk on forecasting search traffic at the SiteVisibility Search Innovation Seminar on Friday and thought I’d embed the presentation and provide a quick and simple guide.

All of the tools are easy to find and the math is pretty simple, in this example I will be looking at candy based keywords for my imaginary sweet shop.

1. First up we will get some idea of the search volumes for our potential keywords. Visit (or another keyword search volume tool) and search for the terms you are considering. In this example I have search for the terms ‘sweets’, ‘confectionery’, ‘candy’, ‘sweeties’.

Google Keyword Tool

We can see that ‘Candy’ is estimated to have the highest volume of search at 673,000 local monthly searches and ‘Sweeties’ has the lowest search volume at 6,600. Note that there might be some good alternative ideas below your specific search terms.

2. Next we can check how our search term will perform at different times of the year using

Google Insights

We can see from this chart that last year ‘candy’ saw peaks around May and December. After all, Everyone likes candy at Christmas. We might decide to use this data to weight our final search volume estimate.

I didn’t really go in to this in the presentation but I like to find the average of the normalised scores for each month of the year and divide the score of the month that I am interested in by that average. For example (taking the scores from Google insight for sweetie in 2010 below), if the average for the year is 56.17 we can calculate the weight for say, March, with:

50 / 56.17 = 0.89

Month Score % difference to average
January 54 0.96142433234421
February 62 1.10385756676558
March 50 0.89020771513353
April 61 1.08605341246291
May 55 0.97922848664688
June 60 1.06824925816024
July 63 1.12166172106825
August 56 0.99703264094955
September 56 0.99703264094955
October 55 0.97922848664688
November 53 0.94362017804154
December 49 0.87240356083086
Total 674
Average 56.1666666666667

3. There is plenty of Click Through Rate research out there but in my experience the Optify research from December 2010 seems the most accurate, even for Google UK. If you have any thoughts on this do let me know.

The table below shows the estimated percentage of the total search volume of traffic for any keyterm. For example at position 1 in Google you should see around 36.4% of all traffic for a term.

Optify CTR data

4. Now that we have all the data we need we are ready to put it all together. Lets estimate the traffic for ‘sweeties’ in March.

Search Volume Seasonal Weight Click Through Rate Estimated Search Traffic
6,600 * 0.89 * 0.364 = 2140

5. From here we can go on to estimate conversions and revenue if we have the right data. Taking an average conversion rate of 2% and an average order value of £50 we can calculate:

Est.Search Traffic Est. Conversion Rate Est. Conversions
2,140 * 0.02 = 42


Est. Conversion Average Order Value Est. Revenue
42 * 50 = 2100

And that’s that.

Of course these are all estimates and they are unlikely to be accurate. For clients I tend to go down a more conservative route and add further weights to the search volume estimations by comparing actual traffic data in analytics with the estimated search volumes for terms that are already ranking on the site in question. In some cases this has led to halving the estimates from Google keyword tool though it’s not usually quite so dramatic…

So how does this work for you? Leave a comment if you have any ideas of questions about forecasting search traffic.

Posted in Forecasting, Insights, SEO, SiteVisibility | Tagged , , , , | Leave a comment

When to send an email newsletter

Identifying the time that your site performs at its best can help you make the most of your email newsletter and PR campaigns. Follow the steps below to find out what time of day and what day of the week the largest volume of users are completing your goals.

Whilst finding the time of day to send your email is straight forward in Google Analytics we will need to use a work around to find the best day of the week. In this example I will be using a Google Docs spreadsheet but Excel works in exactly the same way.

What time should you send your email newsletter?

  1. Select the advanced segment for traffic which has completed your chosen goal.
  2. Open the ‘Visitors -> Visitor -> visits’ report.
  3. Choose the ‘Graph by hour’ option above the graph panel.
  4. Choose a long time frame for the report, a year or two if possible.
  5. The trend graph you see should highlight the time of day that your website is performing at it’s best.

What day of the week should you send your email newsletter?

The first few steps are very similar to those above but to get this information you must export your data and do a bit of spreadsheet magic.

  1. Select the advanced segment for traffic which has completed your chosen goal.
  2. Open the ‘Visitors -> Visitor -> visits’ report.
  3. Choose the ‘Graph by day’ option above the graph panel
  4. Choose a long time frame for the report, a year or two if possible.
  5. Click on the Export button at the top of the report and choose ‘CSV’
  6. Open the exported CSV file in your chosen spreadsheet program, for example, Google Docs Spreadsheets.
  7. Choose an empty cell on the spread sheet and enter the following:=sumif(A:A, “Monday*”, B:B)With this formula we are effectively asking the spreadsheet to add up all of the cells in column B that appear next to a cell in column A containing the string Monday.As a quick breakdown of this formula A:A is the whole of column A, and the * after Monday means that the formula should count all cells that start with the string “Monday” even if there are more characters after the name of the day.(Note: If you are using OpenOffice you may need to select all of the dates manually instead of A:A  and all the data in column B instead of B:B)
  8. Copy the forumla into the cell below substituting ‘Monday’ for “Tuesday’ and so on until you have a number for all 7 days.
  9. The day on which your users convert most frequently will have the highest number.

And that’s that.

As a matter of interest I have found that many business to business clients seem to share a time of around 10.00am on a Wednesday and more customer facing businesses tend towards 8.00pm on Thursdays. It would be great to hear what you find for your business.

Of course there are some issues with this method. First of all, if you already send out a regular newsletter at a certain time of a certain day you will naturally see higher figures at that time (unless the newsletter is performing particularly badly). Whats more, if you use the method above and start sending releases based on the information  you will start something of a self-fulfilling prophesy where the times you first identified will only ever look more attractive.

If you have any questions or if you would like me to cover anything in future posts please let me know in the comments.

Posted in Email, Google Analytics, Insights, Web Metrics | Tagged , , | 1 Comment

Advanced Segments for Non-Branded Organic Search Traffic

Comparing segments of your websites traffic by source can be an excellent way to gain insight into the effectiveness of your digital marketing.

One really important segment that you should use if you are running a search marketing campaign is a Non-Branded Organic Search Traffic segment. This will allow you to gauge how many visitors and conversions your website is receiving from search visitors without the influence of your naturally well ranking branded terms.

You can find the custom segment drop-down at the top left hand side of your analytics report on the new version of Google Analytics (on the old version the button is at the top right but this guide is specifically for the new version of Google Analytics).

1. Choose the ‘New Custom Segment’ link in the advanced segment drop-down.
2. Give the Segment a sensible name such as “Non-Branded Organic Search Traffic’.
3. Leaving the first drop-down on the form as ‘include’ click on the dimension/metric drop-down and search for and select ‘Medium’.
4. The third drop-down should read ‘containing’. Enter ‘Organic’ into the final text box.

This will make sure that this segment only includes visitors from organic search channels.

Next we need to exclude the organic traffic which is arriving at your site after searching for your brand or a related branded keyword.

5. Click on the ‘add AND statement’ link.
6. Search for and select ‘Keywords’ in the ‘Add a dimension or metric’ drop-down
7. Choose ‘Exclude’ on the first drop-down.
8. Leave the third drop-down as ‘Containing’ and enter your brand keyword (For example, your brand name or a branded product name) in to the final text box.
9. If you have additional brand-words you want to exclude rinse repeat steps 5 – 8 (You can also use the ‘Matching RegExp’ option using the | character between each keyword but we will discuss RegExp another time).
10. Test the segment to make sure the figures look sensible.
11. Save the segment.

You can now review how your non-branded search traffic is behaving across at all of your reports. To find your best performing non-branded search term and to make sure no misspelled versions of your branded terms are escaping your segment you can use the ‘Organic’ report under: Traffic Sources > Incoming Traffic > Search > Organic.

So, I hope thats useful. If you have any questions that I can answer or if you would like to discuss this segment please let me know in the comments below.

Posted in Google Analytics, Search, Uncategorized | Leave a comment

Hostname Filter for Google Analytics

There are many reasons to setup a hostname filter on Google Analytics, not least that you can ensure that all the traffic being shown in your reports is visiting your website rather than from another site that features your GATC (If your site is ever scraped your tracking code may well end up on pages other than those within your site).

To make sure you do not irretrievably loose any data due to over zealous filters you should always make sure you have a ‘master’ profile for each of your sites and duplicate profiles for specific filters.

To setup a hostname filter visit your profile setting page and find the filters page.

1. Give your filter a name, “Hostname Filter” makes sense.
2. Choose the ‘custom filter’ option.
3. Choose ‘include’ on the menu that appears
4. Choose ‘hostname’ on the drop down below that.
5. Input your hostname in to the Filter Pattern box
6. Save the filter

And that’s that.

Keep in mind that if you’ve setup a new profile for this filter you will not see any historical data and the filter will not work retroactively if you apply it to an existing profile so either way you will not see any filtered results for 24 hours or so.

Please let me know if you have any question or if there are any aspects of Google Analytics or any other web metrics tool you would like me to discuss in the comments below.

Posted in Uncategorized | Leave a comment

Tracking Site Search with Google Analytics

Tracking your internal site searches is easy and can give you some great insight in to how your visitors are using your website.

To setup site search you need to access your profile information settings (the same screen that allows you to change the name of your profile) and under the ‘Site Search’ heading choose the ‘Do Track Site Search’ radio button.

The resulting drop-down form includes a text box for query parameter. To find out what your site’s search query parameter is simply do a search on your site and, in the address bar at the top, find the parameter which should be after a ? and just before an = sign and your search string. For example, if I searched for ‘metrics’ on my site I might see:

In this case the query parameter, which I would input in to the query parameter text box, would be ‘s’. Other sites may have different parameters such as ‘search’.

Once you have inputted your search query parameter and you have saved the profile information you are ready track your site search. After 24 hours or so visit the ‘site search’ menu in the content section of your analytics profile and find out how people are using your internal search.

Let me know if you have any problems with this or if you would like any more detail and as always I would love to hear from you with suggestions for Web Metrics screen casts. Next time we are looking at creating advanced segments for tracking non-branded search traffic so I’ll see you then.

Posted in Google Analytics, Search, Web Metrics | Tagged , , | Leave a comment

Google Analytics for WordPress

So, you want to install Google Analytics on your WordPress Blog.

The good news is that it’s nice and easy. As you will see from the video above, it’s just a case of knowing where to add the code.

Assuming you have setup a Google Analytics account all you need to do is create a new website profile and grab your tracking code. It will look a lot like this but with your unique ID instead of all those x’s:

<script type=”text/javascript”>
var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);

(function() {    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘’;    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);  })();</script>

Once you have copied your tracking code, make you way back to your wordpress site’s dashboard and open the ‘Appearance’ dropdown on the left hand menu. Click on Editor.

Now, as I mention in the video we can find your blogs <head> section in the header.php file. You should be able to find it on the right hand navigation. Click on that and scroll down the resulting code until you find the </head> tag.

If you checked the tracking code instructions on Google Analytics you will have noticed that this is exactly where we need to add the code. So go ahead and paste the copied code just above the </head> tag and click on the update file button at the bottom of the page.

Finally, lets check that this has worked. Go back to the Google analytics profile page and click on the ‘edit’ button next to the domain you want to track. On the edit page you should see a ‘Check Status’ button. It’s time to click it! All going well you will see a gathering data message. If not wait a few minutes and try again. And we’re done!

Any problems, questions or requests for screencasts? please let me know.

x MrMetrics


Posted in Google Analytics, Web Metrics | Tagged , , | 3 Comments

Web Metrics Love

*Stands Up*

Hello! My name is Mr. Metrics and I am a web analytics lover.

And the thing is, I reckon you should be one too!

Well… if you are in any way involved in Digital Marketing, Web Design / UX / UI, Online Advertising, Social Media or online PR etc. anyway.

I’m not going to get all serious on you… I’m not going to tell you how you can’t run a successful online business without effective measurement in place… Besides, we all know that and I’m not really the preachy type.

There are much better reasons to love web analytics.

I think you should be an analytics geek because, the moment you know what all those lovely numbers mean, you will:

1. Learn faster – “Experience is a good school, but the fee’s are high… but Google analytics is free”. Finding out if the changes that you make are effective quickly and without the guess work will help you learn what works and what doesn’t much faster.

2. Love your job even more – because everyone likes feedback and you’ll be getting a lot of feedback once you know what you are looking for.

3. Make your clients / boss / investors / bank manager appreciate you even more – As well as helping you to do your job better those precious little numbers will also allow you to provide more insight into how the visitors to your site behave and what they want. That makes you more valuable to all the people listed above!

4. Impress your friends and your family – by telling them that you are the head of analytics or a web intelligence specialist or a data monkey or whatever.

4 1/2. Get out of long chats with your extended family  - by telling them that you are the head of analytics or a web intelligence specialist or a data monkey or whatever.


Anyway! If you decide to make Web Analytics a bigger part of your life, which you should, hopefully you will find this blog and it’s screen-casts useful. If you do please let me know and… you know, if you don’t please PLEASE let me know because without feedback nothing ever gets any better.

x Mr. Metrics

Posted in Web Metrics | Tagged , | 1 Comment