Escaping Custom Variables?

81 views
Skip to first unread message

mattp

unread,
Jan 18, 2010, 10:03:41 AM1/18/10
to google-analytics-api - GA Data Export API
Hi, the samples for setting custom variables (_setCustomVar) show
values being set including spaces, however the data shows up escaped,
both in the web version of google analytics and via the api. I can't
see any guidelines about how data should be sent.

I tried escaping the strings before sending them, but google seems to
escape the already escaped string!

Example:

I set the following

pageTracker._setCustomVar(1,'Username','Joe Bloggs',1);

And this is what is returned in the stats: Joe%20Bloggs

Surley the API supports sending variable values with spaces in? Even
the samples have spaces in. Now I could unescape the values returned
from the API, but this wouldnt work when using the web version!

Has anyone else overcome this problem?

Thanks

Nick

unread,
Jan 19, 2010, 9:36:59 PM1/19/10
to google-analytics-api - GA Data Export API
Hi Matt,

This is a known issue in how ga.js works.

Luckily through the API you can un-escape the string returned.

But through the UI there is no easy way to un-escape these strings.

-Nick

mattp

unread,
Jan 21, 2010, 5:04:47 AM1/21/10
to google-analytics-api - GA Data Export API
Cheers! Do you know if there are plans to address this behaviour?

Nick

unread,
Jan 21, 2010, 5:08:18 PM1/21/10
to google-analytics-api - GA Data Export API
Yes...but nothing in the short term.

-Nick
Reply all
Reply to author
Forward
0 new messages