Old traditional tracking code:

var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview(location.pathname + location.search + location.hash);

New asynchronous tracking code:

_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);



Read more: http://www.searchenginepeople.com/blog/how-to-track-clicks-on-anchors-in-google-analytics.html#ixzz1TK8RHxQr

There needs to be an option to enable anchor tracking in Drupal. Currently we would have to go into the module and edit the code, which is not very flexible and makes updating to new versions of the module cumbersome at best. Any thoughts?

Comments

hass’s picture

Status: Active » Closed (duplicate)

#231451: Add hook to alter data before sending it to browser

You could also put this into custom code snippets. With a condition you can make sure that this is only executed if google does not log it out of the box.

hass’s picture

Issue summary: View changes

Simple code fix