diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 9cecd9e3be6..7db8f730e41 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7721,17 +7721,22 @@ function printCommonFooter($zone = 'private')
// TODO Add a hook here
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
{
- print "\n";
- print "/* JS CODE TO ENABLE for google analtics tag */\n";
- print ' var _gaq = _gaq || [];'."\n";
- print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
- print ' _gaq.push([\'_trackPageview\']);'."\n";
- print ''."\n";
- print ' (function() {'."\n";
- print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n";
- print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n";
- print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n";
- print ' })();'."\n";
+ $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
+ foreach($tmptagarray as $tmptag) {
+ print "\n";
+ print "/* JS CODE TO ENABLE for google analtics tag */\n";
+ print "
+
+
+ ";
+ print "\n";
+ }
}
// End of tuning