diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-08-17 11:40:20 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-08-17 11:40:20 +0000 |
commit | 14072e8bb2f4c5b7e2fdde16422dcdd037825656 (patch) | |
tree | 1f51c3e093b4cf8dc667034f25db0a66b81d20f5 | |
parent | 43c6ec73edd5b3c46141954e0ec036e8427af2cf (diff) | |
download | mediawiki-14072e8bb2f4c5b7e2fdde16422dcdd037825656.tar mediawiki-14072e8bb2f4c5b7e2fdde16422dcdd037825656.tar.gz mediawiki-14072e8bb2f4c5b7e2fdde16422dcdd037825656.tar.bz2 mediawiki-14072e8bb2f4c5b7e2fdde16422dcdd037825656.tar.xz mediawiki-14072e8bb2f4c5b7e2fdde16422dcdd037825656.zip |
move ga tracking code into head element
-rw-r--r-- | skins/Vector.php | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/skins/Vector.php b/skins/Vector.php index 4cd2eba..a6e33cf 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -445,6 +445,21 @@ class VectorTemplate extends QuickTemplate { $this->data['personal_urls'] = array_reverse( $this->data['personal_urls'] ); } + + $this->addScript(' +<script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(["_setAccount", "UA-18603191-2"]); + _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); + })(); +</script> +'); + // Output HTML Page $this->html( 'headelement' ); @@ -599,17 +614,6 @@ class VectorTemplate extends QuickTemplate { <!-- Debug output: <?php $this->text( 'debug' ); ?> --> <?php endif; ?> </div> - <script type="text/javascript"> - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-18603191-2']); - _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); - })(); - </script> <script src="//nav.mageia.org/js/"></script> </body> </html> |