Google Analytics Custom Variables Multiple Values ​​Per Slot

Since I cannot set multiple values ​​for the same slot at the same time, using code like this

var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'XXXXXXXX']);
    _gaq.push(['_setDomainName', 'mydomain.com']);
    _gaq.push(['_setCustomVar',1,'ONE',"www.mydomain.com/ONE",1]);
    _gaq.push(['_setCustomVar',1,'TWO',"www.mydomain.com/ONE",1]);
    _gaq.push(['_setCustomVar',2,'THREE',"www.mydomain.com/ONE",1]);
    _gaq.push(['_setCustomVar',2,'FOUR',"www.mydomain.com/ONE",1]);     
    _gaq.push(['_trackPageview']);

Is there another strategy to get the same results?

+4
source share
1 answer

Yes. You can combine multiple values ​​with the separator character value1 # value2 # value3, send them as one variable and use regular expressions to create segments or filters based on individual parts.

Remember that there is a limit on the total number of characters :

The total total length of any name and value of a custom variable can be no more than 128 characters.

+2

Source: https://habr.com/ru/post/1529816/


All Articles