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:

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:

GA On Site Search Pt. 2: Reporting & Usage

October 16, 2007 by Justin Cutroni

Onsite Search Reports MenuThis is part two in a two part series about the new GA on site search reports. In part one I discussed the setup.

There is a tremendous amount of information in the new Site Serch reports about ow your visitors interact with your search engine. But it goes way beyond measuring how many searches occurred for a keyword. The new reports actually tie outcomes to searches providing insight into what product sand content your site visitors are looking for. But enough babble, on to the screen shots.

What Reports are Available

First and foremost there is the Usage report. This reports helps you understand if visitors are using site search. If you’re trying to push site search as a navigational tool for your visitors, and only 2% of site traffic is using site search, then your navigation may not be working. You may want to change the visibility of the search box.

Google Analytics On Site Search Usage Report

The Usage report is pretty good, but everyone wants to know what people are searching for. The Search Terms report contains all of the search terms that visitors entered into your on site search. One thing you should know is that GA is reporting UNIQUE searches. This means that duplicate searches, made in the same visit, are excluded. So it is not a count of how many times a term was search for, but rather how many VISITS contained a search for a specific term.

Google Analytics Search Terms Report

Take a look at the narrative at the top of the report. It contains a number of new metrics to evaluate on site search. Total Unique Searches indicates what search terms people are entering. % Search Exits indicates what percentage of visitors are leaving immediately from the search results page. This could indicate that visitors are unhappy with the search results. Time after Search and Search Depth indicate the engagement of the visitor after using search.

Google Analytics does not normalize the search terms. This means that misspellings and similar searches are not grouped together. So the search terms ‘red sox’, ‘red socks’ and ‘Red Sox’ would appear as individual line items. You’ll need to review your data and manually normailze it using filters.

Another really cool report is the Site Search Start page. This report shows where your site searches originated. It identifies the page that the visitor was on when the seach occured. This can help identify issues with navigation or the data architecture.

GA Search Start Pages

Now we know where people started their searches, but what about where they end up? The Search Destination Report shows which pages people navigate to directly from the search results page.

GA Site Search result pages

What’s really cool is if we click on a destination page that is listed in the above report we can see all the search terms that drove people to the page. Here’s what happens if I click on one of the results in the previous report:

GA search reports page terms
There are other reports that do a good job of illustrating how visitors use site search. If you select a search term in any reports you can do a really deep analysis using the analyze drop down. One option is the Search Navigation report. This report shows where someone started their search and where they went after the search.

GA Search Nav report

What about peple who search multiple times? Another analysis option is to use the Search refinement report. This report shows how people refine their search terms during their visit. So, in the image below, visitors began by searching for dog. Then they refined their search using one of the terms in the report.

GA Search refinement Report

Ok, one more thing about the Search Reports. Notice that the standard Goal Conversion and Ecommerce tabs exist on most reports. These tabs provide information about which searches lead to conversions and, if you’re an e-commerce site, the revenue that each generated. Pretty darn cool is you ask me.

GA Search Reports Conversion

What’s Missing

The one report that is missing from Google Analytics is the ‘0 Result’ searches. It’s really important to know what on site searches are producing 0 results. This is an indicator of missing site content. You can artificially create this data by creating an event or a pageview (I suggest event) in Google Analytics. I’ll write more about how to do this in another post. But be aware that the new reports to not contain this data.

In Summary

There is a ton that you can do with the new on site search reports. Not only can you analyze what people are looking for and optimize your content, but you can also identify how visitors integrate search into their visit.

Have fun with these reports!

Subscribe: