• Home
  • Google Analytics
    • Customizations
    • For Ecommerce
  • Speaking
  • About
    • About Me
    • Contact Me
    • Disclaimer and Privacy Policy

Analytics Talk

Digital Analytics for Business

You are here: Home / Analysis / Google Analytics Custom Variables Overview

Google Analytics Custom Variables Overview

Posted: October 20, 2009 35 Comments

Today 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

Google Analytics Custom Variables are like data decorations!

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.

Google Analytics 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

Google Analytics custom variables depends on the scope of the variable.

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:

GA Custom Variables "hanging" on your data.

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.

Filed Under: Analysis, Tracking Tagged With: Analysis, custom variables, v4

Comments

  1. Martin LeBlanc says

    November 2, 2009 at 8:29 am

    Great post. Thanks.

    Reply
  2. Derek Haynes says

    November 2, 2009 at 3:25 pm

    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’.

    Reply
  3. Kim Biesbjerg says

    November 3, 2009 at 7:25 pm

    How do you use these custom variables in the Analytics UI? Can’t seem to find it anywhere…

    Reply
  4. Michael Whitaker says

    November 5, 2009 at 5:37 pm

    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

    Reply
  5. Fraser says

    November 7, 2009 at 12:11 pm

    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?

    Reply
  6. Leonas says

    November 13, 2009 at 5:15 am

    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

    Reply
    • Justin says

      March 24, 2010 at 3:49 pm

      @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.

      Reply
  7. Ryan says

    November 16, 2009 at 6:00 pm

    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?

    Reply
  8. Ophir says

    November 22, 2009 at 4:22 pm

    Justin,
    This is the best explanation for CVs I read, And oh boy did I read…
    Looking forward to reading some implementation examples…
    Ophir

    Reply
  9. Mike Belasco says

    December 15, 2009 at 11:46 pm

    So could this be another value that gets retrieved from the cookie in the ‘Integrating With CRM’ script you have? http://cutroni.wpengine.com/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.

    Reply
  10. yulia says

    January 12, 2010 at 2:00 pm

    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…

    Reply
  11. Mark says

    January 13, 2010 at 6:19 pm

    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

    Reply
  12. phil says

    January 29, 2010 at 11:54 pm

    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 ?

    Reply
  13. phil says

    January 29, 2010 at 11:57 pm

    where exactly is the ‘Custom Variables report’ ? I can’t find it ? may be because I don’t have nay custom variable yet ? :)

    Reply
    • Justin says

      March 24, 2010 at 3:38 pm

      For all those asking where the Custom Variables report is, you can find it in Visitors > Custom Variables.

      Justin

      Reply
  14. Alan says

    April 1, 2010 at 3:14 am

    @Mark: I am also waiting for the data to appear. How long did you have to wait?

    Reply
  15. David says

    April 2, 2010 at 10:07 pm

    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?

    Reply
  16. David says

    April 2, 2010 at 10:10 pm

    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

    Reply
  17. Stephen says

    August 24, 2010 at 1:29 pm

    I am looking to use a custom variable at the pageview level to view how traffic behaves to a dynamic homepage. Can a dynamic value be set within the CV?

    For example, the homepage for the site changes on a daily basis. I would like to still view the homepage within my analytics as a pageview but then be able to see the data for each different version of the page. I believe the best way to do this is pass a dynamic value into the custom variable.

    It is kind of similar to tracking different categories except it would be different versions of the same page. Do you know of any examples of something similar?

    Reply
    • Justin Cutroni says

      June 14, 2011 at 9:05 am

      @Stephen: You can pass any value you want into a custom variable. When your homepage loads you’ll need to dynamically choose a value for the custom var using JavaScript (or server side code) and then add that the custom var code.

      Reply
  18. Tutoriaux Webmasters says

    August 29, 2011 at 4:07 am

    Thanks for this useful information !

    Reply
  19. Alessio says

    November 24, 2011 at 6:15 am

    Could I use custom variables with trackevent method?

    Reply
    • Justin Cutroni says

      December 20, 2011 at 12:23 pm

      @ Alessio: I’m not sure what you are asking, but you can use both custom variables and events on the same site. They are completely different pieces of data that have their own specific JavaScript..

      Reply
  20. XYZ says

    February 10, 2012 at 2:18 am

    I have a question on using custom variables in GA code. My requirement is: I have 5 varbales (which can be saved in 5 different slot) and I want to give multiple values to those variables and want to maitain all the values in GA custom variables. For example, I have a variable named : StudentName(slot 1; scope 1), StudentRollNumber(slot 2; scope 1) etc. In first hit I provided the values as Neha(StudentName) and 1(StudentRollNumber ). In the second hit I provided the values as Preeti(StudentName) and 2(StudentRollNumber ).. In the third hit, values are Pooja(StudentName) and 3(StudentRollNumber ) and so on..

    Now if i check in GA, I should get:
    StudentName(slot 1) StudentRollNumber(slot 2)
    Neha 1
    Preeti 2
    Pooja 3

    But right now I am not getting all the values.. I am getting only the last values. It is not adding the values. Values are getting updated. Is there any problem with the scope? Which scope should I use in order to retreive all the values? Please reply..

    Reply
    • Justin Cutroni says

      February 14, 2012 at 4:40 pm

      @ XYZ (Is that your real name?) – I’m assuming you are trying to track individual people using the website? If that is the case then you should not have any problems using just two visitor level custom variables. When someone logs into the site, or registers, you should set two visitor scoped custom variables. This means that each user will get two custom variables stored in two slots. You get 5 custom variables per user, not across all users.

      HOWEVER, there is a MAJOR problem with what you want to do. The Google Analytics terms of service states that you can not store any personally identifiable information in Google Analytics. That includes names. So I would recommend that you do not store StudentName in a CV. Roll number is also considered personally identifiable.

      Hope that helps.

      Reply

Trackbacks

  1. Analytics Talk » Blog Archive » Introducing Google Analytics v4 says:
    October 20, 2009 at 2:41 pm

    […] Multiple custom variables (an evolution of Custom Segmentation, wicked awesome!) […]

    Reply
  2. Lecturas sobre la nueva release de Google Analytics | Trucos Google Analytics says:
    October 21, 2009 at 3:36 am

    […] Justin Cutroni> Lectura sobre las custom variables […]

    Reply
  3. GAAC Summit – shrnutí « Adaptive Mind says:
    October 23, 2009 at 9:55 am

    […] Další tipy můžete nalézt také v anglickém článku Justina Cutroniho Google Analytics Custom Variables Overview. […]

    Reply
  4. Google Analytics Adds New Features says:
    December 28, 2009 at 3:44 pm

    […] also announced two additional features for Google Analytics. Custom variables can now be segmented through advanced segments and they are also available in custom reports. This […]

    Reply
  5. The Missing Google Analytics Manual says:
    February 25, 2010 at 9:00 am

    […] Google Analytics Custom Variables Overview […]

    Reply
  6. Google Tackles Campaign Attribution with AdWords Search Funnels – Analytics Talk says:
    March 24, 2010 at 12:48 am

    […] We can also create all sorts of custom JavaScript to store the first click and last click in a Custom Variable. But again, these are just […]

    Reply
  7. Beginning Web Analytics: The Secrets Behind Tracking Your Website Traffic | eCommerce Optimization says:
    August 18, 2010 at 11:22 am

    […] other part of your business, so long as you know your goals, analytics will provide you with all the information you […]

    Reply
  8. Google Tackles Campaign Attribution with AdWords Search Funnels | Knowledge Sharing says:
    February 4, 2011 at 7:34 pm

    […] We can also create all sorts of custom JavaScript to store the first click and last click in a Custom Variable. But again, these are just […]

    Reply
  9. Google Tackles Campaign Attribution with AdWords Search Funnels | Analytricks says:
    February 5, 2011 at 2:11 pm

    […] We can also create all sorts of custom JavaScript to store the first click and last click in a Custom Variable. But again, these are just […]

    Reply
  10. Merging Google Analytics with your Data Warehouse – Analytics Talk says:
    June 12, 2011 at 7:44 pm

    […] we add the customer ID to Google Analytics we store in a visitor scoped custom variable. This means that the ID is stored in a cookie on the visitor’s machine. We normally set the […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

My Books

Google Analytics by Justin Cutroni
Learn More on Amazon.com

Performance Marketing co-authored by Justin Cutroni
Learn More on Amazon.com

Recent Posts

  • Understanding the Google Analytics Cohort Report
  • Using Offline and Online data to drive Google Analytics Remarketing
  • Understanding Cross Device Measurement and the User-ID
  • Universal Analytics: Now out of beta!
  • Advanced Content Tracking with Universal Analytics

Categories

  • About Google Analytics (25)
  • Analysis (52)
  • Analytics Strategy (3)
  • Campaign Tracking (14)
  • Ecommerce (8)
  • Event Tracking (10)
  • Remarketing (2)
  • Reporting (10)
  • Resources (7)
  • Tag Management (5)
  • Tips (25)
  • Tracking (52)
  • Uncategorized (64)
  • Universal Analytics (9)
  • Web Analytics (15)

Copyright © 2023 ·News Pro Theme · Genesis Framework by StudioPress · WordPress