Tracking Anchor Links in Goal Funnels

僤鯓⒐⒋嵵緔 提交于 2019-12-04 18:32:29

_setAllowAnchor(bool) won't solve your problem; that's a function for allowing Google Analytics to read campaign query strings from the anchor (ie, #utm_medium=cpc.)

This can be hard to do reliably cross-browser without something like jQuery.

You'll need to include a plugin like this to deal with past IE problems: http://benalman.com/code/projects/jquery-hashchange/docs/files/jquery-ba-hashchange-js.html

The following should attach a function to a cross-browser compatible hashchange event, and then create a 'fake' pageview to allow you to track it separately in Google Analytics.

   $(window).hashchange( function() {
       _gaq.push(['_trackPageview',location.pathname+location.search+location.hash]);
    });
});

This should have wider compatibility than some of the other options.

In GA, in your stated example, the 'anchored' page will track as /enquiry/#message.

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