20 Ways to Use Google Analytics Custom Variables
This is not a “How to Install Custom Variables” post.
I’m not going to bore you with a long rambling introduction to Google Analytics Custom Variables. We’ve talked about Google Analytics Custom Variables a few times on this blog, as we should… They’re an amazingly powerful way to get more out of your site data. Jonathan Weber’s early series from 2010 is still mostly valid though it uses the older traditional tracking code. If you need a primer, they’re a good place to start:
Also don’t forget what Michael Harrison laid out at the end of last year. Custom variables need to be in your code BEFORE a pageview or event is tracked, or they won’t work at all. Also the code he uses on this page is the current asynchronous tracking code format for custom variables:
And hey since I’m linking things, the best resource is usually from the source. Here’s the Google guide for Custom Variables.
Hopefully you can discern the basics from those articles, and others across the web about how exactly to use custom variables, how to segment your reports, etc. This post though is about specific ways to use them. it’s funny how often I’ll talk to a client who seems to understand that they’re very powerful, but can’t figure out ways to use them on their site.
So here are twenty different ways you can use custom variables. Five for each of the four main website types. Content sites, Ecommerce Sites, Lead Generation Sites, and Self Service sites.
Ways to use Custom Variables With A Content Generation Site AKA a Blog
Content sites rely on getting people to consume content, the more the better. So it’s important to be able to really parse out what content works, and what doesn’t.
Track Your Authors
If you have multiple authors, place a custom variable for that page and assign the author to it. This way you can segment visits that include that author, just look at that author’s performance, etc.
Track The Categories
Same as the authors, track your categories, so you can see which ones do better than others, and where you should focus your efforts.
Track Your Tags
You might uses tags on your site to boil down different non-category topics. This way you can see what tags and sub areas are interesting to people across various categories. Keep in mind though that if you set a custom variable at the page level, you can only have one, so you’ll have to pick one tag, not multiple.
Track Who Comments
Commenters are more likely to return to your site, and are more engaged. Track a default value of no on the visitor until they comment, they record they’re a commentor, and you can watch the behavior of these two types of users across the site.
track social sharer
You can track a specific type of social sharer, or you can just say “this is a person who has shared”. So whenever they click a link to share on twitter or Facebook, in addition to tracking that as an Event add in a custom variable either onto the user or a session. Now you know that THIS VISITOR has shared, and might do so again. That way you can see how many total users share, and see if it’s more than just the same 100 people sharing your content day in and day out.
Ways to use Custom Variables with an Ecommerce site
Ecommerce sites are different, you’re more interested in product performance, so we want to track different things with our custom variables.
Track The Visitor ID
Google Analytics doesn’t let you put in personally identifiable information, but it’s generally held that random visitor id’s that you can then compare with your own database outside of GA, are ok. so this way you can track the same visitor even when they’re not logged into your site.
Track Your Customer Loyalty
Tracking customer loyalty is a big thing. Start with a custom variable with 0 purchases and every time they make a purchase, increment the count. That way you can track different levels of purchase, and segment users as new users, returning customers, regular customers, etc. Just look at users who have more than 3 purchases vs users with only 2 purchases, etc.
Track a Product View (with SKU)
Track which products your visitors view during their visit. some might not get purchased, but lead to other conversions, and other insights.
Track the Number of Items in a Shopping Cart
Track the total number of cart items the visitor has. increment the count. This can help see how many abandoned carts there are, with specific information.
Track a Customers Ongoing Value
Like the customer loyalty, but track their overall value. every purchase increment the ongoing value, so you can see which of your customers are your whales and how they react differently. Do customers who have made over $100 in purchases behave differently on the site than those that have spent less?
Ways to use Custom Variables with a lead generation site
Lead generation sites are all about getting people to contact you, so we don’t necessarily care about the same things a blog or a ecommerce site does.
Track Whether They’re a Lead or Not
Pretty basic, but if someone fills out an appropriate contact form, then track them as a lead. That way you can see the ones who come back, watch their behavior, etc. How do leads differ in their behavior on your site than non-leads? Is there a trick that gets people to convert?
Track Newsletter Subscriber
Maybe they’re not a lead but subscribed to your email, see how often they come back, how the newsletter works, etc.
Track RSS Subscriber
Same thing but with your RSS feed. Is it any good? Does it convert people to leads?
Track Demographic Information
You could track a whole slew of demographic information, particularly if you have a form that collects this sort of data when they fill it out. How do 16 year old Male leads react differently to your content than 18 year old female leads?
track promo offers
This really could go anywhere, but if you’re using different header images on a home page for instance to drive internal promotions to sign up pages, the you can see if someone actually saw that image, and then track their conversion rates appropriately. Or it could just be a marketing message you want to ensure they’ve seen, and how it affects your lead generation.
_gaq.push(['_setCustomVar',5,'September Promotional Image','Yes',2]);
Ways to use Custom Variables with a Self Service site
Self service sites, are sites that are more about helping people, getting information into their hands. Like a help desk, with support articles. You’d want to use your variables different here also.
Track Member Type
Maybe you have different support levels, or a paid service level vs a free one. Record the visitor’s member type, maybe yes or no, maybe gold silver platinum, etc. Or maybe you just want to record logged in vs not-logged in.
Track session help articles serviced
During the session, track places you see as a successful delivery of a help article. Increment the count. How many did they view? Is more a good thing or a bad thing? How do people react differently depending on how many articles/downloads they’ve made?
Track This Total Over Time
And at the same time track a permanent overall one, not just for the session, but over time. How many times has this visitor come and viewed support articles over the past year? Do the people who view lots of articles behave differently? Do you get higher reviews from those that come often but view few articles, rather than someone who comes rarely and views many?
Emailed Customer service
Sometimes emailing or contacting customer service is a good thing on these sites, and sometimes it’s a failure. Besides just tracking it as a negative goal, track it as a custom variable so you can see the differences between users who did contact customer service, and those who didn’t.
And maybe when they contacted they actually complained, and you have a drop down on the contact form for complaints. record the complaint, so you can then segment complainers from non-complainers and get some insights on what site behaviors they had to lead to complaining that might help you improve your site. Or even make it a visitor scope custom variable and compare complainers vs non-complainers over time.
There you go. Twenty different ways you can use the 5 free custom variable slots you get in Google Analytics (or maybe you have GA Premium, and you can use all 20 at the same time!). Get these in your websites today, and start gaining better insights into your visitor behavior.
About Sayf Sharif
Sayf Sharif is a Web Analyst, and expert in Usability and UX, who has worked with businesses large and small to maximize their online presence since the beginning of the Web, winning numerous awards along the way. Sayf has studied human tool use from the stone age (he went to graduate school for Archaeology) to the information age (he started programing on his father’s TRS-80), and is always interested in what goals people wish to accomplish using their tools, and how successful that experience was.