Google Analytics E-Commerce Tracking Pt. 1: How It Works

January 13, 2008 by Justin Cutroni

This post is the first in a series of e-commerce transaction tracking with Google Analytics. Why is e-commerce tracking important? Well, transaction data is a vital piece of information when analyzing online business performance.

Sure, it’s great to measure things like conversion rate, but revenue is much more tangible to many business owners. Having the e-commerce data in your web analytics application makes it easier to perform analysis. Do you need to set up e-commerce tracking? No, but it sure helps. :)

The Big Pictures

E-commerce tracking is based on the same principal as standard pageview tracking. JavaScript code sends the data to a Google Analytic servers by requesting an invisible gif file. The big difference is that e-commerce data is sent rather than pageview data.

But how does Google Analytics get the e-commerce data? That’s the tricky part. You, the site owner, must create some type of code that inserts the transaction data into the GA JavaScript. Sounds tricky, huh? Well, its not that bad.

Step by Step: How it Works

Let’s break it down and walk through what actually happens.

1. The visitor submits their transaction to your server.

2. Your server receives the transaction data and processes the transaction. This may include a number of steps at the server level, such as sending a confirmation email, checking a credit card number, etc.

3. After processing the transaction the server prepares to send the receipt page back to the visitor. While preparing the receipt page your server must extract some the transaction data and insert it into the Google Analytics JavaScript. This is the code that you must create.

4. The receipt page is sent to the visitor’s browser.

5. While the receipt page renders in the visitor’s browser the e-commerce data is sent to Google Analytics via special GA JavaScript.

Here’s a basic diagram of the process. Again, the biggest challenge during implementation is adding code to your web server that inserts the transaction data, in the appropriate format, into the receipt page. I’ll cover the setup in part 2 of this series.

What Data can be Tracked?

Google Analytics collect two types of e-commerce data: transaction data and item data. Transaction data describes the overall transaction (transaction ID, total sale, tax, shipping, etc.) while item data describes the items purchased in the transaction (sku, description, category, etc.). All of this data eventually ends up in GA reports. Here’s a complete list of the data:

Transaction Data

  • Transaction ID: your internal transaction ID [required]
  • Affiliate or store name
  • Total
  • Tax
  • Shipping
  • City
  • State or region
  • Country

Item Data

  • Transaction ID: same as in transaction data [required]
  • SKU
  • Product name
  • Product category or product variation
  • Unit price [required]
  • Quantity [required]

A few notes about the data. First, the geo-location data is no longer used by Google Analytics. The new version of GA tries to identify where the buyer is located using an IP address lookup. Also, you should avoid using any non-alpha numeric characters in the data. Especially in the numeric fields. Do not add a currency identifier (i.e. dollar sign) in the total, tax or shipping fields. this can cause problems with the data.

Coming Up Next

Next time, in part 2, we’ll look at the code and how to actually add it to your site.

Subscribe:

2008 Google Analytics Resolutions

January 8, 2008 by Justin Cutroni

Happy new year! I can’t believe 2007 is over. Continuing with a tradition I began last year, I give you my 2008 GA resolutions.

Before I get into the list, I want to thank everyone who reads and contributes to Analytics Talk. 2007 was an incredible year for me, and I really owe a lot to you guys. Thank you for reading, posting questions and helping me learn so much.

1. I will migrate to the new GA.JS tracking code.

Google announced a new version of the tracking code, ga.js, in October 2007 and launched the new code in December. After some minor launch problems things seem to be running smoothly. While you don’t need to migrate to ga.js, you should start to think about it because Google will no longer add features to urchin.js. In my opinion, you should tackle this problem sooner rather than later.

2. I will contemplate Event Tracking and how I can use it.

The reason Google introduced a new version of the tracking code was to enable a powerful new feature called Event Tracking. While most folks might think of event tracking as a ‘web 2.0′ tracking tool geared towards video players and Ajax, it’s really a flexible framework for data collection. I was skeptical at first, but now I’m a convert. All of us can take advantage of this new feature.

I’ll be writing more about Event Tracking and its uses when Google pushes the feature to everyone. In the mean time, check out this series of posts to learn more:

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

3. I will get creative with profiles.

This is something I’ve been talking about for a while. Profiles are so much more than website data. They’re a collection of data and business rules. Last year, as part of my 2007 resolutions, I mentioned setting up test profiles as a way to insure your configuration settings are correct.

For 2008 I suggest setting up profiles for all major marketing campaigns and mediums. Why? So you can segment reports that normally can not be segmented. Check out Segmenting Visitor Loyalty Reports in GA for more information.

4. I will try some type of ‘advanced’ Google Analytics configuration.

Most of us have a fairly basic implementation of GA. We don’t need to do much more than add the tracking code to our site, set up goals, and configure on site search reporting.

Why not try something new this year? How about using an ‘advanced’ feature like custom segmentation, event tracking or even e-commerce tracking? All of these features can help you learn more about your visitors and what they do. That’s why we use these features and try these hacks: to gain insight and knowledge.

5. I will keep track of website changes and Google Analytics changes.

This is something that I wrote about a long time ago, but it’s still really important. It’s a good idea to keep track of your GA configuration changes so you can better understand the data. Any modifications, like a change to a goal, funnel or filter, should be recorded.

It’s also a good idea to keep track of website changes and online marketing changes. Knowing what’s going to happen with your online business helps drive analysis and you’ll be able to deliver data that will make people happy.

You don’t need anything elaborate, a simple Google Spreadsheet, like this one, will work just fine.

There you have it, a few ideas to spice up your 2008 Google Analytics plans. Got a better idea or think that I missed something? Leave a comment below. And happy new year!

Subscribe:

My Regular Expression Tool Box

December 10, 2007 by Justin Cutroni

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.

Subscribe:

Tracking Sub Domains with Google Analytics

November 19, 2007 by Justin Cutroni

Tracking websites that have multiple sub domains may not seem like a complicated thing. In fact, the GA support docs clearly outlines two ways to track sub domains. You can track all sub domains in a single profile or you can track sub domains in separate profiles.

But what if you want more flexibility? What if you want to track one group of sub domains in one profile and a different group of sub domains in another profile? Or what if you want to create new profiles for a different groups of sub domains in the future?

I like to use an approach that let’s you decide how you want to group sub domain traffic. This setup will give you the most flexibility now and in the future. Some of the benefits include:

1. It let’s you collect all data in a master profile. This facilitates ‘roll up’ reporting and gives you an easy way to measure traffic to the primary domain and all of the sub domains.

2. This technique lets you track each individual sub domain in it’s own profile which is useful for deeper analysis.

3. You can easily create new profiles in the future based on groups of sub domains.

Here’s the exact process to get this working.

1. Create Profile for The Primary Domain

The first step is to create a master profile. All other profiles for the website, including profiles for the various sub domains, will be based on this profile. When you enter the domain for the website use the primary website domain. In the example below, I’m using www.sitedomain.com as the website domain.

Google Analytics Master Profile Settings.

After creating the profile GA will display the tracking code for the site. Before you add it to your pages it must be modified. You need to force GA to use the primary website domain for the cookie domain. This modification will let you track each unique visitor across all sub domains. This in turn let’s us collect all site data in a single profile and do ‘roll up’ reporting.

Old urchin.js tracking code:


<script type="text/javascript">
_uacct = "UA-XXXXXXX-1";
_udn = "sitedomain.com";
urchinTracker();
</script>

New ga.js tracking code:


<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXX-1");
pageTracker._setDomainName("sitedomain.com");
pageTracker._initData();
pageTracker._trackPageview();
</script>

Use this profile as a way to measure overall traffic across all of your sub domains. To facilitate page analysis in this profile add a filter that concatenates the hostname to the Request URI, which is the piece of data in the Top Content report. This will help you differentiate traffic to pages with the same URI that may reside on different sub domains.

20071118-hostname-request.png

A handy report that you’ll want to use in this profile is the Visitors > Network Properties > Hostnames report. This report will show traffic to the primary domain and all of the sub domains. It’s an easy way to compare traffic to the various sub domains.

2. Create Profiles for All Sub Domains

Once you have created the master profile you can start creating profiles for each of the sub domains. Remember, each sub domain profile is based on the master profile, that we created in step 1. Here’s how to set up the new profile:

20071118-sub-profile.png

Now that you’ve created the profile, make sure you add the tracking code to the pages on the sub domain. The tracking code for the sub domain is the same as the tracking code that goes on the primary domain (it’s the code from step 1).

3. Add Filters to Sub Domain Profiles

The next step is to add a filter to the sub domain profile so it only contains data for the appropriate sub domain. This is done using an include filter based on the hostname. Once this filter is in place you’ll have the master profile which will contain data for all sub domains, and this profile that will contain data for a specific sub domain.

Filter to create a GA sub domain profile

To create additional profiles for other domains just repeat steps 2 and 3. Obviously the settings for the filter used in step 3 will depend on the sub domain that you want to include in the profile.

Creating Additional Profiles

Let’s say you need to create a profile for two sub domains: 1.website.com and 2.website.com. This can easily be done because the same tracking code is on both sites. All you need to do is add an include filter with the following settings:

GA Filter settings for 2 sub domains.

While Google’s documentation describes a good way to track sub domains, I think this approach is better due to it’s flexibility. Plus, because the same tracking code is used all all sub domains you don’t need to worry about placing the wrong tracking code on a sub domain.

Good luck with your setup!

Subscribe:

Make GA Data Quality Suck Less!

November 6, 2007 by Justin Cutroni

Frustrated with GA Data?  Get a grip!We all know that data quality sucks! But there are a few, vital steps that you can take to insure that your Google Analytics data is as accurate as possible. Remember, accurate data makes for happy, and accurate, analysts.

Here are three simple tips that can help make your data more accurate.

1. Eliminate Duplicate Data

Many sites that I work on have duplicate data. The usual cause is mixed case URLs. Google Analytics is case sensitive, it captures the data exactly as it appears in the location bar of the browser. So if a URL is of mixed case in the browser, it will be captured and displayed in mixed case within GA.

It’s very easy to have two URLs, that have the same functional meaning, appear as two line items in GA because they have a different case. Here’s an example:


/worldseries/index.php?year=2007&keyword=lowell
/Worldseries/index.php?year=2007&keyword=Lowell

Both URLs are probably the same, they just appear different because of the case. We want to force both URLs to have the same case and thus make them appear as a single line item in GA. This can be done with a Lowercase or Uppercase filter. I like the lowercase filter, but you could easily use the uppercase filter. It’s a personal preference.

The filter below will force the Request URI to lowercase:

Google Analytics Lowercase Filter

I recommend adding a case changing filter to any data element (i.e. filter field) that could be mixed case. This includes:

  • Request URI
  • Campaign Name
  • Campaign Term
  • Campaign Medium
  • Campaign Source

Another cause of duplicate data is multiple URLs that display the same content but have a different file extension. Here’s an example:


/champions/redsox.php
/champions/redsox.htm

These URLs may appear different (because of the file extension), but the web server might interpret them as the same file. Please note that not every web server behaves this way. It all depends on your web server. Check with your IT guru if your site has URLs with multiple file extensions.

You should merge duplicates URLs, that have different file extensions, into a single line item. I find the best way to do this is with an advanced filter.

Google Analytics AdVanced Filter for URI ReWrite

Some may think that a search and replace filter is the best way to remove these duplicates. But you would need to create a search and replace filter for each set of URLs that needs to be merged. An advanced filter, because it uses a regular expression, will change every URL that ends in ‘.htm’ to a ‘.php’ extension.

2. Remove Irrelevant Information

Extra information in the URL can cause big problems in Google Analytics. The reason is that GA will capture all of the data in a URL, which includes the query string parameters. Query string parameters that don’t have a functional meaning should be removed from the URL.

An easy way eliminate these parameters is to collect data for a week and then analyze the top content report. Any query string parameter that does not provide insight into what the visitor sees or does should be eliminated.

To remove a query string parameter from GA simply add it to the ‘Exclude URL Query Parameters’ field in the profile settings:

20071104-exclude-parameters.png

Enter multiple parameters as a comma separated list.

Be aware that once you remove a query string parameter from GA it is completely eliminated from the system. So any goals, funnels or other filters that use that parameter will no longer work.

Also remember that you should remove any query string parameters that contain personally identifiable information. It is against the GA terms of service to collect PII.

3. Identify Your Segment

I could have easily named this tip ‘exclude internal data’ but I wanted to change the way we all think about profiles and the data that’s in them. I believe we should think of profile data in terms of the segment we want to analyze, not who we want to exclude. I know these statements are very close in meaning, but there is a slight difference. Segmentation is so important to analysis. I believe that every time we create a profile we should consider what segment of data it will contain.

I can think if a few segments of data that I would like to analyze:

  • CPC traffic
  • New visitors
  • Return visitors
  • European visitors
  • Traffic from a specific marketing campaign
  • Non-employee traffic
  • Traffic generated by my call center

All of the above segments can be created as different profiles using include filters. Each will provide some insight into that segment. Don’t get me wrong, you’ll probably want to exclude internal traffic from 99% of your profiles. But try to think in broader terms, focus on the segment that you want to analyze.

Creating a profile based on a particular segment of traffic is pretty easy. The first thing you want to do is identify what segment of traffic you want to include in your profile. Then create a filter based on the filter filed that represents that segment.

Let’s say I want to see all traffic generated from visitors performing some type of external search on my name. I could apply the following include filter to a profile:

Google Analytics Include Filter

This filter can easily be modified to include a specific marketing campaign (using the Campaign Name field), a specific country (using the Visitor Country field) or any other segment of data so long as it is represented by one of the filter fields. Please note that this will work even if you’re using AdWords auto tagging on, even though you haven’t done any heavy lifting to define the Campaign Term.

By the way, you will want to exclude internal traffic from many profiles. My favorite way to remove internal traffic from a profile is with an ‘Exclude all traffic from an IP address’. Make sure you use anchors at the beginning and end of the regular expression.

Google Analytics Filter: Exclude IP Address

Another good way to exclude internal traffic, especially if you don’t have a static IP address, is to use a little hack called Count Me Out. This hack uses the GA custom segment cookie to identify users.

So remember, yes, you need to exclude internal traffic, but try to take a broad view and think about segmentation when you filter your profiles.

Subscribe:

Google Analytics Short Cut

September 13, 2007 by Justin Cutroni

As some of you may have noticed, my book PDF e-book has been published! Google Analytics Short Cut hit the web on August 31 and is now available for purchase at O’Reilly’s website.

In my opinion, and I’m a bit biased after writing for all those hours, it’s a pretty good deal for $10 US. Let me tell you why…

#1 Structured Information
There’s a lot of Google Analytics information out there. We have the GA group, blogs and some books. But, in my humble opinion, the one thing that is missing is a basic manual that provides a structured description of the system’s architecture and features. This was the real driving force behind the PDF. I wanted to explain how things work so users understand the results of certain configurations.

I didn’t want to create a web analytics book. Some pretty smart people have already written wonderful books that discuss web analytics. I wanted to create a work that can help people implement different web analytics strategies using Google Analytics and I think I did that.

#2 Free Updates
O’Reilly provides free downloads of updated PDF documents that you have purchased. How cool is that! We’ve seen Google make some pretty interesting changes to the product in the last 6 months. In fact, they just updates how time-on-site is calculated yesterday. I intend to update the PDF twice a year to cover any new features or major modifications. I might update it more if Google rolls out major changes.

But there’s a caveat… O’Reilly will only update the PDF if sales are good. You know where I’m going with this one. :)

If you’re interested in learning more about GA Short Cut please visit gashortcut.com and please make sure you read the acknowledgments. If you’d like to hear what others are saying you can read the reviews on O’Reilly’s site or check the reviews on gahortcut.com (If you’re interested in writing a review please let me know. I would be honored.)

Finally, I’d like to thank all of you. Thank you for sharing your thoughts, questions and ideas with me. Thanks for adding to the discussion and helping me grow and learn. I had no idea that blogging would lead to so many opportunities. But, more importantly, I had no idea it would lead to so many new friends.

Subscribe:

Time-On-Page Goals in Google Analytics & Website Optimizer

September 5, 2007 by Justin Cutroni

Today the Website Optimizer team introduced some new features that will make Optimizer much easier to use. I’m going to defer to the guys at GrokDotCom for coverage on the new features. They got their post up pretty fast and included a snazzy interview with Tom Leung (the Website Optimizer product manager). Please take a moment and check it out.

I’d like to highlight a seemingly minor update to the WO documentation that opened my eyes. Along with the new product features, the WO team published a simple tutorial about how to track time-on-page based conversions. This method can be used to create conversions based on how much time a visitor spends on a page.

How much TIME!Why is this important? Some conversion activities have nothing to do with completing a process. Some conversions measure how engaged a visitor is with a website. While there are many ways to measure engagement, and many different opinions about what engagement is, time spent reading a certain page is one way to measure engagement.

Anyway, the method that the optimizer team published in their support doc can be used in Google Analytics to create time-on-page goals. The secret to the tracking is translating how much time a visitor spends on a page into a pageview. Remember, goal tracking in Google Analytics is based on a pageview. We need to create a pageview that indicates the visitor has been on a page for a certain amount of time.

How it Works

To translate time on page to a pageview we use a nifty JavaScript function called setTimeout(). This function will ‘do something’ after a specified interval of time. We can use setTimeout() to create a pageview after some period of time has elapsed. How do we create pageviews in GA? With urchinTracker().

Here’s the code that will create a pageview after a certain amount of time:


<script>
setTimeout('urchinTracker("/read-pages?page="+
_udl.pathname+_udl.search);', 20000);
</script>

You’ll notice that there are two parts to the setTimeout() function. They’re separated by a comma. The first is urchinTracker(). That’s what will create the pageview after a certain amount of time. The second part is the number 20000. That’s the amount of time that setTimeout() will wait before executing urchinTracker() and thus creating the pageview.

The time is in milliseconds. 1000 milliseconds equals one second. So 10000 milliseconds = 10 seconds.

Place the code, below the standard GA page tag. Once the page loads the timer will start. When the time limit is reached the urchinTracker() function will execute and a pageview will be created for the value passed to urchinTracker(). I’ve used a couple of Google Analytics variable to define the name of the pageview.

udl.pathname is the part of the URL that occurs after the domain extension (.com, .net, etc.) and before any query string parameters (which usually start with a question mark).

_udl.search is the list of query string parameters that appear after the path.

The code will create a pageview for a fictional page named ‘/read-pages’. Part of the fictional page URL will be a query parameter named ‘page’ that stores the name of the page that the visitor was on when the pageview was executed. This setup gives you a lot of flexibility when setting up the goal.

Here’s how the goal would be setup:

Goal Settings for Time on Page Goal

And here are some additional settings I’ve added to this goal:

Additional Settings for Time on Page Goal

The goal is defined as a regular expression. So any pageview that matches ‘/read-page\?page=’ will contribute to the goal total. Using this setup you can create one generic goal called ‘Read Page’ and then use the Goal Verification report to segment the conversions and identify which pages people actually read.

An Example

Let’s say we want to track how many people stay on the following page for 3 minutes:

http://www.epikone.com/blog/2007/08/29/segmenting-members-from-non-members/

First we need to translate minutes to milli seconds:

3 minutes = 180 seconds
1 second = 1000 milliseconds
3 minutes = 180000 milliseconds

Now we’re ready to add the code to the page. Remember, it must go below the standard GA page tag:


<script>
setTimeout('urchinTracker("/read-pages?page="+
_udl.pathname+_udl.search);', 180000);
</script>

After a visitor views the page for 3 minutes the code will create a pageview for:

/read-pages?page=/blog/2007/08/29/segmenting-members-from-non-members/

And a goal conversion will follow.

A Note About Website Optimizer

Obviously this technique will work for tracking conversion in Website Optimizer. The implementation is slightly different. You need to include the account number in the SetTimeout() function. The reason is that the GA code might have a different account number than the Website Optimizer.


<script>
setTimeout('_uacct="UA-XXXXXX-X";
urchinTracker("/read-pages?page="+_udl.pathname+_udl.search);',
20000);
</script>

Conclusion

I can’t believe that I didn’t think of this method before. :) Thanks WO team for posting that very cool article.

Now, what about number of number-of-visit goals or time-on-site goals? I’ve got the number of visits goal tracking figured out and I’m working on a generic time on site. Stay tuned.

Subscribe:

Tip: Make Sure Your Site Works

September 2, 2007 by Justin Cutroni

I just read a great article by Bryan Eisenderg about Conversion Rate Basics. He points out some simple things that you should do to insure your site is converting visitors. This got me thinking about an experience I had earlier this week.

On Wednesday (August 29, 2007) I received a message from NetFlix regarding their video on demand service . I’m a big fan of on demand video so I decided to click on the email and view the offer. Imagine my surprise when I was greeted with the following message on the NetFlix website:

Netflix Error Message

Now the site was not down long and this may have been an unforeseen problem. But the lesson is clear: make sure your site works. If it doesn’t you’re going to loose business.

Here’s a similar example. We started working with a client who uses their website to generate sales leads. While evaluating the website we found that their main lead generation form, if filled out incorrectly, would display a plain white screen to the visitor. No web page, no error message, no nothing. Just a plain white page.

How can you protect yourself from unexpected downtime? Try a site monitoring service. I’ve never used one but assume they all function the same way. At some given interval, say 2 minutes, the monitoring service makes a request to your website. If the web server returns an abnormal result then an alert is sent to the responsible party. The company usually charges a small monthly fee for this service. Does anyone out there have an experience with a site monitoring service they would like to share?

But what if the NetFlix issue was not unforeseen? What if the email blast was sent during the website’s scheduled maintenance period? To me, that indicates a lack of process. There should be been some type of process in place that stopped the email blast from going out while the website was down. From a web analytics standpoint, I always want to know when a client is sending out emails so I can insure that it is tagged for tracking. How about adding a step to the ‘email blast process’ to check the website status before sending out the email? I know it doesn’t seem complicated, but unless checking the website maintenance schedule is a documented step in a defined process it could go undone.

Subscribe:

Segmenting Members from Non-Members

August 29, 2007 by Justin Cutroni

Do you run a subscription based website? You know the type of site: customers pay you a monthly fee and you give them access to valuable content. I’ve worked with a number of clients with this business model and have noticed that many make a consistent mistake when setting up their analytics package: they fail to segment people who subscribe to the website (i.e. members) from those who do not.

Why is this so important? Here’s an example. The following image shows some real data that is not segmented other than the removal of internal employees:

Non-Segmented data

Now, here are the same metrics with members removed:

Segmented Metrics

Big difference, huh? Just image how this changes all those metrics that are calculated using Visits, like conversion rate, abandonment rate, etc.!

It doesn’t matter what analytics tool you use. If your website has some type of member’s area you need to segment out members to get an accurate view of your website performance and online marketing activities.

The Google Analytics Way

If you’re using Google Analytics the implementation is simple. Use GA’s custom segmentation feature to identify and segment members. Remember, the custom segmentation features uses a JavaScript function, __utmSetVar(), to set a cookie, named __utmv, on the visitor’s machine. The cookie is a persistent cookie and lasts for 6 months. You need to call __utmSetVar() when a member identifies herself. You can put it on a ‘thanks for logging in’. Here’s a perfectly good implementation of the code:


<script type="text/javascript">
__utmSetVar('member');
</script>

Remember, the above code snippet should appear AFTER the standard Google Analytics tracking code. The reason is that the __utmSetVar() function is in the urchin.js file. So if you try to call __utmSetVar() before the urchin.js is loaded by the browser then the visitor will receive an error.

Once the cookie has been set on the visitor’s machine you can use the custom segment value to exclude them from a profile. The exclude filter would look something like this:

GA Filter to exclude members

Any profile that has this filter will only show data for those visitors that are not members thus providing a more accurate view of how effective the website is at converting visitors.

And let’s not forget about the members. You can create a profile that only includes members (the filter settings are almost identical to the filter above, just change the filter type from ‘exclude’ to ‘include’). By creating a profile specifically for members you can focus on their usage of the member’s area. For example, the Top Content report will identify the content that they find most engaging. You could also use some of the loyalty reports to see how often they use the website.

Tip: Tracking Different Subscription Levels

If your membership model has various level, like Gold, Silver and Bronze, you can include this information in the custom segment value. This allows for a more detailed analysis of each membership level. Just modify the value you pass to the __utmSetVar() function. For example:


<script type="text/javascript">
__utmSetVar('member-gold');
</script>

or


<script type="text/javascript">
__utmSetVar('member-silver');
</script>

or


<script type="text/javascript">
__utmSetVar('member-bronze');
</script>

After the custom segment cookie has been set you can create different profiles for each subscription level. Use the filter shown above, just change the value for Filter Field to match one of the values in the code above. Then you can use the profiles to analyze the member data and observe their habits.

Subscribe:

Segmenting Visitor Loyalty Reports in GA

July 17, 2007 by Justin Cutroni

[ UPDATED: I’ve added some more information re: filtering direct and referral traffic. ]

This is a quick post. The goal is to help all you GA users that read Avinash’s most recent post about measuring success for non-e-commerce sites. Avinash lays out three recommendations including:

3. Segment the data! For Visitor Loyalty or Length of Visit what are the most important acquisition sources? What are the keywords that drive valuable segments of traffic to the website? As you look at longer time periods what pieces of content do people with longer visits consume? And so on and so forth. Segmentation is key to insights that will drive action.

Specifically, Avinash recommends that you segment the following reports in GA (or whatever tool you use):

  • Visitor Loyalty
  • Visitor Recency
  • Length of Visit
  • Depth of Visit

However, if you’re a GA user you can NOT segment these reports from the reporting interface. The only way to segment the Visitor Loyalty reports is via filters and profiles.

When you apply a filter to a profile it segments the data during processing. Here’s an example. Let’s say you add an include filter to a profile. Here’s the filter:

Include filter for segmentation

This filter only includes data that comes from the cpc or ppc medium (paid search). So all of the reports in the profile only contain data from paid search campaigns. By using the filter you’ve segmented the data.

Let’s take this one step further. We’ve just filtered the data by the paid search medium. Now we want to further segment by each search engine (i.e. Yahoo!, MSN, Google). We could create a second filter based on the campaign source:

Campaign Source Filter

Now the data in this profile, and the Visitor Loyalty reports, is specific to paid search activities from Google. We’ve successfully implemented Avinash’s recommendation.

You can adjust these filters (and thus the segmentation) based on the values of Campaign Medium and Campaign Source. To create a profile with only email traffic change the medium filter above so the filter pattern is ‘email’.

Remember, the values of Campaign Medium and Campaign Source can have a default value (like organic, referral or direct) or a set value that comes from the utm_medium and utm_source parameters used in link tagging. You can read more about link tagging in a previous post I wrote.

You can always find the values for Campaign Medium and Campaign Source in the Traffic Sources > All Traffic Sources report, just segment the report using the Medium or the Source.

20070717_all_sources.png

Here are the top 10 traffic sources for Analytics Talk:

20070717_sources.png

If I want to create a profile for traffic from the Official GA blog I would use an include filter, based on Campaign Source, with ‘analytics\.blogspot\.com’ as the filter pattern. Remember, the filter pattern is a regular expression!

To filter direct traffic you should set the Filter Field to Campaign Source and the pattern to ‘\(direct\)’. For referral traffic, set the Campaign Medium to ‘^referral$’.

Is this an intuitive approach to segmentation? Not really. But it works perfectly. When you set up accounts create profiles for major acquisition mediums and sources to gain the insight you need to judge success.

Subscribe: