Adding Business Data to Google Analytics Data

I know the past week has been full of Google Analytics news, but I’m excited to tell you about something one of our team members created: Google Analytics Notes.

For a long time we’ve wanted to add business data to GA to help keep track of marketing activities, industry news and GA configuration changes. These things are critical to know when analyzing data as they add more context and help us understand what’s affecting website performance.

We tried using Google Spreadsheets to store business info but it never worked. People did not take the time to open up a spreadsheet and add information. We figured that adding some type of ‘note’ functionality to GA would be the easiest way to change this behavior. That’s how GA Notes was born.

GA Notes is a Firefox extension that lets you add business data to a profile. Notes appear in a concealable table at the top of every report.

Any GA user who views a profile, and has the Firefox extension, will see the notes entered for the profile. You can add notes, edit notes and delete notes. Notes can also be exported in XML format for archival purposes.

Installation

Installing GA Notes is easy. Just download the following file to your computer:

https://ga-notes.appspot.com/ganotes.xpi

Once downloaded double click on the file. Firefox should open and ask if you want to install the extension. Click install and that’s it. You’re ready to start adding notes to your GA data.

Usage

The extension adds a ‘Show Notes’ button in the GA menu bar. Click on the button to view notes for this profile or to add a note or edit/delete an existing note. It’s not that complicated. :) We wanted to keep this easy and flexible.

How it Works

For those of you that are interested, GA Notes runs on Google’s App Engine. No data is stored on your machine or our servers. It’s stored on Google’s servers. The Firefox extension provides the interface to enter and display data. But all of the processing and data storage happens on App Engine. All data sent to App Engine is encrypted prior to transmission.

In a perfect world we would have added notes to the data-over-time graph at the top of each report. However, we can’t get inside that part of GA using a Firefox extensions (or Greasemonkey script). We thought this was a good compromise. If anyone out there knows how to dig into Flash let us know! :)

Road Map

This is obviously a beta version of the software. We have a number of features that we’re working on and hope to have done soon. These include:

  • Sorting and searching notes by date
  • Excel friendly export
  • An admin flag for notes to separate admin changes to your GA account
  • Some type of alert to show you how many new notes have been added since your last login
  • A more graphical visualization of note

If you have any suggestions or ideas please let us know!

Credit

I don’t have the smarts to build these types of things, I just know enough to be dangerous. Chris, a new member of our team, built GA Notes from the ground up. Thanks Chris for all the hard work.

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

Google Analytics Compliance with WAA Standard Metrics

Following the lead of Dennis Mortensen (founder of IndexTools, Director of Insights at Yahoo!, WAA board member and all around good guy) I’ve decided to identify just how compliant GA is with these standards.

Below is a list of all standards defined in the WAA metrics definitions document and GA compliance with each definition. GA is compliant with 19 of the 26 metrics. Most of the non-compliance is due to the fact that GA does not offer all the metrics that the WAA defined.

Compliant Term WAA Definition GA Definition
Yes Page

A page is an analyst definable unit of content.

Same as WAA

Yes Page View

The number of times a page (an analyst-definable unit of content) was viewed.

Same as WAA.

Note: A pageview is created each time the _trackPageview() method is executed. Any value passed to the _trackPageview() method will appear in the Content reports, thus making a Page analyst definable.

Yes Visits/Sessions A visit is an interaction, by an individual, with a website consisting of one or more requests for an analyst-definable unit of content (i.e. “page view”). If an individual has not taken another action (typically additional page views) on the site within a specified time period, the visit session will terminate. Same as WAA.

Note: By default, a visit will terminate after 30 minutes of inactivity by the visitor. The legth of inactivity can be modified by altering the Google Analytics tracking code.

Yes

Unique Visitors

The number of inferred individual people (filtered for spiders and robots), within a designated reporting timeframe, with activity consisting of one or more visits to a site. Each individual is counted only once in the unique visitor measure for the reporting period.

Same as WAA

Note: Google Analytics defines this term as Absolute Unique Visitors.

A visitor is defined using a unique numeric identifier stored in the Google Analytics tracking cookies. This value is set when the visitor’s first visit is created.

Each visitor is counted only once in the Absolute Unique Visitor metric, regardless of how many times they return to the site during the reporting period.

Yes

New Visitor

The number of Unique Visitors with activity including a first-ever Visit to a site during a reporting period.

Same as WAA

Note: While GA does share the same definition for a new visitor it does not does not count the number of new, unique people (visitors) that have visited the site during the reporting period. GA counts the number of VISITS generated by new people.

Google Analytics calculate the number of New visitors by identifying the number of new unique visitor IDs that were created during the reporting period.

It is possible to measure the number of new visitors using a profile and include filter.

NO

Repeat Visitor

The number of Unique Visitors with activity consisting

of two or more Visits to a site during a reporting period.


N/a

This metric does not exist in Google Analytics.

Yes

Return Visitor

The number of Unique Visitors with activity consisting of a Visit to a site during a reporting period and where the Unique Visitor also Visited the site prior to the reporting period.

Same as WAA

Note: While GA does share the same definition for a return visitor it does not does not count the number of returning unique people (visitors) that have visited the site during the reporting period. GA counts the number of VISITS generated by people coming .

GA identifies a return visitor as any visit generated by a person who’s unique identifier cookie was set prior to the reporting period.

Yes

Entry Page

The first page of a visit.

Same as WAA
Yes

Landing Page

A page intended to identify the beginning of the user

experience resulting from a defined marketing effort.

Same as WAA

Yes

Exit Page

The last page on a site accessed during a visit, signifying the end of a visit/session.

Same as WAA

Yes

Visit Duration

The length of time in a session. Calculation is typically the timestamp of the last activity in the session minus the timestamp of the first activity of the session.

Same as WAA

Note: Google Analytics uses a different name for this metric. It is called ‘Average Time on Site’.

The average time on site is calculated by dividing the total time spent on the site by the total number of Visits.

NO

Referrer

The referrer is the page URL that originally generated the request for the current page view or object.

The referrer in Google Analytics is the page URL that originally generated the request for the current VISIT. This value is then added to all pageviews in that visit.

The referrer is identified in GA as any source whose medium is “referral”.


GA also has a field called ‘Referral’ which does conform to the WAA’s definition. However; this is not a field displayed in any report, only available as a filter field.

N/a

Internal Referrer

The internal referrer is a page URL that is internal to the website or a web-property within the website as defined by the user.

N/a

This metric is not available in GA.

N/a

External Referrer

The external referrer is a page URL where the traffic is external or outside of the website or a web property defined by the user.

N/a

This metric is not available in GA.

See definition of Referrer above.

N/a

Search Referrer

The search referrer is an internal or external referrer for which the URL has been generated by a search function.

N/a

This metric is not available in GA.

Note: While Google Analytics does track both external search phrases and internal search phrases, the term ‘search referrer’ is not used in reporting.

Yes

Visit Referrer

The visit referrer is the first referrer in a session, whether internal, external or null.

Same as WAA

Note: This data is called a Referral in Google Analytics and can ONLY be the external referrer.

N/a

Original Referrer

The original referrer is the first referrer in a visitor’s first session, whether internal, external or null.


N/a

This metric is not available in GA.

Note: See information about Referrer above.

Yes

Click-through

Number of times a link was clicked by a visitor.

Same as WAA

Note: Google Analytics refers to Click-throughs as ‘clicks’.

This metric is only available in the AdWords reports.

Yes

Click-through Rate/Ratio

The number of click-throughs for a specific link divided by the number of times that link was viewed.

Same as WAA

Note: Click-through and Click-through Rate is the percentage of impressions that resulted in a click. It is calculated by dividing the number of clicks on an ad(s) by the number of impressions for the ad(s).

This metric is only available in the AdWords reports.

Yes

Page Views per Visit

The number of page views in a reporting period divided

by number of visits in the same reporting period.

Same as WAA

Yes

Page Exit Ratio

Number of exits from a page divided by total number of

page views of that page.

Same as WAA

This metric is called ‘Exit %’.

N/a

Single-Page Visits

Visits that consist of one page regardless of the number

of times the page was viewed.

N/A

This metric is not available in GA.

Yes

Single Page View Visits (Bounces)

Visits that consist of one pageview.

Same as WAA

Note: Bounces can be modified by other Google Analytics features; specifically Custom segmentation and event tracking.


When either of the previous features are used the Google Analytics tracking code will request the invisible gif from the Google Analytics server.


Google Analytics will interpret this GIF request as a visitor action and conclude that they are engaged with the webpage and will
NOT count them as a Bounce.


To be clear, if a visitor lands on a page, and views a video that is tracked using event tracking, and then leaves the site from the original landing page, a bounce will
NOT be counted.


The same is true for custom segmentation. If a visitor is placed in a custom segment on a landing page, and does not view any other pages, a Bounce will
NOT be counted.

Yes

Bounce Rate

Single page view visits divided by entry pages.

Same as WAA


NOTE: See comment above regarding how the number of bounces can change based on the use of Event Tracking or Custom Segmentation.

Yes

Event

Any logged or recorded action that has a specific date and time assigned to it by either the browser or server.

Same as WAA

Note: There are multiple attributes to an event in Google Analytics. There are objects, actions and labels.

Event Tracking is a Google Analytics Beta feature and may not be enabled in your account. You can read more about Event tracking in this post or on the GA Code Site.

Yes

Conversion

A visitor completing a target action.

Same as WAA

Note: In addition to conversions, Google Analytics will also calculate Conversion Rate. Conversion rate is the total # of visits resulting in a desired action divided by the total number of visits.


Also note that a conversion will only be recorded ONCE per visits. Visitors can not convert more than one time per visit.

You can read more about goals in this post: All About Google Analytics Goals.

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

New and Improved GA.JS Documentation

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.

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

My Regular Expression Tool Box

Love em or hate em, regular expression are a part of Google Analytics. They provide a lot flexibility but at a price. Small mistakes can become magnified and result in poor data quality.

I know there’s a lot of information out there about regular expressions, but I wanted to simplify the topic. In my opinion, here are the most important things to know.

Key Concept: How GA Regular Expressions Work

Let’s start by talking about how regular expressions work in Google Analytics. In general, we apply a regular expression to a piece of data. If the expression matches ANY part of the data then the expression will return TRUE. If the expression returns TRUE then some action will occur.

It doesn’t matter where you use the reg ex. If it’s part of an exclude filter, and the expression matches the data, then the data will be excluded. If it’s part of an include filter then the data will be included. If it’s part of a report filter then the report will only contain info that matches the reg ex. You get the idea.

How Google Analytics Filters Work
[In this image think of the data as the square cube and the red work bench as the regular expression. If the cube is the same shape as the hole in the bench then an action happens; the cube falls through. Get it?]

It’s really important to understand this because it simplifies the expressions we need to create. Let’s say I want to identify all the keywords in a set of data that contain the term excel. Here’s the full list:

word
excel
ms excel
excel 2003
linux
microsoft excel
excel 2007
excel makes pretty graphs
google

Rather than create some fancy regular expression, I can simply use: excel. After the expression is applied to the data we’ll have the following sub-set:

excel
ms excel
excel 2003
microsoft excel
excel 2007
excel makes pretty graphs

This simplifies the creation of your expression because you only need to match part of the data that you’re looking for. With that in mind, let’s move on to some tips that cover the most common uses of regular expressions.

Tip #1: Use Anchors

Regular Expression AnchorsAnchors are a way to specify if a regular expression should match the begining of the data or the end of the data. Remember, reg ex works by matching ANY PART of a piece of data. Sometimes we’re looking for data that starts or ends a particular way and that’s why we need anchors. Let’s go back to the excel example.

word
excel
ms excel
excel 2003
linux
microsoft excel
excel 2007
excel makes pretty graphs
google

Suppose I only want to see the items that END with the word excel. Well, if I use the regular expression excel, I’m going to get all the items that contain the word excel no matter where it appears.

I need to create a reg ex that means, “ends with.” That’s done by placing a dollar sign, $, at the end of my reg ex. So the expression to find all of the keywords that END with excel would be: excel$.

It would match the following items from our list:

excel
ms excel
microsoft excel

To find all of the keywords to START with excel use a carrot, ^, at the beginning of the regular expression, like this: ^excel. It would match the following items from the list:

excel
excel 2003
excel 2007
excel makes pretty graphs

Now, let’s say I want just the keyword excel. Here’s how that expression would look: ^excel$.

Anchors, pretty handy.

Tip #2: Find This OR That

ORMany times in an analysis we’ll want to find multiple items from a set of data. For example, let’s say I want to find all the keywords that contain the name of an MS Office product. The complete list of keywords is:

word 2007
microsoft excel
outlook express
powerpoint
windows 95
mac OSX
linux
google rocks

Again, I’m only interested in the MS Office products, so I need to create an expression that includes the names of all the products. I want to find word OR excel OR outlook OR powerpoint. The pipe character, |, is used to represent OR logic. The following expression will return true if any of the items occur in the data:

word|excel|outlook|powerpoint

And here are the results:

word 2007
microsoft excel
outlook express
powerpoint

Tip #3: If in Doubt, Escape it Out!

The dangerous thing about regular expressions is that we often don’t know what we don’t know. There are a lot of characters that have special meaning in reg ex. The plus sign, the question mark and the period are just a few. Inadvertently using a special character in an expression can lead to big trouble. There is an easy way to protect yourself: escaping.

Escaping a character means that GA will interpret the character as a LITERAL character and not as a regular expression character. To escape any character place a backslash in front of the character. Here’s the great part. It doesn’t matter if you escape a non-special character. To me, escaping a character is like using a safety net. If you’re unsure if a particular character is a special character, escape it. It can’t hurt your expression.

Time for an example. Let’s say we want to create a goal based on the following URL:

index.php?id=34

I need to turn the above into a regular expression. The question mark and period are special characters so they need to be escaped. But I’m not sure about the equal sign. I better escape just to be safe. So here’s how the resulting reg ex would look: index\.php\?id\=34. By the way, the equal sign is not a special character.

So there you have it. My two cents on regular expressions. These tips just scratch the surface of what you can do with Reg ex. If you really want to learn about reg ex check out my friend Robbin’s series on the subject.

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

Regular Expression Testing Tool

Over the past few months, Robbin Steif from LunaMetrics has been writing a series of posts about regular expressions. The series is amazing and I highly recommend it to anyone learning reg ex (as the geeks call it).

In one of Robbin’s posts she mentions a small, reg ex testing tool that we have on the EpikOne website. This tool was created by Alex, one of the founders of EpikOne. It is easy to access, easy to use and incredibly helpful. I’ve decided to repost the tool here to increase it’s visibility.

Regular Expression Testing Tool

Target String:
Regular Expression:
Result:

How to use it

  1. Enter the text that you want to apply the regular expression to in the ‘Target String’ field
  2. Enter your regular expression in the ‘Regular Expression’ field
  3. Click the ‘Submit’ button

How to interpret the results

  • If the regular expression matches any part of the target string then the ‘Result’ field will contain the word ‘Match:‘ followed by the part of the target string that was matched by the regular expression.
  • If the regular expression does not match any part of the target string then you will see ‘No Match‘ in the result field.
  • If you use parenthesis in your regular expression to capture part of the target string, then the tool will return the data stored in the parenthesis. The result field will contain both the part of the string that was matched AND the values in the parenthesis. First, you will see the term ‘Match:‘ followed by the part of the string that was matched. Then you will see the value stored in each set of parenthesis. Here’s an example.
Match: [matched part of string], [parenthesis value 1], [parenthesis value 2], [parenthesis value X]
Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz

Tools for Debugging Google Analytics

I spend lots of time working with Google Analytics. Over the past year I’ve discovered a number of tools that are helpful when debugging GA issues. Here is my list of must-have tools for the GA developer. If you have a tool that you think I should add to the list please let me know and I’ll be happy to add it.

LiveHTTPHeaders

LiveHTTPHeaders is a FireFox plug-in that displays all of the headers sent between a web page and the various servers that contribute the content for said webpage. Using this plug-in you can validate that a request is made to the google-analytics server for both the urchin.js file and the utm.gif file.

FireFox Developer’s Toolbar

If you’re working with web pages then you probably already use this. I like the Developer’s Toolbar because it give you quick access to the GA tracking cookies. Validating that the GA cookies are set, and are set correctly, is one of the first things you should do when debugging a GA problem.

View Cookies for FireFox

This extension adds a tab to the Page Info dialog box, which shows the cookies of the current webpage. Thanks o Michael Harrison for the suggestion.

RegEx Coach

This is _the_ tool for testing your regular expressions. The Regex Coach is a graphical application for Windows and Linux/x86 (also usable on FreeBSD) which can be used to experiment with (Perl-compatible) regular expressions interactively. It has the following features:

  • It shows whether a regular expression matches a particular target string.
  • It can also show which parts of the target string correspond to captured register groups or to arbitrary parts of the regular expression.

If you have any questions about the validity of your regular expressions you should test them with the RegEx Coach.

Time

The most challenging part of working with GA is waiting for your changes to take affect. Once you change a filter or profile setting you need to wait 3 + hours for the change to take affect. Debugging problems in GA takes time, so be patient. The more you can do to understand the implications of a change, prior to make the change, the better.

Urchin 5 Software

If you are an Urchin 5 owner then you can run GA and Urchin 5 in parallel. This is a fantastic option because you actually collect all the data that GA is using in your web server log files. You can really dig into the data when you have the actual logs. Plus, when you have the logs, you can process them with Urchin and take advantage of the Urchin functionality that doesn’t exist in GA (like importing cost data and reprocessing log files).

Share this post:
  • Twitter
  • StumbleUpon
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • FriendFeed
  • Sphinn
  • Google Bookmarks
  • Reddit
  • email
  • Technorati
  • Yahoo! Buzz