From 503206af88f4511658e81a1d96ac05fa8f4a2e93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 16:38:58 +0200 Subject: [PATCH] Fix analytics tag --- htdocs/core/lib/functions.lib.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) 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