[英]How to track site search in Google Analytics and not count as a page view?
I'm using Google Analytics ( analytics.js ) to track site searches on my website: 我正在使用Google Analytics( 分析 )( analytics.js )来跟踪我网站上的网站搜索:
ga('send', 'pageview', '?q=' + search_term);
As you can see I'm using pageview
as the hit type. 如您所见,我正在使用综合
pageview
作为匹配类型。 My problem is, I don't want a new page view to be recorded each time a user performs a search on my site. 我的问题是,我不希望用户每次在我的网站上执行搜索时都记录新的页面浏览量。
Is it possible to track site search and not have each search count as a separate page view? 是否可以跟踪网站搜索,而不必将每个搜索计数都作为单独的页面浏览量? If so, how can this be done?
如果是这样,该怎么办?
Unfortunately, filtering out these Pageviews will stop Analytics from processing them further down its pipeline, which will not allow you to track Search Terms. 不幸的是,过滤掉这些浏览量将阻止Analytics(分析)进一步处理它们,这将使您无法跟踪搜索字词。
You could create a separate View for your Property, which filters out pages whose URL start with ?q=
. 您可以为您的媒体资源创建一个单独的视图,以过滤掉URL以
?q=
开头的页面。
That would allow you to track the Search Terms entered in your website and retain an overview of your website without the "inflated" Pageviews/Virtual Pageviews of search -- I presume you might be using an Ajax Search on your site?. 这样一来,您就可以跟踪在您的网站中输入的搜索字词,并保留网站的概述,而无需进行“夸大的”综合浏览量/虚拟综合浏览量-我想您可能在您的网站上使用Ajax搜索?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.