How do I keep Google Analytics from corrupting query strings that contain %26?

感情迁移 提交于 2019-12-11 02:45:13

问题


I have many links on my site that have query strings that contain %26 (which is a URL-encoded ampersand). For example:

?action=keyword_results&f=company&q=Bausch+%26+Lomb+Canada+Inc.

Apparently, Google Analytics is prematurely decoding the query string and it treats the text after the %26 as a separate parameter.

I use the Exclude URL Query Parameters option to exclude most query parameters (including action, f, and q) from our results. But I am getting stats for hundreds of pages with query strings like ?+Lomb+Canada+Inc. and I can't exclude them because they are all different.

I've tried a variety of Google searches to see if this is a known bug. But all I found was people having trouble because they weren't encoding the ampersand.

Am I doing something wrong? Is this a bug? Is there anything I can do to clean up my reports?


回答1:


You could try creating a "search and replace" filter on Request URI and use regex to replace '%26' with '&'. Unfortunately, I'm not too experienced with regex, so I can't really help you there; you might have to ask someone else to write one for you (or figure it out yourself, of course).

https://support.google.com/analytics/answer/1034834

edit: I think it could something as easy as: search string for: %26 replace it with: &

http://rubular.com/r/V7yrenW3tt

But just create a separate profile and test it, I guess.



来源:https://stackoverflow.com/questions/19945673/how-do-i-keep-google-analytics-from-corrupting-query-strings-that-contain-26

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!