Two days ago, I’ve dressed up this blog with a new theme. When everything seem to be fine, I’ve found that WordPress.com Stats and Google Analytics plugins were not working the way they did the moment before I’ve changed to a new theme.
These plugins stopped collecting data on my blog traffic straight after I’ve applied the new theme. I’m wondering did you faced this issue before or just me? I tried to deactivate and activate back the plugins but not working. So I went and searched for solution on Google and luckily, I am not the only person who faced the same issue. I came across a post that highlights the solution on how to fix the issue.
What has caused this issue is that a function has missing or left out from the theme which prevents WP Stats and Google Analytics from working. Apparently, the theme owner has forgotten to insert the function. To fix this issue, you need to edit the footer.php in your theme editor. From your WordPress’s admin panel, navigate to Design > Theme Editor > footer.php.
In the footer.php file, you need to look for the </body> tag. Once found, insert this code above the tag.
<?php wp_footer(); ?>
Once done, update the file. WP Stats and Google Analytics should be working by now.