Add Google analytics tags into demo

This commit is contained in:
Laurent Destailleur 2011-02-20 16:35:35 +00:00
parent 0e98cbe45f
commit c93f349213

View File

@ -315,7 +315,7 @@ print '</table>';
$db->close();
// Google Adsense (ex: demo mode)
// Google Adsense (need Google module)
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{
print '<div align="center">'."\n";
@ -332,6 +332,23 @@ if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN
print '</div>'."\n";
}
// Google Analytics (need Google module)
if (! empty($conf->global->MAIN_GOOGLE_AN_ID))
{
print '<script type="text/javascript">'."\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";
print '</script>'."\n";
}
llxFooterVierge('$Date$ - $Revision$');