mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/lib/website.lib.php
This commit is contained in:
@@ -7474,23 +7474,6 @@ function printCommonFooter($zone = 'private')
|
||||
|
||||
print '});'."\n";
|
||||
|
||||
// Google Analytics
|
||||
// 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";
|
||||
}
|
||||
|
||||
// End of tuning
|
||||
if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO))
|
||||
{
|
||||
@@ -7519,6 +7502,28 @@ function printCommonFooter($zone = 'private')
|
||||
}
|
||||
|
||||
print "\n".'</script>'."\n";
|
||||
|
||||
// Google Analytics
|
||||
// TODO Add a hook here
|
||||
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||
{
|
||||
$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 "
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '".trim($tmptag)."');
|
||||
</script>";
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add Xdebug coverage of code
|
||||
|
||||
Reference in New Issue
Block a user