UPDATED: Integrating Google Analytics with a CRM

A while back I wrote a post about how you can integrate Google Analytics with a CRM system. That posts referenced the old urchin.js code and is in need of an update. Plus a lot of people have been asking me about different integration options and I thought it would be a good time to revisit the topic.

So here it is, an update. I’m not going to re-do the entire post, just a few key points.

Why Do This?

This entire hack configuration is based on one simple idea: to build a more robust view of customers/prospects/leads/whatever-you-call-them. The more information we know about people that we sell to the more we can adjust our marketing. This technique let’s us combine where the visitor came from (referral, campaign, direct, search engine) and how often they’ve been to the site with CRM data.

How It Works

We’re going to extract data from the GA tracking cookies and add it to a lead generation form. The GA data will be stored in hidden form elements that the visitor can not see. When the visitor submits the form the GA will be connected to the other information that the visitor entered into the form (usually name, contact information, etc.).

Adding GA data to a CRM

Here’s the data that we’re going to pull from the GA cookies:

* Current referral information (i.e. where the visitor came from)
* Custom segment value (if it exists)
* How many times the visitor has been to the site

You’re probably wondering why we’re not extracting the data via the GA API. More on that in a minute.

The Code

Here it is, the updated code:

The new code differs from the original code in three ways:

First, the inclusion of ga.js. No explanation needed there.

The second change is the addition of the _uGC() function. This function was in the original urchin.js, and because I don’t include that file I need to include the code in the script.

The function is used to parse pieces of data and return certain parts. For example, I use to to parse the cookies (which are just a string) and return the value of the campaign cookie (__utmz), the custom segment cookie (_utmv) and the visitor identification cookie (__utma).

Finally, I added some new functionality to include this visitor’s number of visits. This data is pulled from the __utma cookie (which identifies the visitor). The last integer in __utma is actually a visit counter. I think it is interesting to understand behavior based on frequency so I added this nugget of data.

If you want to see the code in action try this:

In my previous post I included a reference section that documents the format of the campaign cookie and the _uGC() function. Check it out if you’re looking for more technical information.

An Alternate Approach

Remember, all the data we’re pulling is in first party cookies. This means that you could extract the info at the server level rather than the browser level (first party cookies are available to server side code).

You don’t need to do this in JavaScript, as I did. You could use ColdFusion, PHP, .NET or some other server side language.

I’m just trying to provide some inspiration here :)

What About the Google Analytics API?

I’m sure there are a lot of people out there wondering about the GA API and why I don’t just use it to pull data out from GA. The reason is the data in GA is all anonymous, aggregated data. There’s no way to reach into GA and say, “tell me where John Doe came from.” That’s why we pull data from the cookie, because we can combine it with a visitor’s info when they supply it.

Sure, it is possible to pull out GA data and place it in a CRM (like traffic from an email campaign, bounce rate from paid search, etc.) but it’s tough to identify individuals in that data.

Is it impossible? No, not from a technical standpoint. You would need to place a unique identifier in GA to link the data.

But we’re getting into a risky area here.

Remember, it is against the GA terms of service to capture data in GA that identifies an individual. This could be an email address or database ID number. Not my rule, Google’s, and they will crack down.

I’d be interested to hear people’s thoughts on this. Feel free to comment!

Find Out When Your Campaigns Suck with GA Custom Reports

One thing that I like about Google Analytics custom reports is the ability to actually do analysis with this feature. Sure, custom reports is a great way to change how data is displayed (for the annoying manager that only wants to see visits), but the reporting framework also offers a great way to do quicker, relevant analysis. This is done through the segmentation feature.

One challenge that many people face when trying to use custom reports for analysis is determining what data relationships they should create in order to do segmentation.

An easy way to get started is to consider what you have control over. I like to segment by advertising parameters that I can change, like time of day. Why? I can make immediate improvements based on the data in these reports. Let’s take a look.

Google Analytics Custom Reports

You’ve all probably seen the custom reports interface. You can drag metrics and dimensions to create your own report. The columns are different metrics (counts, ratios, etc) and the rows are dimensions, which are the attributes of our visitors and the visits they create.

We can also create a drill down functionality by nesting multiple dimensions in the interface.

Creating the Report

Getting back to our example, let’s segment marketing campaigns by the time of day. Remember, I can run my ads at different times during the day using almost all online advertising tools. Nothing new here, this is called day parting.

Here are the settings for the custom report. Nothing crazy, just a column for visits and a column for conversion rate (in this case a conversion is a sale).

The Data

So this custom report will show all our campaigns and if I click on a campaign we’ll see data for the selected campaign at all hours of the day:

Here we can see the traffic and conversion rate for our chosen campaign at different hours of the day. 6.25% conversion rate at 16:00, not bad! [Website conversion rate is 2.1%]

Now check out this data:

I don’t know about you, but I don’t like paying for traffic that does not convert. Here we can see that traffic sucks from 02:00 – 06:00. We may want to curb our spending at these hours and move the spend to a different part of the day.

[I know, some of the traffic may be 'upper funnel' traffic that is just starting the buying process. But we could easily modify this report to drill down to the individual keywords driving to make that determination.]

I could also create a different visualization that starts with the medium/source dimension, then shows the hour of day, and finally campaign name. This report would be useful if we wanted to look ‘across’ all paid traffic, regardless of campaign, but still retain the ability to drill down to the campaign level.

So here we have some really actionable info. If you’re looking to save some money you may want to see how well your time-based advertising performing at different times of the day.

A is for Atlanta, Amsterdam and Analytics View

The theme for today’s post is the letter A.

A is for Atlanta


We’re kicking off our 2009 Google Analytics Seminars for Success program with a session in Atlanta on February 17 & 18 at Emory University. Seminars for Success is a two day training event that focus on how to configure and use Google Analytics.

I am convinced that this is the most Google Analytics training that you can get for $499. Learn more and register here.

Please feel free to post any questions. We’ve had every size organization attend these events and they all find something useful.

A is for Amsterdam

On March 2 & 3, we’re taking Seminars for Success on the road to Amsterdam! I was hoping for someplace a little bit warmer, but I’m looking forward to visiting some friends in the Frozen North :)

You can read more about the Amsterdam training, and register, here.

A is for AnalyticsView

And the final A for today is AnalyticsView. I’m not sure how many of you know that we launched a product called AnalyticsView last year. It was originally intended to be a customizable GA reporting tool but, with the launch of Custom Reports, we needed to change the focus a bit ;)

AV does some neat reporting things that GA can’t do, like white-labeled reports, but we’re moving away from the reporting feature and starting to make it more of a toolbox. To start, we’ve incorporated SiteScan our tool that scans your site for the standard GA tags. We’ve also created a resource list of other tools, like GA Notes, that we’ve rolled out over the last 4 years.

AnalyticsView Features

Here’s just a few of AV’s features:

  • Preloaded report templates
  • Ability to cusotmize reports
  • Report white labeling
  • Emailed delivery of reports
  • SiteScan
  • Other tools and GA resources we’ve created

The basic version of AV is free and and the premium version is just $25/month.

We had a team meeting today and mapped out the features we’re going to add in the next few months. Our goal is to add features that let you manage your GA setup, facilitate reporting (especially for agencies and enterprises) and provide an easy way to mash up your GA data with other sources. We’d love your feedback.

Google Analytics Training in Montreal


Do you live in Montreal or on the East Coast of the US? Want to learn more about how to find actionable data in Google Analytics? Then join us for Google Analytics Seminars for Success in Montreal on December 8 and 9.

We’ve been putting on these training events for almost a year now, and, to be honest, I think they are an amazing value. The cost is $249 US per day and our goal is to dump everything we know into your brain. Seriously.

Day 1 focuses on the data in GA and how to find actionable information. We cover almost every report and the insights you can draw from each. Also during day 1 we’ll cover many of the new GA analysis tools including Advanced Segmentation, Custom Reports and Motion Charts. Here’s a taste of day 1 topics:

  • Introduction to Web Analytics
  • Website testing with the Google Website Optimizer
  • Google Analytics Reporting Features
  • Sharing GA Data
  • Custom Dashboards
  • Understanding Site Visitors
  • Tracking online marketing campaigns
  • Evaluating site content and user navigation
  • Understanding Goals and Conversion Funnels

On day 2 we really dig into how GA works and how to get it configured correctly. Ever wonder how all that great day gets into GA? We cover that in the morning. Have you been curious about how to use filters and profiles? Yup, we cover that too. We even cover event tracking in the hopes that it will be released from beta soon! :) Treats for day 2 include:

  • GA architecture overview
  • Learning about Regular Expressions
  • Improving your data with filters
  • Setting up Goals and Funnels
  • Implementing E-Commerce Tracking
  • Configuring Custom Segmentation
  • Introduction to Event Tracking
  • Tracking websites with multiple domains/subdomains
  • Code customization

But I think the best part of Seminars for Success is the interaction. We usually have groups of 60 which is big, but we’re able to have lively discussions about data and its uses.

You can learn more and sign up for Seminars for Success here. Got questions? Leave a comment below.

And don’t worry if you can’t make it to Montreal, we’ll be doing more of these next year in different cities around the US and hopefully Canada.

Tracking Email with Google Analytics

In the past few weeks I’ve gotten a lot of questions about how to track email with Google Analytics. While I did cover the broad topic of online ad tracking in a previous series of posts, email tracking has certain nuances that I think should be addressed.

The Concept

Tracking email campaigns in Google Analytics is done using a process called link tagging. This process is the manipulation of the links in your emails. Here’s a sample link that might appear in an email:

http://www.mysite.com/page.php

To track it with Google Analytics it would be modified like this:

http://www.mysite.com/page.php?utm_campaign=fall-sale&utm_medium=email&utm_source=female-list

And another email link that looks like this:

http://www.mysite.com/page.php?prodid=100

Should be modified like this:

http://www.mysite.com/page.php?prodid=100&utm_campaign=fall-sale&utm_medium=email&utm_source=female-list

When someone lands on your site after clicking on a tagged link, GA removes the information from the URL and stores it in a cookie. Because the info now resides on your machine (in the cookie) GA can associate all visitor actions (like conversions and transactions) with the email. Pretty slick, huh?

How Link Tagging Works

What is all that info I added to the URL? They’re called link tagging parameters. The name of the parameter is on the left side of the equal sign and the value of the parameter is on the right side.

Each parameter represents a different attribute of your email. Looking at the example above we can identifiy the following parameters and their values:

utm_campaign=fall-sale
utm_medium=email
utm_source=female-list

Each one is identified by the Google Analytics tracking code and helps GA understand that the visitor arrived on your site via an email.

You must use the parameters that Google provides. However, you can specify any value for each parameter. This is where the real power lies. By using your own values for each parameter you can add markting information, that is specific to your business, to GA. We’ll get to where that information appears in a second.

[ NOTE: All you advanced user may be calling my bluff here. You can rename the link tagging parameters that GA uses, but it is an advanced technique that requires a change to the GA tracking code. I'm not going to cover it in this post but you can learn more in the GA help section. ]

Let’s look at each link tagging parameters and some of the logical values for each.

utm_campaign

This parameter identifies the marketing campaign that the email belongs to. It may be that this email is just one part of a bigger online marketing strategy. For example, you may be using paid search, some display advertising and this email to reach new prospects. You can group this email with other marketing activities by using a common value of utm_campaign.

As for suggested values, use something that represents the campaign that your running.

utm_medium

The medium parameter describes how the message got the to visitor. In the case of email I recommend that you always use the same value. I like to use ‘email’. It’s short and pretty darn descriptive.

Using a single value consolidates all email generated traffic into a single line item in the reports.

utm_source

This is where things get interesting. Traditionally, in link tagging, the source is the ‘who’ attribute. It describes who you’re working with to push a message out. But how does the concept of ‘who’ map to an email?

When it comes to email I like to think of the ‘who’ as the list of recipients that you’re sending the message to. This may be a segment of your email list (like a specific gender segment, age segment of purchase history segment) or your entire email list. For example, some potential utm_source values might be:

utm_source=gender:female
utm_source=gender:all
utm_source=purchase:last-30-days
utm_source=purchase:last-60-days
utm_source=purchase:free-shipping-offer

The key here is that by identifying the segment in the utm_source parameter you’ll be able to measure the performance of that segment in GA. You are segmenting your email list, right?

utm_content

The final parameter is named utm_content and helps us test emails. The content parameter identifies the actual content of the email. So if you’re producing different versions of the email for an A/B test you can mesaure the performance of each by varying the value of utm_content. For example:

utm_content=free-shipping-offer
utm_content=20-off-offer
utm_content=product-creative
utm_content=value-creative

Some folks like to use utm_content to describe not only the version of the email that the recipient received, but also the actual location of the link in the email.

utm_content=top-nav
utm_content=call-to-action
utm_content=image-link

Sometimes this can be overkill as it leads to a lot of very granular data. Normally we just use this to measure which email variation performed better.

Think about how powerful this can be. Using utm_content and utm_source you can measure the performance of a specific message to a specific segment of your customer base (i.e. email list). This is a great way to measure if you’re sending the right message to the right person!

How to Tag Your Links

So now that we know what paramters we can use to track our email, how do we actually tag the links? It starts by assigning a value to each parameters. You could use the Google Analytics URL builder: a free tool in the GA help center. Just enter a value for each parameter, along with the URL from your email, and the tool will automatically generate a tagged URL that you can place in your email.

But I find the URL builder can be cumbersome when tagging a large number of links. Just think of all the links that you might have in a single email!

Instead I use a small Google Spreadsheet that has a built in formula. Just enter your campaign values in the columns, along with the URLs from your email, and drag a pre-programmed formula to automatically created your tagged URLs. Then place the URLs in your email.

You may have noticed that a tagged URL is pretty ugly. If you’re sending an HTML email to you can hide the long URL using an anchor tag, but if you’re using a text based email the recipient will see the entire crappy URL. Try using a service like Tiny URL to hide the query string parameters.

Use Tiny URL to shorten an ugly looking tagged URL.

I should note that some email platforms (the cool ones!) have begun to integrate GA link tagging into their tools. Check with your email provider to see if they offer this service.

The Reporting

As I mentioned before, the values used in your link tags get pulled directly into Google Analytics. Each parameter becomes the foundation for a report. Let’s start with the Traffic Sources > Campaigns report:

This report lists all the values of your utm_campaign parameters. You can measure the performance of your email campaigns by finding the values you use for utm_campaign. But be aware, this report will also contain the titles of your AdWords ad campaigns. They’re automatically imported from AdWords. Also remember that you might use the same value of utm_campaign in activities other than email.

Remember utm_source and utm_medium? We can drill into a campaign to determine how the email medium, for a specific source, performed in the campaign. Select a campaign by clicking on the name. Then use the dimension drop down to view all the sources within the campaign.

The above report shows just one source within this campaign, but that’s all that was used. The important thing to understand is how you can see certain sources, specifically email segments, contributed to the success of a campaign.

But what about evaluating a source across multiple campaigns? Try using the Traffic Sources > All Traffic Sources report:

The first column shows all sources and mediums, so in our case we can see how a segment of the email list performed cross all campaigns. We can quickly filter this report by ‘email’, the medium, to identify how well a segment performed. Remember how

What about the utm_content parameter? Where can we find that data? It’s in the Traffic Sources > Ad Versions report.

Here’s where we can evaluate the performance of our different email variations. The Ad Versions report not only contains the values from utm_content, but also the titles from your AdWords campaigns. This is another piece of data that GA automatically pulls in.

And let’s not forget that all of these reports have three tabs full of metrics: site usage, goal conversions and ecommerce (if you choose to use ecommerce tracking). All of these metrics provide insight into the sales or conversion process.

Bounce rate provides insight into the begining of the process. A high bounce rate probably indicates a disconnect between the message in the email and the content on the landing page.

You can quickly switch to the goal conversions tab to measure the other end of the process by looking at the conversion rate for your email. And if you’re using the ecommerce tab you can look at a metric like revenue to qualify the conversion rate.

Don’t Forget the Pre Click Data

While all this data is great, don’t forget that your email provider has a number of metrics that give insight into what happened before the visitor arrived on your site. Such metrics include # emails sent, # emails received, # bounces, # emails opened and click throughs.

I know that metrics like open rate are inherently flawed due to the tracking technology, but you can’t evaluate things like subject line effectiveness using the data in GA. Don’t be afraid to look at metrics like # of bounces when evaluating the performance of email.

Create your Advanced Segment

With GA’s new Advanced Segments we can really drill into the email traffic segment. At the very least, you should create one advanced segment to evaluate email traffic.

To create the advanced segment use the ‘medium’ dimension and enter a value of ‘email’. Remember, ‘email’ is the value we used for utm_medium in the link tagging. Talk about coming full circle!

Using an advanced segment helps you easily identify what content the email segment found interesting, if they converted, how well the progressed through various processes, etc.

Common Problems

The most common problem we see with link tagging is that people forget to tag their links. Link tagging is usually a process related issue, not a tech related issue. Before your organization sends any email communication make sure the links are tagged.

A simple way to test your links is to send the email to a few coworkers and ask them to click on some links. In a few hours you should see the data in your GA reports.

The second most common problem has to do with redirects. Many times a site may have a redirect that strips off the campaign tracking parameters. The simple test mentioned above should tell you if you have a redirect issue. Remember, when you click on a tagged link you should see your link tagging parameters in the URL of your site.

A Note on Privacy

A few people have mentioned that it is possible to add a visitor’s email address to your GA data using link tagging. While this is possible, keep in mind the GA terms of service specifically forbids the collection of personally identifiable information with Google Analytics.

If you’re still reading, and you’re trying to understand how to track other types of online ads, then you may be interested in these posts:

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.

Google Analytics Version 3.0

Today Google is releasing a significant update to Google Analytics. I’m not sure if it is officially version 3.0, but the amount of new functionality is extraordinary. Not to mention some nice changes to the interface to clean things up.

This new release includes:

* Motion Charts (a data visualization tool)
* Advanced Segmentation
* Custom Reporting
* AdSense Integration
* A data API
* A new administrative interface

Not all of these features are public. The API and AdSense reports (I believe) are in private beta meaning your account must be authorized to use them. All other features are public! Woo Hoo!

These new features cover 90% of the requests we get from all users, both big and small. In my opinion this release is game changer, especially for the enterprise market.

For example, our ability to manage massive GA implementations (1,000 + sites) is now much easier with the new administrative interface. And the data API let’s companies integrate their click stream data with other data sources. Did I mention that Advanced Segmentation let’s you segment historical data?

I’ll slowly be rolling out some posts and to cover all new features as well as a few posts to discuss how this changes the way we work with GA.

A big congratulations to the Google Analytics team. The amount of new functionality is really amazing.