I’m going to admit to something when it comes to Google Analytics. Don’t be mad.

I wasn’t using the site search tools available inside GA. We have a Google Mini we use at my campus, and it does reporting, but I wasn’t using the site search stats inside Google Analytics until this past week.

Last week, we relaunched our internal news site, Inside JCU, as a nice, fancy responsive site. One of the goals I had for this relaunch was to do better tracking of what our campus users were reading, clicking on and searching on.




We use WordPress as our CMS at JCU, and while far from perfect, the built-in search is good enough. When a user searches, WordPress using a URL structure like this:

http://inside.jcu.edu/?s=term

That query variable makes tracking site searches from WordPress in Google Analytics very easy.

Step 1:

Login to Google Analytics and go to the Admin button. Find your property and select the view you want to edit.

Google Analytics Admin Screen

Click for a larger version

Step 2

Click on the view settings link for that property. One that page is loaded, scroll down and find the site search area. If the slider is clicked to off, click on. Here’s what that looks like:

Google Analytics Site Search Button

Once clicked on, you see some additional menu items appear. They look like this:

Google Analytics Site Search Options Turned On

The only other field we need to worry about here is query parameter. This is the variable your CMS or search tool sends to signify its a search query. For WordPress, this is super simple, just enter the letter s in that box. That looks like this:

Google Analytics Site Search Variable Entry

That’s it, you’re good to go. Give Google Analytics a day or so to gather up some search terms and you have data on what your users are searching for. You can ¬†use that data to determine if you’re having navigation issues, content strategy and much more.

Can you tell when we turned on site search tracking?

Google Analytics Site Search Graph

As part of our rollout of WordPress as our CMS, we’ve given our users several custom post types, allowing them to create and manage assets such as rotating display banners and graphical link buttons. We want to be able to easily track actions on these banners and buttons, and want to be able to see that information easily in Google Analytics.

One of the new features in the newer versions of Google Analytics (GA) is the ability to track event actions on a link. This can be not only clicks, in our case, on a button, link or graphic, but you can setup javascript triggers when a user starts, stops or pauses a video, for example.

Setting this up is pretty straightforward. First, you’ll need to add a quick snippet to your GA embed code, if you aren’t already. It’s the trackPageview function. You’ll add it under the line in your GA code where you’re account code is. For example:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

That will allow you to start tracking events on your pages. To add the event tracking action to a specific element on your page, you add a line of code that looks like this to your a tags.

onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby's First Birthday']);"

There are three fields there to pay attention to. The first is the category field. In the above example, it’s Videos. You can have multiple categories on a certain page. On our WordPress sites, we’re specifically tracking banners and small image buttons, often on the same page.

The second field is the action variable – which in the example above is Play. For our WordPress pages, we use the term Click. Through javascript and PHP variables, you can make your actions very specific, such as:

_gaq.push(['_trackEvent', 'Videos', 'Play - Mac Chrome');
_gaq.push(['_trackEvent', 'Videos', 'Play - Windows Chrome');

And finally, the label. Above, it’s Baby's First Birthday. For our uses, we tailor this to the specific banner or button getting clicked. After a few days, we realized it would also be good to know what site the visitor was on. As with the other fields, this should be tailored to the specific content being clicked on. In the video example, you’d have something like this for different videos being played:

_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
_gaq.push(['_trackEvent', 'Videos', 'Play', 'Huckleberry Finn']);

To our user, our links look like this:

<a href="http://sites.jcu.edu/newsroom/?p=1697" onClick="_gaq.push(['_trackEvent', 'Taters', 'Click', 'Princeton Review Best in the Midwest (Site: JCU Newsroom ID: 1694)']);">
<img src="http://webmedia.jcu.edu/newsroom/files/2011/08/princeton_review-700x230.jpg" alt="Princeton Review Best in the Midwest" />
</a>

In our WordPress templates, it looks like this:

<a href="<?php echo $url; ?>" onClick="_gaq.push(['_trackEvent', 'Taters', 'Click', '<?php echo get_the_title($ID)." (Site: ".get_bloginfo('name')." ID: ".$id.")"; ?>']);">
<img src="<?php echo $img[0]; ?>" alt="<?php echo get_the_title($ID); ?>" />
</a>

We are tracking the individual banner that was clicked on, as well as the site the banner appears on. We add an additional field for our own, the actual ID of the banner asset. We do that just in case we need to find one quickly, or two banners get named the same thing. It’s happened.

That gives us a very nice report in GA that looks like this:

We can very easily filter by a specific site to see what buttons and graphics are getting clicked on. You could also add this to any static link as well, but I’m specifically interested on what specific calls to action are getting noticed by our users.

NewImage.jpgI’m a big fan of Google Analytics. Nay, I’m a huge fan.

It’s become a key tool for measuring all sorts of data for my university’s website. They weren’t tracking much with it before I got here, save general traffic and trends, and now just about everything we do has a campaign attached to it, as well keywords and medium. It really has allowed us to see, especially with our online advertising efforts, what’s working and what’s not.

This data is shaping our goals and processes as we redesign and roll out a CMS. Real data, such as what you get from Google Analytics or other tools such as Webalizer that parse your actual server logs, is always the best tool to use.

If you use other sites like Alexa or Compete as your traffic monitoring tools, you’re getting a decent idea of traffic, but it’s not real data. Why? Because those sites use a small sample of the total web, not all the visits your site gets.

Alexa, for example, gets its data from users who have installed its toolbar. I haven’t installed that toolbar. Have you? It follows that Alexa uses a relatively small sample size to make its best guesses as to how the rest of the web surfs. Same goes for Compete.com. Small sample size doesn’t yield accurate data.

Here’s why this data is inherently flawed.

This past Friday, I went to Alexa and got the traffic rankings for this website as well as my University. First, my blog:

Alexa has this site with a 107,164 ranking, and it says its the 54,714th most visited site in the US. Not bad, eh?

Screen shot 2010-07-23 at 2.51.33 PM.png

Now let’s look at the stats for John Carroll University. Alexa gives it a rank of 220,515 and says its the 59,545th most visited site on the web.

Screen shot 2010-07-23 at 2.59.08 PM.png

Wait a minute. That’s not right. This site absolutely does not get more visitors and page views than John Carroll University. I know because the real data proves it. JCU does traffic twenty to thirty times what this blog does.

Compete gets it a little better, but its still a guesstimate, since its not measuring real traffic.

One other site that people use is Quantcast. It too makes its own best guess, but with a twist. If you want, you can sign up with Quantcast and install a little javascript bug on your site and Quantcast will measure real traffic data for your site. Here’s the Quantcast report for this site, with real data.

The point is if you want to do benchmarking of your site with other sites, use real data. I know that we don’t always have access to web stats and data from say, our respective comparison group of schools, but that’s changing. The first place this is changing is in Google Analytics.

From inside Google Analtyics, you can do some benchmarking of your site’s traffic against other sites of similar size. Google describes it as:

Based on the number of visits each site receives, sites of similar sizes are grouped together under three classifications: small, medium, and large. This way, you can compare yourself to other similarly sized sites. You are not able to view benchmarking data for sites in other size classifications.

This type of benchmarking is somewhat helpful, but there’s no telling what type of sites you’re looking at. They could be blogs, corporate sites or e-commerce stores. What we need is to be able to drill down.

If you open the category list on the benchmarking page, you can drill down a few levels to select education. To see the “colleges and universities” section, choose Law and Government, then Education and then College and Universities. Once you do that, you will see benchmarking data that’s quite a bit more relevant. You can now benchmark against college sites of a similar size. You don’t know who they are, or if they’re in your comparison data set, but its better than using Alexa’s or Compete’s best guess.

The other big thing I’m looking forward to is Karine Joly’s Higher Ed Analtyics project, which she’ll be kicking off at the EduWeb conference this week. She’ll be collecting key metrics from higher ed institutions and sharing that data. That means we’ll be able to benchmark against real data from other schools, not best guesses. I sat in on a talk that Karine gave about this a few weeks ago at the EduComm conference and I’m really excited to see what comes of it.