如何防止Google Analytics破坏包含%26的查询字符串? [英] How do I keep Google Analytics from corrupting query strings that contain %26?

查看:92
本文介绍了如何防止Google Analytics破坏包含%26的查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有许多链接,其查询字符串中包含%26 (这是一种URL编码的&符号)。例如:

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

显然,Google Analytics过早解码了查询字符串,并且它在%26 作为单独的参数。



我使用排除网址查询参数选项排除大多数查询参数(包括动作,f和q)来自我们的结果。但是我使用查询字符串获得数百页统计信息,比如?+ Lomb + Canada + Inc。,我不能排除它们,因为它们都不相同。



我尝试了各种Google搜索,看看这是否是已知的错误。但是我发现所有人都遇到了麻烦,因为他们并没有编码&符号。

这是一个错误?我可以做些什么来清理我的报告? 您可以尝试在 上创建一个搜索和替换 em>请求URI 并使用正则表达式将'%26'替换为'&'。不幸的是,我对正则表达式不太了解,所以我不能真正帮助你。你可能不得不要求其他人为你写一个(或者自己弄明白)。



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



编辑:我认为它可以像下面这样简单:
搜索字符串:%26
将其替换为:&



http://rubular.com/r/V7yrenW3tt



但只是创建一个单独的配置文件并进行测试,我猜。


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?

解决方案

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.

这篇关于如何防止Google Analytics破坏包含%26的查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆