谷歌Analytics(分析)网站搜索查询没有在参数设置URL(JQUERY) [英] Google Analytics Site Search without Query Parameter in URL Setup (JQUERY)

查看:271
本文介绍了谷歌Analytics(分析)网站搜索查询没有在参数设置URL(JQUERY)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须建立在ASPX电子商务网站和搜索功能不使用查询参数(Q =关键字)。它呈现使用的路径的搜索。如果您例如搜索裤,你会得到/Search/Pants.aspx。但谷歌需要有一个查询参数,以计算搜索关键字的数量。

所以我的解决方案,这是具有以下的jQuery code插在我Search.aspx页面。在$ C $丙火了一个查询参数GA包括中搜索关键字的URL。正如你所看到的,我使用LT - 。%= this.keywords%>的电子商务软件的使用产生的搜索结果页面的面包屑

这个问题是,当用户通过搜索结果导航到2,3,4页..,jQuery的code依然红火起来,以GA相同的关键字时,它不是被搜查。所以关键字计数我得到GA虚增报表。

能否请您帮忙设置的东西,将计算搜索一次。这是当有人进入第2页,/Search/Keywords.aspx/2等生成的URL。谢谢

 < UL类=面包屑>
        <立GT;的查询结果<%= this.keywords%GT;< /李>
    < / UL>    <! - 站内搜索跟踪脚本 - >
    <脚本>
     $(文件)。就绪(函数(){
     _gaq.push(['_ trackPageview的','/搜Q = LT;%= this.keywords%GT;']);
    });
   < / SCRIPT>


解决方案

这是基于路径的URL结构提取网站的搜索查询(VS参数为主)现在可以使用谷歌分析过滤器来完成:http://www.lunametrics.com/blog/2013/07/01/google-analytics-site-search-seo-friendly-urls/

I have an eCommerce site built on ASPX and search feature doesn't use Query Parameter(?q=keyword). It render a search using a path. If you example search for "Pant", you get /Search/Pants.aspx. But google require to have a query parameter in order to count the number of keywords searched.

So my solution to this was having the following jQuery code inserted in my Search.aspx page. The code fire up a URL with a query parameter to GA including the keyword that was searched for. As you can see I'm using <%= this.keywords %> that eCommerce software use to generate the breadcrumb in the search result page.

The problem with this is when users navigate to page 2,3,4.. through the search results, the jQuery code still fire up to GA the same keywords for being searched when it's not. So the keywords count gets inflated in my GA reports.

Could you please help setup something that will count the search only one time. This is the URL generated when someone go to page 2, /Search/Keywords.aspx/2 and so on. Thanks

     <ul class="breadcrumbs">
        <li>SEARCH RESULTS FOR "<%= this.keywords %>"</li>
    </ul>

    <!-- Site Search Tracking Script -->
    <script>
     $(document).ready(function(){
     _gaq.push(['_trackPageview', '/search?q=<%= this.keywords %>']);
    });
   </script>

解决方案

Extracting site search queries from path-based URL structures (vs parameter-based) can now be done using Google Analytics filters: http://www.lunametrics.com/blog/2013/07/01/google-analytics-site-search-seo-friendly-urls/

这篇关于谷歌Analytics(分析)网站搜索查询没有在参数设置URL(JQUERY)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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