Analytics Plugin - Google analytics script

This is dued to the script included in the plugin, google changed that and the
visits are no more counted.

HOW TO SOLVE

In the analytics plugin:
Located at: /usr/share/webmin/virtualmin-google-analytics/Virtualmin/GoogleAnalytics.pm

Change the line 52

$addscript .= "var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\"); document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\")); try { var pageTracker = _gat._getTracker(\"$account\"); pageTracker._trackPageview(); } catch(err) { }";

With:

$addscript .= "var _gaq = _gaq || [];_gaq.push(['_setAccount', '$account']);_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);})();";

To add analytics script at the last version.

Bye

Status: 
Closed (fixed)

Comments

Latest version of Analytics script

I'm pretty sure the latest version of the analytics plugin already uses this new code from google ..