O'Reilly logo

Google Analytics by Justin Cutroni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom Variables

Custom Variables are an evolution of the Google Analytics User-Defined, or Custom Segmentation, feature. Like Custom Segmentation, Custom Variables provide a flexible way to add more information to Google Analytics. The big difference is that you can create multiple custom variables and you can create three different types of custom variables. With the ability to track multiple custom variables and different types of custom variables, you can use the Custom Variables feature for many different things, like:

  • Segmenting members from nonmembers

  • Segmenting customers from noncustomers

  • Tracking all the campaigns a visitor sees prior to converting

  • Content categorization

  • Visitor segmentation based on demographic information

  • Customer segmentation based on customer loyalty

  • Measuring visitor lifetime value

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! We can use this additional information to segment our Google Analytics data and gain a deeper understanding of our website performance. The great thing is custom variables hold data that you define.

Before we get into how to implement custom variables, you need to understand how they’re structured. There are three parts to a custom variable:

Name and Value

Each custom variable is basically a name-value pair. You can create many different values, each with a different name. For example, if you want to track a visitor’s favorite baseball teams, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required