• I’m using a single page wordpress theme which has anchor links on the navigation menu to scroll to various sections of the page. I found this page (https://white.net/blog/tracking-clicks-on-anchors-in-google-analytics/) that suggests to change the tracking code to use:

    _gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);

    How do I change the tracking code that the Google Analytics plugin embeds in the head? I tried the custom field in the Advanced tab, but that won’t let me modify the existing _trackPageview code, it just adds a new one. On top of that, when it renders the custom code in the page, it has slashes in front of all single quotes. Looks like this:

    _gaq.push([\'_trackPageview\', location.pathname + location.search + location.hash]);

    https://www.ads-software.com/plugins/google-analytics-for-wordpress/

  • The topic ‘tracking in-page anchor link clicks’ is closed to new replies.