diff --git a/bandeaux.php b/bandeaux.php index c79c3c90bf5df6dfc1cb07aef8b6095501b662de..f7d9f27ec2c26474853eda7460c6edf3e38cad9e 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -51,21 +51,21 @@ function framanav() } function gAnalytics() { -echo <<<gAnalytics + if (GOOGLE_ANALYTICS_ID !== false) { + echo ' <script type="text/javascript"> - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-896440-11']); - _gaq.push(['_trackPageview']); + _gaq.push([\'_setAccount\', \''.GOOGLE_ANALYTICS_ID.'\']); + _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); + 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); })(); -</script> -gAnalytics; +</script>'; + } } diff --git a/variables.php.template b/variables.php.template index c822c90e53e5251567ecc20998a79d8365e4bc19..e37ef0b15dbc72027e8f7b3f0ad0dffb28829104 100644 --- a/variables.php.template +++ b/variables.php.template @@ -78,6 +78,9 @@ define('LOGOLETTRE', '<chemin relatif suivi du nom du fichier du logo pour la le // Activation des URL propre (true pour activer, false sinon) define('URL_PROPRE', false); +// Activation de Google Analytics (false si inactif, l'identifiant sinon) +define('GOOGLE_ANALYTICS_ID', false); + if (@file_exists('variables.local.php')) { include('variables.local.php'); }