AbdFatah / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

_setCustomVar double urlencode issue #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Name of API affected:
Analytics Data Export API

Issue summary:
When you set a custom variable using _setCustomVar, the key and value are
urlencoded before they are processed for length checks etc which is
understandable to be sure that the key/value pair is less than the maximum
64 characters. The issue is that when the values are stored internally they
are not urldecoded. This presents an issue later when (presumably) the GA
library urlencodes all of the individual query string key/value pairs. The
result is that in the image request that goes out to GA servers, the custom
variable key/value pairs end up double urlencoded; therfore, the data is
interpreted in the reporting interface where it is urldecoded, but what is
seen is the result of the first urlencoding that takes place (again
presumably) to accurately calculate the length of the combined key and
value. This could have the unintended consequence of increasing the length
of the image request past the total allowed maximum producing strange
behavior as the last query string key/value pairs could be left out.
Furthermore, it makes any data passed into the custom variable nasty.

Steps to reproduce issue:
1. track = _gat._getTracker('123456');
2. track._setCustomVar(1, "this is the key", "this is the value", 3);
3. track._trackPageview();

Expected output:

http://www.google-analytics.com/__utm.gif?utmwv=4.6.5&utmn=1748115624&utmhn=www.
stratigent.com&utme=8(this%20is%20the%20key)9(this%20is%20the%20value)&utmcs=UTF
-8&utmsr=1280x800&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=10.0%20r32&utmdt=Strati
gent%2C%20Web%20Analytics%20Consulting%20%26%20Marketing%20Optimization&utmhid=6
61464182&utmr=-&utmp=%2F&utmac=123456&utmcc=__utma%3D148176373.1407685718.126411
7471.1264126776.1264200081.4%3B%2B__utmz%3D148176373.1264117471.1.1.utmcsr%3D(di
rect)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmx%3D148176373.%3B

Actual results:

http://www.google-analytics.com/__utm.gif?utmwv=4.6.5&utmn=1748115624&utmhn=www.
stratigent.com&utme=8(this%2520is%2520the%2520key)9(this%2520is%2520the%2520valu
e)&utmcs=UTF-8&utmsr=1280x800&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=10.0%20r32&
utmdt=Stratigent%2C%20Web%20Analytics%20Consulting%20%26%20Marketing%20Optimizat
ion&utmhid=661464182&utmr=-&utmp=%2F&utmac=123456&utmcc=__utma%3D148176373.14076
85718.1264117471.1264126776.1264200081.4%3B%2B__utmz%3D148176373.1264117471.1.1.
utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmx%3D148176373.
%3B

Notes:
This has been noted in your Google Blog which I stumbled upon while
researching the issue.

Original issue reported on code.google.com by Goodwe...@gmail.com on 22 Jan 2010 at 10:54

GoogleCodeExporter commented 9 years ago
Hi, This is a public issue list for the Google Analytics Data Export API. As 
this request 
deals with tracking, and not export, I'm removing. Unfortunately we do not have 
a public 
forum for tracking feature request at this time.

Original comment by nickski1...@gmail.com on 25 Feb 2010 at 11:56

GoogleCodeExporter commented 9 years ago
Removing an obsolete label that was used when these issues were in the 
gdata-issues project.

Original comment by jrobbins@google.com on 21 Jul 2011 at 10:04