在Google Analytics中识别出像example.com#utm_source = xxx这样的网址吗?

时间:2014-07-03 08:16:20

标签: google-analytics

我对Google Analytics网站速度有疑问。我们有许多外部促销链接,如

http://example.com?utm_source=xxx&utm_media=xxx

但是此URL将加载非缓存内容,因为每次URL都不同。我尝试将?utm_source更改为#utm_source。如何确认这将在Google Analytics中识别?

1 个答案:

答案 0 :(得分:0)

一种解决方案是在链接中使用哈希并替换虚拟网页浏览中的哈希字符:

if(document.location.hash.indexOf('utm' > -1) {   
 ga('send', 'pageview', document.location.pathname + document.location.search.replace('#','?'));
}

当哈希标记后面出现utm参数时,Google会“看到”正常的查询字符串。或者您可以使用分析界面中的替换过滤器替换哈希字符。