Google Analytics Custom Variables Overview
October 20, 2009 by Justin CutroniToday Google releases Custom Variables (cv for short) in Google Analytics. This is an evolution of the custom segmentation feature. This post is meant to give you an overview of the feature. We’ll discuss how to use it in a later post.
Like Custom Segmentation, custom variables are a flexible way to add more information to Google Analytics. The big difference is that you can create LOTS of custom variables. How many? In theory you can set an infinite number of custom variables. But GA has some internal limits that keep you to 50,000.
What can we use custom variables for? The possibilities are endless:
- Segmenting members from non-members
- Segmenting customers from non-customers
- Tracking all the campaigns a visitor sees prior to converting
- Content categorization
- Segmenting visitors based on landing page
- Visitor segmentation based on demographic info
- Customer segmentation based on order history

As my friend Phil likes to say, custom variables are decorations that you hang on your data. Almost like holiday decorations hanging on a tree! This is a really good analogy that I’ll continue in this post.
There are four critical attributes of a custom variable that we must understand in order to use them.
Name and Value
The easiest attributes to understand are Name and Value. The Name of a custom variable is literally the name you give to the variable. Each variable can have many, many values. For example, you could define a variable named ‘Baseball Team’ and then add the values:
- Red Sox
- Yankees
- Phillies
- Giants
- Angels
This is totally different than the old Custom Segmentation feature. With Custom Segmentation you were limited to one variable (ie one Name) that could contain multiple values. Now you can create multiple variables each of which can have multiple values.
You can view all of your variable names in the new Custom Variables report.

It’s important to note that the name of a variable, plus the value for a variable must be less than 64 characters. Why? The data is sent to Google via a request for an image file. The actual length of the request is limited and Google wants to insure that all of the data makes it to the server.
Scope

The real power of custom variables comes with something called the Scope. Think of scope as the different ‘levels’ of visitor data. When a visitor visits a website Google Analytics collects data at three levels:
- Pageview level: This is data associated with each page viewed during a visits. Page level data can change from one page to the next.
- Visit level: This is data associated with the visitor’s entire visit. This data can change from one visit to the next. But visit level data is applied to every page within a visit. This data only exists for the CURRENT visits.
- Visitor Level: This data is applied to the visitor and every visit and every pageview that the visitor generates. This data persists across all visits that a person creates. How does it persist? Via a cookie.
This means we can set information, ie custom variables, at the page level, the visit level and the visitor level. If we think of custom variables as decorations “hanging” on our data then we could use the following graphic:

So scope is the same as level. Anyone drooling out there?
The ability to control the scope of a custom variable makes this feature extremely flexible. For example, if you want to group all of the content on your site you can add a page level custom variable to every page that identifies the groups that a page belongs to.
If you want to segment visitors by their purchase history you can add visitor level custom variable. The possibilities are truly endless.
Let’s take a look at some of the reporting so you can get a feel for some of the data.
Here’s the Custom Variables report. You’ll notice it looks a lot like the user defined report. This report contains all of the variables that you defined. If you click on a variable you’ll see all of the VALUES for that variable.
So why has google added a scope if we can’t see it in the reports? I’m just going to let you guys speculate. But it’s obviously a critical part of CVs and we should see that data.
Index
The last attribute that we need to discuss is something called the Index. To be honest, it’s really hard to define the index. Basically the index is a technical attribute that helps GA organize all the custom variables on a page.
It’s only used during the implementation, so we’re not going to dig any further in this post.
Speaking of the implementation, you’ve probably noticed that I haven’t talked much about the implementation. To be honest, we’re still playing with CVs. Obviously this data comes from JavaScript. So you have to do some coding to get this data.
But I’m going to hold off on the implementation talk until later. Implementation involves another concept called the Index which is, to be honest, vague and confusing.
Subscribe:
24 Responses to “Google Analytics Custom Variables Overview”
Great post. Thanks.
By Martin LeBlanc on Nov 2, 2009
Great writeup Justin. I was curious if you had an idea when custom variables will be exposed in the interface. I can’t seem to find it.
I believe the Google Analytics announcement mentioned it would be ready in a ‘couple of weeks’.
By Derek Haynes on Nov 2, 2009
How do you use these custom variables in the Analytics UI? Can’t seem to find it anywhere…
By Kim Biesbjerg on Nov 3, 2009
Many thanks Justin:
Do we need to send custom variables before the new Custom Variables report shows up or will there be a new empty report once it is enabled in my profile?
If the new report is not available yet, can we already send custom variables?
Great stuff!
Michael
By Michael Whitaker on Nov 5, 2009
Great writeup – thanks for the easy to grasp analogy about scope.
I’m unable to find the custom variables report in GA. Can you point me in the right direction?
By Fraser on Nov 7, 2009
Hi Justin,
you said we “can create LOTS of custom variable” but as I read from them, we can only make 5 custom variable.
(http://code.google.com/intl/vi-VN/apis/analytics/docs/tracking/gaTrackingCustomVariables.html)
Do I misunderstand them? Can you explain a bit?
Thanks a lot
Leonas
By Leonas on Nov 13, 2009
I am using Google Analytics on my site and I am wondering if I can use custom variables to track how long it takes my pages to load when someone visits? Do you have any suggestions?
By Ryan on Nov 16, 2009
Justin,
This is the best explanation for CVs I read, And oh boy did I read…
Looking forward to reading some implementation examples…
Ophir
By Ophir on Nov 22, 2009
So could this be another value that gets retrieved from the cookie in the ‘Integrating With CRM’ script you have? http://www.cutroni.com/blog/2009/03/18/updated-integrating-google-analytics-with-a-crm/
That would be cool. Could possibly be used as an attribution path tracker with some additional code around it if I am imagining it correctly.
By Mike Belasco on Dec 15, 2009
Hi! Thanks for the clear explanation. I’ve been trying to figure out these custom variables for a while now…
Can this new variable be used along with the old user defined variables? I set this one up, but now my old user defined variable report got new values like : “oldterm|1_newname_newvalue_1,”
Is that normal? I can’t figure out what’s going on…
By yulia on Jan 12, 2010
Justin,
how long does it take for the data to appear?
Is there anything that needs to be configured in the reports to make it work?
I’ve been waiting over two days now and still no data is appearing.
Thanks
By Mark on Jan 13, 2010
I want to tracks visits by authors, should I use the custom variable or add an additional trackpageview looking like _trackPageview(“/by/author/Douglas Karr”);
what do you think ?
By phil on Jan 29, 2010
where exactly is the ‘Custom Variables report’ ? I can’t find it ? may be because I don’t have nay custom variable yet ? :)
By phil on Jan 29, 2010
For all those asking where the Custom Variables report is, you can find it in Visitors > Custom Variables.
Justin
By Justin on Mar 24, 2010
@phil: Absolutely. Custom variables will be perfect for tracking content by author. I would use a page level custom variable to group your content by author.
@yulai: The new visitor scope Custom Variable uses the same cookie as the old user Defined feature. So you can’t use them together. I would use the new custom variables as userDefined will not be supported in the future.
@mike: Yes, I’m going to update the CRM script to extract the visitor level custom variable and pipe it into a CRM.
@ryan: Yes, you could use custom variables to track page load times, but I suggest using events. Check out this article on tracking page load times with events.
@Leonas: The actual number of custom variables that you can set is variable because of scope. A variable’s scope determines how long the variable will last and that changes how many slots are available for custom variables. I’ve got to get a blog post done on scope, I’ll try to have it done soon.
By Justin on Mar 24, 2010
@Mark: I am also waiting for the data to appear. How long did you have to wait?
By Alan on Apr 1, 2010
Hi Justin,
i added some custom variables but still nothing on the report. sounds similar to waht @mark is saying. Do we need to switch it on somewhere?
By David on Apr 2, 2010
oops. just appeared.. was about 36 hours after the test. the event tracking appeared withing a few hours. but the customer vars took much longer
By David on Apr 2, 2010