Google Analytics is an invaluable asset for any web marketing team. There are some amazing things you can do in Analytics which might not appear so obvious at first. Once you discover the potential of custom variables you will be blown away with all the extra data you can gather.

So What Is A Custom Variable?

Your Analytics account already tracks plenty of visitor data as standard. If you like, you can log-in and quickly check where your visitors reside, what search term they entered into Google to find your website, which website referred them, whether they are new or returning and plenty more. There are also other things you might want to keep track of too, this is where custom variables comes in. A custom variable gives you the flexibility to customize Google Analytics and gather the most important visitor data for your business.

You might already be comfortable with custom variables but if not then take a little time out of your day and spend an hour or so reading Google's own guide, it will give you an idea of the basics of using custom variables and segmenting reports and how to implement them.

Tell Me More

In order to give advice on what kind of custom variables you could and should be using, we need to split down what kind of data you should be tracking. In order to figure out what kind of data you should be tracking we need to look at what kind of website you have. For example, an eCommerce store might want to track items in a shopping cart or promotional offers where-as a blog might want to track how popular certain authors are. For this reason, I will break up my custom variable tips in to 4 category's and as a bonus, I'll add the code for each variable.

Service or Support Sites

1. Handling complaints - Imagine you get 100 emails a day. At the end of the month you might usually have to sift through around 3000 emails to see which ones are complaints. Not if you use this custom variable, it will allow you to compare complainers with non-complainers. Two of the main reasons for complaints are poor communication and delivery issues so implement some of these tips if you haven't already, then track your complaints over time to see if things get better.

_gaq.push(
['_setCustomVar',5,'Complaint','yes',2]);

2. Keep track of which articles helped visitors - 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?

_gaq.push(['_setCustomVar',2,'Session Articles','5',2]);

Ecommerce Stores

3. Track the loyalty of your customers - This can be great for eCommerce stores. Knowing how many customers have ordered once compared to how many customers have ordered 4 times can show you which customers show loyalty. This is invaluable data if you want to keep them coming back.

`_gaq.push(['_setCustomVar',2,'Purchases','4',1])`

4. Track product views - Using this variable, you can track which product get viewed the most and also what kind of products lead to sales of other products on your website.

_gaq.push(['_setCustomVar',3,'View Product','ABC1234',2]);

5. Track the number of items in the shopping cart - This can help in two ways; the first is (obviously) to see how many items might be in a customers cart, the second is to give you an idea of abandoned carts. An idea to take this further is to then work out your conversion rate based on completed orders and then to compare it to uncompleted orders. If you can figure out why baskets are being abandoned and can sort the problem out this will seriously increase your revenue without even having to put effort into trying to rank higher in Google to bring in extra visitors - although you will obviously want to do that too.

_gaq.push(['_setCustomVar',4,'Cart Items','4',2]);

Lead Generation Sites

6. Are they a real lead or just a visitor? - If a customer fills out a contact form or enters some details, they are a lead. Using this variable means that you can track whether they come back and their behaviour. Once you can see a set of behaviours you can start using this data to increase conversion rates.

_gaq.push(['_setCustomVar',1,'Lead','Yes',1]);

7. Start tracking newsletter subscribers - This can really assist if you want to drive visitors back to your site. Collating data from your newsletter email software and Analytics account can provide some really powerful information. You can check what brings people back to your site and in turn this will help turning visitors in to leads.

_gaq.push(['_setCustomVar',2,'Newsletter subscriber','Yes',1]);

Blogs

8. Keep a track of your most popular authors - Many blogs have multiple authors and there's an easy way to see which authors bring your blog traffic.

_gaq.push(['_setCustomVar',1,'Author','Matt Janaway',3]);

9. Keep a track of your most popular categories - like above, knowing this information can be vital to write more of the things that your visitors want to read.

_gaq.push(['_setCustomVar',2,'Category','Google Analytics',3]);

10. Track visitors who comment - Visitors who arrive on your site, read what you have to say and then continue to comment are much more likely to keep coming back. Until a visitor comments, track them as "no" once they do comment then track them as "yes".

_gaq.push(['_setCustomVar',4,'Commented','Yes',1]);
_gaq.push(['_setCustomVar',4,'Commented','No',1]);

Remember that as standard, you are only allowed 5 custom variables unless you upgrade to Google Analytics Premium. Use them wisely!

Do you use custom variables? How?