After I upgraded and changed my page template, Stats was no longer recording any page hits. After some time lurking on the forums and trying different things I finally figured out what the problem was. Hopefully my fix may help someone else.
In the Stats php file I noticed that the tracker is added by appending the code to the wp_footer() function called by the page templates. If the template doesn’t use wp_footer() then the Stats tracker wont be added. So I checked my template to make sure that it was in fact calling that function. Nope, it wasn’t – it was calling get_footer(). So I edited the Stats .php file and changed ‘wp_footer()’ to ‘get_footer()’.
Disclaimer: I did this a few days ago so details may be a bit fuzzy. Also, I basically have no idea what I was doing so use this fix at your own risk. Devs, anything to add?
- The topic ‘[Plugin: WordPress.com Stats] Fix for Stats not recording page views’ is closed to new replies.