The ROI Revolution Blog

Custom Variables in Google Analytics

February 2, 2010

fish.png
Last fall Google announced the release of the much anticipated Custom Variables in Google Analytics. Previously the only out of the box way to segment visitors on your site using custom metrics was to use the User Defined variable. While the User Defined method was useful for segmenting traffic into members vs non members, and for things like Michael's Exact Keyword Tracking script, Analytics users requested more options, customizations, and more control. Well, Google listened.


Unlike the User Defined variable, the Custom Variables allow you to determine the scope of the visitor engagement. Basically that means in addition to setting just a visitor level segment, you can also set session level segments, which will persist while the visitor is active on the site, and page level segments, which correspond to pageviews and events on the site. This allows you to get much more detailed with the information you're gathering and storing in the custom variable. For example, you could separate different sections of the site by using the page level scope, or you could track if a visitor has completed a particular action during their session with the session level scope.

The Custom Variable function accepts four parameters: Index, Name, Value, and Scope.


  • Index - The index refers which custom variable you are currently using. You can only set up to 5 separate custom variables within a single pageview (or event), and this number references which of those 5 you wish to use.

  • Name - Sets the name of the variable.

  • Value - Sets the value of the custom variable.

  • Scope- This is what sets the scope of the visitor segment. 1 (visitor-level), 2 (session-level), or 3 (page-level).

Now for an example. Here is the code template for a custom variable:

_setCustomVar(index, name, value, scope)

And here's what it looks like when I fill in my member tracking information:

pageTracker._setCustomVar(1, "MemberType", "Paid", 1);
pageTracker._trackPageview();

Notice that the setCustomVar() function comes before the trackPageview(). The information is only sent to Google Analytics during a pageview or an event, so keep that in mind when placing the code on your site.

Now I've set a custom variable on a visitor level that segments visitors into a paid membership category. How do I find this information in my Google Analytics account? Under the Visitors section in the left navigation click on 'custom variables' and you'll see a list of the names of the custom variables you're using on your site. Click on the names to drill down into the values of each of these variables.

custvar.png

For more information on how to set up custom Variables and some additional examples on when you might use them, check out the Google Code article.

Google Analytics for Online Advertisers
Here at ROI Revolution, we consider Google Analytics tracking essential for paid search, so it's included in our PPC Campaign Management service.

Comments

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Les said:

Great post Caitlin.

It's stuff like this that makes me wonder what else the folks at Google have up their collective sleeves.

Thanks for sharing!

February 3, 2010 8:01 AM

Pavlicko said:

Thanks for the drop-dead simple explanation of custom variables setup. I mean that in a GOOD way. :)

It's a perfect jumping off point - great example to get your feet wet.

February 3, 2010 3:35 PM

Julien Coquet said:

Hi Caitlin,

have you noticed you can 'hack' ga.js and increase total number of vars beyond 5 with the max custom vars function? ;-)

cheers,

Julien

February 4, 2010 2:29 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Julien: Actually yes, I have heard that is a possibility, but the 'how to' was a little out of the scope of the article. Plus the Google Documentation enforced the 5 at a time rule, so I figured I should stick with their recommendations. Thanks for reading! :)

February 4, 2010 4:37 PM

Patrice Albertus said:

Here comes the big subject !
Does one of you know if customvars allow multiple value ? Max char. is 64 but does this take care of value separated by comas ?

Ex:
pageTracker._setCustomVar(1, "Search", "boat,car,florida", 1);

No answer anywhere (GG groups, blogs, specialists,...). The one who get right get famous ;-)

February 5, 2010 11:14 AM

Amit said:

Hi, and thanks for clearing some of it up..

Im still not sure what the index is for...

you say:
The index refers which custom variable you are currently using

and over at google code it adds:

...A custom variable should be placed in one slot only
and not be re-used across different slots.

So, for the example - attributing the index number to 1 for a custom variable (lets say a page level one),
means ill need to use the index number 1 for any other page level custom variable on every page/event on my site?

Thanks...

February 5, 2010 3:33 PM

LaGrone said:

This will be implemented on our site. great post!

February 8, 2010 4:43 PM

Jason said:

Thanks for the clean and easy to follow example. I just found the power of custom variables in GA and have been very impressed with the architecture.

February 8, 2010 4:43 PM

Robert Kingston said:

Hi Caitlin,

Would setting a custom variable with a visitor level scope allow you to identify the first campaign a visitor sees on the site? I'm assuming it gets overwritten everytime you set it. If so, is there a way to prevent GA from overwriting it?

Cheers,
Rob

February 9, 2010 4:55 PM

Alexandre said:

Great article!

do you know if we can grab some attributes from a logged visit like profile (based in a internal database) so we can use as custom variables?

February 9, 2010 5:52 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Patrice: I haven't actually tried passing in multiple values, but my guess is that it will take everything in the value field as a string and just pass in everything within the quotes as the single value of that variable. Should be pretty easy to test though!

February 10, 2010 1:34 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Amit: The index is a number that Google is using to keep track of the custom variables. (I like to think of them like array indexes.) It's my understanding that you would need to continue referencing that specific variable with the same index number, but it wouldn't necessarily relate to the scope of the variable. You should be able to have five page level custom variables using indexes 1-5. But if you are updating the value of custom variable "1" it will need to be referenced as such.

February 10, 2010 1:39 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@Rob: If you are using manual tagging (for example with Yahoo paid search) you should be able to parse the utmz cookie in order to grab the campaign name and pass that in through the custom variable. Google Analytics attributes the visit/conversion to the most recent source and unless you tag everything with utm_nooverride=1 it will overwrite the campaign each time. If you're using autotagging with Adwords this information is not available in the utmz cookie, so the campaign would need to be set manually with a custom query parameter for each campaign. Hope that helps!

February 10, 2010 1:44 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Alexandre: You can pass pretty much anything into the custom variables (as long as it doesn't violate Google's privacy policy), so if you request the information from the database you should be able to pass that information in to the custom variables.

February 10, 2010 1:47 PM

Amit said:

@ Caitlin,
Thanks Caitlin.

So out of your explanation i understand i get to use up to 5 custom variables that has to be indexed with a number of 1-5
?

(Am i getting there :)?

February 13, 2010 5:08 PM

Matt Siesing, PPC Specialist Author Profile Page said:

@ Amit: Yes, that's correct. The Google documentation also states that it is actually 5 'per request' (which would be either a pageview or an event) so "the sum of all your custom variables cannot exceed 5 in any given request." The more requests, more custom variables you can use. :)

February 15, 2010 3:59 PM

devang said:

@Patrice Albertus - I made use of custom variables and found an interesting thing.
I tried a few different things as follows:

pageTracker._setCustomVar(1, 'h', '65-70\;71-75\;76-80\;81-85\;86-90', 3);

pageTracker._setCustomVar(1, 'h', 'multiple,custom,var,for,h', 3);

The custom variable value doesn't seem to like "," or ";" so I tried doing the following:

pageTracker._setCustomVar(1, 'h', '1-5', 3);
(pageTracker._setCustomVar1, 'h', '6-10', 3);
pageTracker._setCustomVar(1, 'h', '11-15', 3);
pageTracker._setCustomVar(1, 'h', '16-20', 3);

which works very well. I think this way we can have multiple values for a specific variable. So now I can see 4 values set for 'h'.

April 22, 2010 4:22 PM

Jarrod said:

Hi,
Great article. Do you have any insight in how to set filters for the custom variables? I have been looking around google but haven't found anything to date.

Thanks,
Jarrod

May 28, 2010 6:04 AM

John said:

Is it possible to get the Analytics data and insert it into an SQL DB through a simple form object?

May 31, 2010 10:23 AM

Zan Sule said:

Nice tutorial Caitlin. That's the best explanation I have seen online for custom vars.

I like your further illustration of how it can be viewed in the report. Keep up the good work

August 29, 2010 7:40 PM

Tasin said:

Many thanks for the article. I was wondering about any kind of delays of displaying the custom variables on the custom variable report.

The advanced segmentations display the custom variable values but nothing is displayed under custom variable report. After searching a while I saw some GA Help forum posts (with no answers to this question) that others are noticing the similar problem. Do you have any idea on this?

Cheers
Tasin

April 6, 2011 12:16 PM

Jeremy Aube, Director of Engineering Author Profile Page said:

@Tasin: Historically there have many been times where some data takes longer to show up in the reports than other data. Unfortunately I don't have any specific information regarding this specific issue. If the data still hasn't shown up after 48 hours, then there's likely an issue with the implementation.

April 8, 2011 3:09 PM

Post Your Comments

© 2002-2014 ROI Revolution, Inc. All rights reserved.