Fold All / Expand All

2007年12月28日 星期五

Back to Google Analytics Legacy Tracking Code

Since I use new tracking code of Google Analytics on this blog, those non-ascii ``Keyword'' become escaped. Something like 「%e6%97%a5%e6%96%87%e7%b7%9a%e4%b8%8a%e7%bf%bb%e8%ad%af」. Actually it's 「日文線上翻譯」 in UTF-8 encoding. 「日」 in UTF-8 is composed of 3 bytes "E6 97 A5".

However, other sites I still use "urchin.js" do not have this problem. The sites using new tracking code (ga.js) all have this problem.

There is one post discussing this problem in Google Groups, but no solution right now.

So I decided to use the legacy tracking code first.

後記:
剛才稍微測試了一下,基本上應該就是沒有做decodeURI()這個動作。
[new tracking code]
q=%E3%81%A0%E3%82%93%E3%81%94%E5%A4%A7%E5%AE%B6%E6%97%8F+frank

[legacy tracking code]
utmr=http://www.google.com.tw/search?q=%E6%97%A5%E6%96%87%E7%B7%9A%E4%B8%8A%E7%BF%BB%E8%AD%AF

but, using www.google.cn
[new tracking code]
q=%D0%AF%D0%BF%D0%BE%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D0%BC%D1%83%D0%B7%D1%8B%D0%BA%D0%B0+%E8%8C%B6%E5%A4%AA

[legacy tracking code]
q=%D0%AF%D0%BF%D0%BE%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D0%BC%D1%83%D0%B7%D1%8B%D0%BA%D0%B0+%E8%8C%B6%E5%A4%AA

search.yahoo.com
[new tracking code]
utmr=http://search.yahoo.com/search?p=frank+%E3%81%A0%E3%82%93%E3%81%94%E5%A4%A7%E5%AE%B6%E6%97%8F

[legacy tracking code]
utmr=http://search.yahoo.com/search?p=frank+%E3%81%A0%E3%82%93%E3%81%94%E5%A4%A7%E5%AE%B6%E6%97%8F

沒有留言: