As Google has deprecated _setVar this stuff needs to be changed to _setCustomVar. If You use profile segmentation, please do a test and report back if this works for you or not.

Patch attached.

CommentFileSizeAuthor
ga_custom_variable.patch3.68 KBhass

Comments

hass’s picture

As a note, I made this is session-level variable. I feal very upset about the 64 byte limit as this does not really allow us to save enough data. I have no idea how we should solve this :-(. Only workaround we may use is one selected profile item is one variable. In this case we can do more (up to 5 selections), but nevertheless this is bad.

http://code.google.com/intl/de-DE/apis/analytics/docs/tracking/gaTrackin...

becw’s picture

Do you think it might make sense to deprecate profile segmentation in favor of custom variables? (Multiple custom variables) If Token provides user profile tokens (does it?), then this would be covered less some reconfiguration on the part of site maintainers--reconfiguration they'll have to deal with somewhere, since Google Analytics itself has changed anyway.

And I agree that 5 variables is limiting, but as far as I can tell it's 5 variables per hit, not 5 variables in total, ever.

hass’s picture

From my understanding you are not allowed to "reuse slots" with different data... never tried it yet - but it reads as if you use slot 1 for "foo" variable you are not allowed to use slot 1 on other pages for "bar"... very confusing

becw’s picture

I think it depends on the variable scope--you can set variables in each of the five slots at the visitor, session, or page level, but you can only set each slot once for the scope--so there can be 5 user variables, 5 session variables, and 5 page variables. But you can set slot 1 as 'foo' => 'bar' on one page view, and then set the same slot as 'kittens' => 'monkeys' on the next page view and Google Analytics doesn't care. They do recommend that you always set a particular variable in the same slot.

Or at least, that was the way I understood it.

hass’s picture

so there can be 5 user variables, 5 session variables, and 5 page variables

No, you can use e.g. 3 user, 1 session, 1 page = 5 variables or mix it up as you like - but you cannot have more than 5 in a sum.

But you can set slot 1 as 'foo' => 'bar' on one page view, and then set the same slot as 'kittens' => 'monkeys' on the next page view and Google Analytics doesn't care.

I wish this would be the case, but I understood it different. Otherwise I do not understand why they write you cannot "re-use" a slot for different things.

hass’s picture

Status: Needs review » Closed (duplicate)

Only possible and recommended upgrade path is in #609892: Multiple custom variables. Marking as duplicate.