New and Improved GA.JS Documentation

December 13, 2007 by Justin Cutroni

Along with some other features, Google Analytics today launched Google Analytics Custom Tracking. This is a new website (code.google.com/apis/analytics/, a section of code.google.com) that deals with the Google Analytics Tracking Code. The site does a nice job of pulling together information about ga.js and Event Tracking. Plus it has a snazzy movie of Avinash, what a bonus!

While the new graphing features are nice, I think this is a very significant event. Google is really pushing Google Analytics and a data collection and analysis service, not just a web analytics tool. Sure, most of the data is generated via a web interface, but think of the proliferation of web-based applications and services.

Let’s not forget about Event Tracking. It’s not a rigid data structure that we have to adhere to. It is a flexible data model where we can define the data. It will work perfectly with web application.

I’d like to point out that the term API is all over this site. This has nothing to do with extracting data from Google Analytics. There is no API to extract data from Google Analytics.

Subscribe:

Surprise! New Google Analytics Features

December 13, 2007 by Justin Cutroni

It looks like the team at Google Analytics has surprised us all with some new features. What a great way to celebrate the holiday season. Many of these new changes were actually announced by Brett Crosby at Emetrics and are just now getting rolled out to all of us.

New Multi-Line Graph

Google has added a new features to help with analysis. It’s called multi-line graphing. We now have the ability to graph multiple lines of data in the data-over-time graph that appears at the top of each page. There are two ways to use this feature.

Google Analytics Multi-Line Graphing

First, you can compare two metrics in the graph. This is a great way to determine if there is a correlation between the two numbers. For example, let’s say you want to see if conversion rate stays the same if visits increase. Now you can do that.

Google Analytics: Graph two metrics

The second way to use the multi-line graph is to compare a specific segment of data to the overall site data. This helps you analyze how much the segment of data affected the larger set of data.

The graph below shows AdWords visits (blue) and the total site visits (gray). We can clearly see that there was a big bump in traffic but it was not caused by AdWords.

Google Analytics: Compare Data to Site Average

I’ll have a more in-depth post on this tomorrow.

New ga.js Tracking Code

The new ga.js tracking code is now live. For those of you that don’t know, Google created a new version of the tracking code that supports many new features, primarily event tracking.

The new tracking code is very different. Many of the functions that exist in urchin.js do not exist in ga.js. Things like urchinTracker() and __utmSetVar() are gone. Don’t worry, they’ve been replaced with new methods like _trackPageview() and _setVar().

You don’t need to migrate to the new ga.js, you can continue to use the old urchin.js. However, Google will not update urchin.js in the future. If you want to take advantage of new features you must upgrade.

Check out GA.JS: New Google Analytics Tracking Code for more information about why the basic page tag has changed, how it has changed and if you should upgrade to the new tracking code.

To help facilitate the transition, Google has published a migration guide to help you transition from urchin.js to ga.js. It’s a great resource that does a good job of mapping old tracking code settings to new tracking code settings.

How do you get the new tracking code for your site? For existing websites, there is a new tabbed interface that provides the urchin.js tracking code or the ga.js tracking code. Just click on the “Check Status” link for a profile and you’ll see the tabs. Google will automatically supply the new ga.js tracking code when you create a new profile.

Google Analytics Tracking Code Tabs

Caution: do not use the new tracking code and old tracking code on the same page. However, you can use the new tracking code on some parts of your site and the old tracking code on other parts of the site.

Subscribe:

Google Analytics: Thoughts on the Future

December 4, 2007 by Justin Cutroni

I am continuously amazed at how fast our industry changes. In the two years since Google Analytics was launched we’ve seen Web Analytics grow in popularity and web analysts become highly prized in the marketplace. Many people attribute the change to Google Analytics which got me thinking about GA and how it may evolve in the future.

I’d like to mention that this post is purely opinion and speculation. I have no idea what Google’s master plan is for Google Analytics, but I do think that my ideas are possible.

picture-6.png

Let’s start by looking at where Google is going as a business. Google’s long term strategy is to become the dominant advertising network on the planet. It’s something that CEO Eric Schmidt has talked about in the past and it make total sense. The more advertising options that Google can offer it’s current customers the bigger the opportunity for growth.

Google’s success relies on the adoption of said advertising tools. Look at AdWords and the insane revenue it generates. Now image if Google could create 3 or 4 more advertising products that are as successful as AdWords. We’ll be looking at Berkshire Hathaway stock prices in no time.

The expansion of Google’s advertising platform began with audio ads and print ads and I’m sure they’re not going to stop there. These new products are simple, thus making them accessible to businesses that may not normally branch out into a new advertising medium. I’ll talk about specific Google advertising products and my thoughts on each in a moment, but what does all this mean to Google Analytics?

No matter what advertising tools Google creates, there needs to be a centralized reporting and analysis component. GA is that piece of the puzzle. It’s no secret that Google wants to create the Google Marketing Dashboard, why not base it on Google Analytics? It makes complete sense, right? GA is a data analysis tool so why not use it to analyze all marketing data? At the very least GA should be the analysis piece of the puzzle.


That’s the long term vision, but what type of integration opportunities exist right now?

The most basic integration is the inclusion of advertising cost data into Google Analytics. Audio cost data, print cost data… it’s natural to think that these will be pulled into GA soon.

The next integration step should be the automatic identification of online traffic that originated with an offline ad. Image if you could automatically create vanity URLs for your audio or print campaigns and have GA automatically track them. We’re already doing this manually, but it could, and should, be automated by Google. This type of integration will further remove IT from the configuration of GA making it easier for all types of organizations to track offline marketing efforts.

Let’s get even more specific.

Google AdWords

picture-1.pngNo need to talk much about this one. Google is the 800 pound gorilla in the paid search world. AdWords campaigns are automatically tracking in Google Analytics and cost data is automatically imported to compute ROI. Pretty slick. It would be nice if Google could pull in cost data from other paid search vendors, but there are probably too many political hurdles for this to happen.

Google Audio Ads

picture-2.png
I mentioned this one above and wrote a post about tracking audio ads with Google Analytics it in the past. I think audio integration is pretty logical. Beyond the cost data, I would like to see some type of map overlay report correlating geographic web traffic and the distribution of audio ads. The addition of automatically created vanity URLs for audio ads would provide a slick way to connect online conversions to the originating audio ad.

Google Print Ads

picture-3.png
Print is very similar to audio and I think it’s something we could see soon. Many of the same integration points exist for print ads including cost data, a map overlay of ad distribution and web visits and an automatically created vanity URL for print ads.

Graphic (Banner) Ads

This is another one that could be very close. Once the purchase of DoubleClick is finalized I bet we’re gong to see DoubleClick’s pre-click data rolled into GA quickly. Maybe they’ll add a DoubleClick item to the Traffic Sources menu below the AdWords menu item.

I think we’ll also see an auto-tagging feature for ads displayed on DoubleClick’s network. No more tagging destination URLs. Woo hoo!

Mobile

picture-7.png
Everyone loves to talk about mobile tracking. But the fact is that mobile tracking right now is miserable. The inconsistent implementation of JavaScript on mobile devices makes it very hard to track visitors on mobile devices.

Google has taken a big step to improve mobile tracking with the announcement of Android. This isn’t just a mobile browser, it’s a complete platform for mobile devices. It’s also a way that Google can insure that they’re very involved in the future of the mobile web. I’m sure that Google will include some type of mechanism in Android to track visitors.

Video (Google Video & YouTube) Ads

picture-8.png
Google is poised to provide some amazing data about how people interact with video. The new Google Analytics Event tracking feature is a logical, structured way to measure visitor engagement with video and video ads. I really hope that event tracking is added to all YouTube videos so we can all measure the performance of video content. Once we know how visitors are engaging video we can choose optimal placement of video ads.

I also expect Google to facilitate the creation of video ads in the same manner they did with audio ads and print ads. Maybe they’ll create a video ad marketplace.

Email Marketing

Google does not have an email marketing solution, but why couldn’t they leverage Gmail and create one? Just add a basic interface where users can upload a recipient list and some type of interface where they can style the email and you have a very effective email marketing tool.

But what about all of those people that don’t use Google advertising tools? What if someone just wants to use GA to measure website traffic? What cool features can they expect from Google?

I think Google’s commitment to GA goes well beyond the integration of advertising data. Google has a vested interest in providing tools that help EVERYONE make the web a better place. Part of Google’s philosophy is to, “Focus on the user and all else will follow.”

Analytics is one of the tools (and the most mature, I might ad) that Google provides so we can all make the web better (Website Optimizer and Google Trends are two others). The more analysis features that Google can pack into GA the more effective we’ll all be at making our sites better.

picture-5.pngCase in point, GA version 2. It was a major improvement in analytics UI design that facilitates analysis. Is it perfect? No, of course not. But it really makes analysis easier for everyone. I expect that Google will continue to refine the reporting interface by giving us more data visualization tools and more context for our data.

So what does this mean to other analytics vendors?

I don’t think that any other analytics vendor will be able to track Google based advertising (AdWords, Audio ads, etc.) as well as Google. I know that seems obvious, but it is a big deal, especially when Google becomes the major advertising network on the planet. Google can provide a view of offline ad activity and the resulting online behavior because they will have all the data. Could other providers create similar reporting? Maybe, but it won’t be as easy.

I also believe that we’ll continue to see consolidation. Google has, in my opinion, made web analytics tools (and testing tools) a commodity. Is there still a need for $250,000 web analytics application? Maybe, but I guarantee you people are taking a closer look at GA and evaluating the features that they really need before dropping hundreds of thousands of dollars.

Think I’m nuts? Think OmniSciences will take over the world? Leave a comment and let me know.

Subscribe:

UPDATED: GA On Site Search Setup

November 17, 2007 by Justin Cutroni

I’ve updated my post about setting up Google Analytics On Site Search Reporting. Since its launch I’ve learned a few new things and wanted to pass on the information.

For example, you can’t use filters to change the data in the reports. That’s a HUGE problem because we have no easy way to manipulate the data in the reports. Also, if you configure on site search to strip the on site search query string parameter you could artificially inflate pageviews for some pages. Now that’s trouble! You can read the complete post here:

GA On Site Search Pt. 1: Overview & Setup

If there’s anything I missed, or if you have any questions, please leave a comment.

Subscribe:

New Google Analytics Features & Announcements

October 16, 2007 by Justin Cutroni

Today Google announced a number of new features for Google Analytics. I’m really excited about these features because they will greatly improve our ability to understand our site site visitors and what they want to do. You should know that this is a true beta. Google is taking signups for the new features and they should be rolled out to beta testers soon.


Links for More Information

It would be impossible to thoroughly explain each feature in a single post, so I’ve written a number of articles to cover everything you need to know.

GA.JS: New Google Analytics Tracking Code
GA On Site Search Pt. 1: Overview & Setup
GA On Site Search Pt. 2: Reporting & Usage
GA Event Tracking Pt. 1: Overview & Data Model
GA Event Tracking Pt. 2: Implementation
GA Event Tracking Pt. 3: Reporting
Urchin 6 Software
Automatic Oubound Link Tracking

New GA.JS Tracking Code

The first big change is a new version of the Google Analytics Tracking Code (GATC). The new code is object oriented, has a smaller file size and enables a number of features. The old tracking code is not going away (yet), so you don’t need to rush out and change all the tags on your pages. But you may want to given the next announcement…

Event Tracking

Google Analytics now supports Event tracking. A lot of people have been asking for it and now it exists. Google changed the GATC to enable event tracking.

You can now use Google Analytics to logically track anything, like video player interactions, visitor clicks, etc. The beauty is that you no longer need to create extra pageviews. Google has created a logical data model to help understand visitor actions and intent. I must admit, when I first heard that they were adding Event tracking to GA I was skeptical, but this feature is completely awesome! It is really well done.

Internal Site Search Reporting

The next addition is a series of reports that focus on internal site search. These reports provide a structured, logical way to evaluate the value of your onsite search. I’ve been testing these reports for a while and they are truly remarkable. I can’t tell you how much insight I’ve gained into site visitors by using them. Setup is really easy and I think everyone is going to like them. Note that the search reports are not related to, or affected by, the new tracking code.

Urchin 6 Software

And finally, Google announced a new version of Urchin software. Urchin 6 will be available in beta form starting October 22. For those of you unfamiliar with Urchin, it is a log analysis tool. You install it on your server, it crunches your log files and produces pretty graphs. Urchin 6 is a complete upgrade from Urchin 5. It has a new data processing engine and a new interface. It’s NOT using the current GA interface, it’s using the OLD GA interface. But it is a huge upgrade.

Subscribe:

Automatic Outbound Link Tracking

October 16, 2007 by Justin Cutroni

With the release of the new GA.JS tracking code Google Analytics now supports automatic outbound link tracking. No more adding urchinTracking() to links!

In order to get outbound link tracking to work you need to migrate to the new ga.js.

I don’t have any reports to show you, but hope to have some soon.

Subscribe:

Event Tracking Pt. 1: Overview & Data Model

October 16, 2007 by Justin Cutroni

One of the major new features announced by Google at the EMetrics summit is event tracking. There has been a lot of discussion in our industry about tracking events and only a few vendors offer this feature. I believe that Google is the third. Anyway, this post gives an overview of the new feature. Part 2 covers the actual implementation and part 3 covers the reporting.

What Are Events

an engaged visitorEvents are actions that visitors take on a web page that don’t generate new pageviews. Interacting with a video player, a widget or an audio player are all common events. Tracking these interactions provides a lot of insight into what visitors are doing on a page.

In the old GA we could track this data as a pageview. But this was really ineffective. First, it created lots of pageviews that polluted our true pageview numbers. Second, the reporting wasn’t built to handle events so it never provided any real insight. That’s why we now have event tracking.

Event tracking adds another layer of data to the visitor data hierarchy:

Visitors
Visits
Pageviews
Events

Now we can really get a good idea of how visitors are engaging our interactive content. This will be vital as web technologies, like Ajax and Flash, continue to evolve.

Every time an event occurs GA will increase the event counter. So if we’re tracking the click button event, GA will show us an agregate count of the clicks. I’ll cover the reporting in Part 3.

Start With Business Questions

Before I get into the structure of event data, I want to talk about analysis. All analysis starts with a business question. What is the most popular organic keyword that visitors searched for? How many sales did I have last week? What was the revenue for a specific campaign? Normally, when you’re using GA, you don’t need to do any special configuration to answer these questions. GA does most of it for you.

But with events, you need to create ALL of the data that will end up in GA. You literally need to define what data you want GA to collect both in name and in value. If you don’t know what business questions you want to answer, you won’t be able to create the correct data.

As I continue this post, I’m going to use an example, Google Maps. If I was an analyst for Maps I would want to answer a lot of questions:

How many people use the zoom and do they zoom in or out?
Which map view is most popular: map, satellite, hybrid, etc.
How many people drag a map waypoint to a new location?

To make things easy, let’s focus on one question: which map view its the most popular. So now that we know the question we want to answer, let’s talk about the data we need to answer it.

Understanding the Data Model

There are 4 parts to the events data model:

Objects
Actions
Labels
Values

Objects

Objects are parts of pages that we want visitors to interact with. This may be a video player or a cool Ajax widget. To continue our example, the object would be ‘Map’. Remember, the business question we want to answer concerns a feature in the map.

Actions

20071015-actions.pngThe second part of the data model is Actions. Actions are attached to an object and represent the actions that visitors perform on our object. Actions tell us what the visitor did.

There can be lots of actions associated with an object. Just think about our map. There are so many things that a visitor could do. But we want to define actions that relate directly to the business questions. Here are a few actions that our Map object might have:

Zoom
Change view type
Drag waypoint

Because we’re focused on one business question, we’re going to focus on one action: ‘Change view type’.

Labels

Labels quantify the action that occurred. If the actions tell us what the visitor did, the value tells us the result. So, for the ‘Change view type’ action that I created above, I might have the following labels:

Satellite
Map
Hybrid
Street view

Labels are really important to understanding actions. If an actions only has one value it does not provide any insight into what the visitor did.

Values

The final part of the data model is Values. Values are optional but can provide a lot of insight into certain events. Values can be any type of numeric data that indicates the value of the action and label. While there are not may good values for our example, let’s assign a monetary value to each label. Who knows, maybe someone viewing a hybrid map is worth more than someone viewing a regular map:

Satellite 5
Map 10
Hybrid 15
Street view 20

Values can also be monetary making it easy to identify what actions have real value.

Pulling it All Together

So let’s look at our business question and the data model we’re going to use to answer it.

Questtion:
Which view type do people use more?

Object:
Map

Action:
Change view type

Labels & Values:
Map 5
Satellite 10
Hybrid 15
Street Level 20

The next step is to implement the data model using event tracking code. That’s covered in Part 2. Oh, if the Google Maps team is reading, call me. I’m more than happy to lend a hand. :)

Subscribe:

Event Tracking Pt. 2: Implementations

October 16, 2007 by Justin Cutroni

In this post I’m going to discuss how to implement event tracking in Google Analytics. If you have not read part 1, I strongly recommend you do so because I reference Part one extensively. When we implement event tracking we add code that creates the data model we defined in Part 1. We’re going to continue our example of tracking an event in Google Maps. We want to find out how which map view people use most.

The Data Model

If you remember part 1, I created a data model for our event data. This will help us answer our business question and it will help use create the code.

Tag Your Pages

I know this seems simple, but the first step is to make sure your pages are tagged with the GA tracking code. Remember, this only works with the new ga.js tracking code.


<script type='text/javascript'>;
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._initData();
pageTracker._trackPageview();
</script>

Creating The Object

The first thing we need to do is create the object that we want to analyze. To create a new object we use a method name _createEventTracker(). We pass this method a value and that value is the name of the object we defined in the data model. Our object is called ‘Map’ so let’s use ‘Map’ in the name:

var mapEventTracker  = pageTracker._createEventTracker('Map');

When we look at the reporting interface we will see ‘Map’ in the Objects report. Pretty straight forward, huh?

This code must appear after your GA page tag. The reason is that the _createEvent Tracker() method is attached to the pageTracker object. In this example, I’m going to place it in the same block as the regular tracking code:


<script type='text/javascript'>
// Here’s the standard page tag stuff
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._initData();
pageTracker._trackPageview();

// Here is the new event object
var mapEventTracker  = pageTracker._createEventTracker('Map');
</script>

Tracking the Action

Now that we have an object, how do we track an action associated with that object? We add JavaScript to our page code when the action takes place. So, with our Maps example, we would add some code when the visitor clicks on the button to change the Map view type. Here’s how that code might look:

onClick="mapEventTracker._trackEvent('Change Map View', <label>, <value>);"

<label> and <value> should be replaced with one of the labels we identified in our data mode:

Map 5
Satellite 10
Hybrid 15
Street Level 20

What happens when a visitor clicks on a map button is that the code sends the action, label and value to GA and associates it with the map action we defined above. Now you can see how our data model really drives the implementation.

Tracking Multiple Objects

Ok, so here is something that’s pretty cool. Let’s say the map team wants to add two different maps to a single page. We can track both of them using the same map object. We would then differentiate what the visitor does using different labels. The actions would remain the same for both objects, but we’d have different labels.

A Final Note

I’d like to say that every implementation for event tracking can be different. It really depends on the business questions you need to answer and the structure of your pages. I think this post does a very good job of covering the basics, but your specific implementation will probably be a bit different… Unless you’re Google Maps. :)

As we’ll see in the next post, the new Event reports provide a logical structure for analyzing event data.

Subscribe:

Event Tracking Pt. 3: Reporting & Analysis

October 16, 2007 by Justin Cutroni

This is part three of a three part series about event tracking in Google Analytics. You can find more information in these other posts:

Event Tracking Pt. 1: Overview & Data Model
Event Tracking Pt. 2: Implementation

I wrote this post before having access to the new events reports. As a result, I don’t have any screen shots for you guys! Sorry I don’t have anything to show you guys, but I will try to explain as much as possible.

The new event reports section will have specific reports for objects, actions and labels. If you have not read my post on the event data model then I strongly suggest that you do so. The data model is the driving force behind the structure of the reports.

Event reports will let you see summary information at an Object level, action level and value level. Here’s an example using Google Maps. If we create a ‘Map’ object then we will get a unique count of how many times the map object has been created. We can then drill into that event and see the actions and values of those actions.


Map
|_ Click Map View
|_ Satellite
|_ Hybrid
|_ Map
|_ Traffic
|_ Street view

This drill-down functionality is very similar to the drill down that you can do with campaign tracking.

The interface will also show you the values of each label. Remember, Satellite, Hybrid, Map, Traffic and Street view, are all labels and they have an associated value. GA will total up the value and show a unique count of how many times each action happened, the total value and the average value.

This is fantastic information because we can now measure what people are doing on our media rich pages. We no longer need to rely on Average Time on Page to gauge the success of our content.

I know this is really high level, and I’m sorry I don’t have any screen shots, but I’ll try to get some soon. Hopefully you got a taste of what is possible with the event reporting.

Subscribe:

GA On Site Search Pt. 1: Overview & Setup

October 16, 2007 by Justin Cutroni

Google Analytics Site Search MenuThis is part 1 in a two part series about tracking on site search with Google Analytics. In this post I outline the setup and configuration you need to perform to create accurate, usable data in the new reports. If you’d like to get a look at the reports, you can skip to part 2, where I talk about the reports and how to use them.

How to Set It Up

The new search reports are based on a query string parameter that contains the search term that the visitor entered. All you need to do is specify the name of the parameter in the profile settings. As GA processes the data it identifies the search term and builds the reports.

It is important to note that on site search processing happens BEFORE filters are applied. This means that we have no way to modify the way that search data appears in our reports. I personally believe that this is a mistake and it limits our ability as practitioners to generate the data that we need for analysis. I’m hoping that Google can somehow change this.

Basic Setup

The first thing you need to do is turn on site search reporting. This is easy, it’s an option in the profile settings (please see the image below).

Next, you need to tell Google Analytics which query string parameter contains your search term. The best way to identify the query string parameter is to do a search on your site. If I do a search on my site for ‘world series’, and the search results page URL looks like this:

http://www.website.com/search_results.php?q=world+series

then I would add ‘q’ to the search term field. Pretty simple, huh? The query string parameter goes in the ‘Query Parameter’ field (again, located in the profile settings).

Google Analytics Site Search Configuration

You’ll notice that I’ve added two query string parameters in my example. The epikone.com website has two different search engines. You can define up to 5 parameters. This gives you a lot of flexibility if you are using multiple on site search engines.

Category Setup

Many search engines allow users to refine their searches using categories. For example, if I search for ‘lavender’ the search engine might let me focus my search in the ‘soaps’ category or ‘tea’ category. This configuration drives a specific report that show the search terms for each category.

Setting up the categories is the same as setting up the search terms. All you need to do is identify the query string parameter that identifies the category. In the following example I would enter ‘cat’ in the Category Parameter field.

http://www.website.com/search_results.php?q=lavendar&cat=soap

Adding Categories to Google Analytics Site Search

Other Options

There is one final setting that is very important. You may have noticed the radio buttons for strip query parameters out of URL. This setting will remove the on site search query string parameter from the URL after on site search processing is complete. This means that the query string parameter, and the search term, will be removed from ALL other reports. It’s very much like the exclude query string parameters setting in the profile settings.

If you choose yes, GA will consolidate pageviews for the search results page. This can be good and bad.

Here’s an example. If you do a search on my blog the URL will look like this:

http://www.epikone.com/blog/?s=world+series

Now, if I choose to remove the query string parameters GA will process the site search and then merge the resulting URI with all other instances of

/blog/

As you can see this is going to INCREASE the pageviews for /blog/. Is that good or bad? In the case of my blog it’s a bad thing because /blog/ is also the homepage. Removing the query string parameter will artificially inflate pageviews for the homepage.

However, if your on site search engine has a specific results page, like:

http://www.site.com/seach-results.php?q=world+series

Then removing the query string parameters is a good idea. The reason is you’ll have a single line item for your search results page in your reports and you’ll still be able to analyze on site search data using the On Site Search reports.

Common Problems

What if your on site search results page does not contain the search term in the URL? This is usually the case if your search form is using the POST method.

The workaround is to alter the way the search results pageview is created. This means manually creating a pageview for the search results page, that contains the search term. This is done by passing the tracking code on the search results page a value. Make sure that value includes a query string parameter containing the search term. Then specify the query string parameter in the on site search setup.

Here’s how you can modify the tracking code on the search results page to resolve this issue:

Old urchin.js implementation:
urchinTracker('/blog/search?q=<term>');

New ga.js implementation:
pageTracker._trackPageview('/blog/search?q=<term>');

Where <term> is the search term.

NOTE: If you haven’t heard, there is a new GA tracking code. You can read more about it in this post.

Optimizing the Setup

One thing that I’ve noticed is that the reports do not massage the data in any way. They report the raw keywords that the visitor entered. It’s great that we can see raw data, but it’s very easy to have duplicate data based on capitalization or spelling. Here’s an example. The following terms would all appear as different line items in the search reports:

Red Sox
red sox
redsox
red socks

From an analysis standpoint, the above terms are all the same. Visitors are searching for information about ‘red sox’. A certain amount of normalization would help, but we don’t want to eliminate too much data. Unfortunately the site search processing happens BEFORE filters, which means that we can not use filters to modify the data. I had initially thought we could use filters, but that is not the case.

Any data normalization MUST be programatic, it can not be done with filters! So, if you want to force all of your search terms to lowercase you must modify the page tag on your search results page. Specifically, you need to change how the pageview is created in GA. Here’s a sample piece of code that will force the query string parameters to lower case. You’ll need to update the tracking code on your search results page.

New ga.js code:
pageTracker.trackPageview(document.location.pathname + document.location.search.toLowerCase());

Old urchin.js code:
urchinTracker(document.location.pathname + document.location.search.toLowerCase());

This code change will eliminate all duplicates caused by capitalization.

Unfortunately there is no easy way to remove duplicates caused by misspelling. If we could only use filters… :)

Other Uses

What I find interesting is that this framework can be used to track other things. For example, let’s say you have an online ticketing service and the search feature passes certain search characteristics via the query string. I perform a search for tickets to see the Red Sox play at Jacob’s field. I specified the price range of the tickets and the date of the game. The URL might look like this:

http://www.tickets.com/search?price=100-200&date=20071014-20071016

What if I configure the new search reports to use price as the search field and data as a category? The reports should show me some really cool information. I haven’t tried this yet, but it could be very useful.

Subscribe: