Archive for February, 2010

Tag Your Tweets and Track Your Social Campaigns in Google Analytics

Wednesday, February 17th, 2010 by David Evans
Google Buzz

Businesses and individuals who use social tools, such as Twitter, Facebook, Blogs and YouTube, to reach their audiences are on the cutting edge of social media.  What started as a simple conversation tool for individuals, social media has become a viable marketing tool for companies of all sizes.  As such, it is imperative that organizations track the effectiveness of their marketing efforts.  Unless you’re particularly savvy, promoting a sale or event by tweeting a link back to your site doesn’t give you an opportunity to properly credit the tweet as the source of any business.

Google AdWords does a thorough job tagging each paid campaign for Google Analytics to track and report the success of your advertisements, but what about Twitter, Facebook or Blog posts?

Enter the concept of campaign tagging for social media.

WebShare has a Social Media Tagging Tool that will do this for you, but if you want to know more about how and why to do this, read on…

Google Analytics has five “Traffic Source” dimensions for the purpose of tracking campaign traffic: Source, Medium, Campaign, Ad Content and Keyword.  In AdWords, for example, the source is “google” and the medium is “cpc”.  The campaign is the AdWords campaign name, the Ad Content is the headline of the ad and the Keyword is the word or phrase entered by a user to find your ad.  For the purpose of tracking social media traffic, we can utilize these dimensions in a similar fashion.

Tagging your social media blasts involves appending GA tags to your URL.  And while this can cause a lengthy URL, we further recommend using one of the many URL shortening mediums out there (e.g. bit.ly, j.mp, awe.sm).

There are three required variables in order for your tagging to succeed:

1. Source
2. Medium
3. Campaign

The two remaining variables are optional and are referred to as:

4. Content
5. Term

NOTE: In Google Analytics, “Content” translates to “Ad Content” and “Term” translates to “Keyword”

For social campaigns, we recommend using the following scheme:

Source: “twitter”, “facebook” or “blog”
Medium: “social”
Campaign: A top-level category that describes the purpose of your social blast, e.g. “SeminarsForSuccess”
Content: (optional) If anything, use this field to further describe the campaign, e.g. “FEB2010″ to define which seminar you are promoting
Term: (optional) You could use this value to further define the content, e.g. “LasVegas” to describe the location of the FEB 2010 Seminar.

Honestly, there aren’t many cases out there where including “Content” and “Term” are that necessary as you could just as easily call the campaign (in the above example), “SeminarsForSuccessFEB2010-LasVegas”.  In Google Analytics, there isn’t an intuitive way to view the granularity of all five campaign tags.

How do you tag your URL?

Tagging your URL is accomplished by adding specific campaign tagging values (as query string parameters) to the URL you want people to visit. The exact parameters (respectively) for Source, Medium, Campaign, Content and Term are:

1. utm_source
2. utm_medium
3. utm_campaign
4. utm_content
5. utm_term

Again, these will be query string parameters and must be appended to the URL properly so they allow the user to end up on the intended page and cause GA to consume the parameters.  Easier said than done.

Let’s say, for example, you want your clients to visit http://seminars.websharedesign.com.  By itself, this is a valid URL, but it is NOT tagged.  A tagged version of the same URL might look like this: http://seminars.websharedesign.com?utm_source=twitter&utm_medium=social&utm_campaign=SeminarsForSuccessFEB2010-LasVegas.

In Google Analytics, you will see traffic for this link in your Traffic Sources > All Traffic Sources report. Initially, this will show you all traffic by source and medium:

View traffic by campaign Source and Medium in Google Analytics

HINT: If you wish to reduce the list to look only at “x / social” traffic, you may want to filter the list by entering “/ social$” in the filter and click “Go”.

Filter results in Google Analytics with Regular Expressions

Next, you should customize the report to include the campaign information.  Just select the “None” drop down list (which is next to the “Source/Medium” heading of the report table) and select “Campaign” from the list.  This will add the campaign value to the report and you will see stats for each social media blast you sent out.

Add Campaign to the Source and Medium report for better tracking data of your social media blasts

Now you can see that our tweet for the Las Vegas Seminars for Success in February 2010, successfully generated 1,039 visits to our site!



David Evans
David heads up software and web design efforts at WebShare. You can find out more about David here.

See more posts by David Evans

Clean up Your Google Analytics for 2010

Thursday, February 11th, 2010 by Nick Iyengar
Google Buzz

It’s a bit late for a New Year’s-themed post and a bit early for a spring cleaning-themed post, but it’s never a bad time to get your Google Analytics data cleaned up. For those of you looking to do just that, here’s a “Quick Fix” checklist to put yourself on the path toward usable data.

1. Identify and resolve self-referrals
A “self-referral” is a visit for which the referring source is your own website. Self-referrals prevent you from seeing the original, valid referral information for the visits in question, so if you’re measuring ROI on advertising outlets, paid search placements, or offline campaigns, it’s important to reduce self-referrals to a minimal level.

First, make sure that every single one of your pages is tagged.  This can lead to situations where self-referrals occur.

Many self-referrals are a symptom of deploying Google Analytics without customizing your tracking code to track across subdomains (like blog.yoursite.com) or top-level domains (yourshoppingcart.com). Fortunately, this customization is fairly simple and easy to complete.

When a visitor to yoursite.com navigates, for example, to blog.yoursite.com or yourshoppingcart.com, GA’s default behavior is to set new cookies on the user’s computer, causing yoursite.com to appear as the referring website to a new visit that starts on the new subdomain or top level domain. However, by adding the following simple customization to your Google Analytics tracking code, you can ensure that GA preserves the pre-existing set of cookies, and therefore the original referral information persists throughout the entire visit.

For tracking across top-level domains:

On your first domain (yoursite.com), add the following to your tracking code before the trackPageview() call (obviously replacing “yoursite.com” with your own domain):

pageTracker._setDomainName("yoursite.com");
pageTracker._setAllowLinker(true);
pageTracker._setAllowHash(false);

On your second domain (yourshoppingcart.com), add the following to your tracking code before the _trackPageview() call (obviously replacing “yourshoppingcart.com” with your own domain):

pageTracker._setDomainName("yourshoppingcart.com");
pageTracker._setAllowLinker(true);
pageTracker._setAllowHash(false);

Now, for every link that you have on either domain that sends a visitor from one domain to the other, add the following bolded code:

<a href="http://www.a-different-domain.com" onclick="pageTracker._link(this.href); return false;">

If you have forms that submit across top level domains, you’ll need to add the following bolded code to each of those as well:

<form action="http://www.a-different-domain.com/form-processor.php" onsubmit="pageTracker._linkByPost(this);">

For tracking across subdomains:

This is MUCH easier than the above.  All you need to do is add the following line of code to your tracking code that appears on all your pages, regardless of the subdomain they’re on, again making sure that it goes above the _trackPageview() call:

pageTracker._setDomainName("yoursite.com");

For both subdomain AND top level domain implementations:

Lastly, you’re going to need to set up a filter to apply to each of your profiles so that you can see which (sub)domains your visitors are viewing in your content reports.  To do this, you’re going to create an Advanced Filter like this:

Filter Type : Custom filter > Advanced
Field A : Hostname Extract A : (.*)
Field B : Request URI
Extract B : (.*)
Output To : Request URI
Constructor : $A1$B1

To illustrate what this filter does, let’s say that you have an “index.php” on both www.yoursite.com and blog.yoursite.com. By default, Google Analytics will take all the pageviews for “index.php” and aggregate them on one line of data in your content reports. The problem here is that you want to be able to distinguish between those two URI’s, because they are NOT the same! The filter above will take “index.php” and prepend the hostname to it, so you’ll end up with TWO rows of data in your content reports: “www.yoursite.com/index.php” and “blog.yoursite.com/index.php” – and now you can see who’s viewing what pages.

Note that this will change the URI’s that Google Analytics stores, and if you have goals configured to match your old URI’s, you must update those goals once you’ve applied this filter.

With this customization in place, you’ll eliminate one of the biggest sources of self-referrals. Here’s an example of how you’ll benefit. Let’s say you’re running a Google AdWords campaign. You’ll now be able to track your AdWords visitors (and spend) end-to-end on your site, without the risk of losing track of them due to self-referrals. This is critically important for evaluating and improving the performance of any source of traffic.

2. Track all your goals
This sounds basic, but a very large proportion of Google Analytics users don’t track any goals at all, and most GA users that do track goals will only configure one or two. Now that you can have up to 20 goals per profile, you should be tracking every single goal you can think of. To do this, have a brainstorming session and write down every reason you have a website. For example, if you run an e-commerce website, your shopping cart will most likely be your most important goal, but what about tracking goals like these?

  • Newsletter sign-ups
  • Email to a friend
  • Buttons to bookmark/subscribe
  • “Contact us” submissions
  • Internal search

You could also track goals such as video views, specific content views, social media interaction, RSS feed clicks, blog comments left, and literally hundreds more. Using new “threshold goals,” you can even track time on site and pages per visit as goals.

It’s important to measure all of the value that your site provides. These “microconversions” will give you a fuller view of the performance of your marketing efforts, which will in turn help you make better decisions.

3. Tag your campaigns properly
Tagging campaigns properly is critically important if you plan to use Google Analytics to evaluate the performance of your various marketing efforts. Without proper tagging, it’s nearly impossible to use Google Analytics to evaluate the performance of marketing channels like:

  • Yahoo! Search Marketing, Microsoft adCenter and other SEM platforms
  • Banner ads, text ads, and other paid placements
  • Offline media like print, television, radio, direct mail, billboards, etc…

You can very easily link your AdWords and Analytics accounts and have Google auto-tag your AdWords campaigns for you, but for any other marketing channel, you’ll need to get your links tagged yourself. We recommend that you develop standardized naming conventions before you start to tag or re-tag your campaigns; this will promote consistency and minimize confusion and headaches down the road.

For example, for paid search campaigns, will you use “cpc” or “ppc” as your medium? For campaign names, will you use flight dates (“feb2010”), target audiences (“nascardads”) or something else? Once you have a naming convention in place, you can use Google’s free URL Builder to input your tagging parameters and get your campaigns set to go. Of course, you can always tag your links manually too. In either case, here’s what a properly tagged URL might look like for a Yahoo! Search Marketing ad:

http://yoursite.com/?utm_source=yahoo&utm_medium=cpc&utm_campaign=widgets&utm_content=smallwidgets&utm_term=little%20widget

Notice that we’ve defined the source of the traffic (“yahoo”), the medium (“cpc”, denoting cost per click), and the name of the campaign (“widgets”).  We’ve also used the optional parameters content (“smallwidgets”, which in this case is the name of the adgroup) and term (“little widget”, in this case the keyword we were bidding on).

IMPORTANT: Third party tracking mechanisms or URL shorteners often strip out these parameters, so make sure that any redirects that occur before a user reaches your landing page accept query string parameters.  If you click on your own ad and you end up at a URL like the above, you’re all set.

Cleaning up self-referrals, tracking all of your goals, and tagging your campaigns correctly will help you quickly get more accurate and actionable data in your Google Analytics reports.

For more tips, tricks, and strategies, bookmark our blog, follow us on Twitter or attend one of our Google Analytics & Website Optimizer Seminars!



Nick Iyengar
Nick is a senior analytics and web intelligence analyst with WebShare. You can find out more about Nick here.

See more posts by Nick Iyengar