Fix issue #11 : Google Analytics n'est plus obligatoire

This commit is contained in:
Simon Leblanc 2011-07-02 23:13:56 +02:00
parent 6e19094c2b
commit 894b526eff
2 changed files with 12 additions and 9 deletions

View File

@ -51,21 +51,21 @@ function framanav()
} }
function gAnalytics() { function gAnalytics() {
echo <<<gAnalytics if (GOOGLE_ANALYTICS_ID !== false) {
echo '
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-896440-11']); _gaq.push([\'_setAccount\', \''.GOOGLE_ANALYTICS_ID.'\']);
_gaq.push(['_trackPageview']); _gaq.push([\'_trackPageview\']);
(function() { (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 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'; 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 s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
})(); })();
</script> </script>';
gAnalytics; }
} }

View File

@ -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) // Activation des URL propre (true pour activer, false sinon)
define('URL_PROPRE', false); 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')) { if (@file_exists('variables.local.php')) {
include('variables.local.php'); include('variables.local.php');
} }