I recently noticed that the reports for google analytics have started to act intermittently and I'm using the plugin built by OSClass which only asked for the tracking ID in the backend, I investigated and found that the issue was the plugin is using an old tracking code which is now being detected as missing or invalid even if the code is there. So the plugin needs to be updated now with the new tracking code.
The old code from the plugin was this:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $id; ?>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? '
https://ssl' : '
http://www') '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
and should now be replaced with:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?php echo $id; ?>', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
</script>
The code can be found on the /plugins/google_analytics/footer.php <<<just replaced the old script tag with the new one from google analytics tracking info.
You can also placed the new code on the footer.php of your theme if you don't want to use the plugin.
Issues screen shot in attachment: