- Added configurable Google analytics template

(GOOGLE_ANALYTICS='UA-XXXX-YYYY' in your settings file)
This commit is contained in:
Jerome 2010-11-15 23:47:44 +08:00 committed by Alexis Metaireau
commit caacf48848
2 changed files with 19 additions and 7 deletions

View file

@ -0,0 +1,11 @@
{% if GOOGLE_ANALYTICS %}
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}");
pageTracker._trackPageview();
} catch(err) {}</script>
{% endif %}

View file

@ -74,5 +74,6 @@
<p>The theme is by <a href="http://smashingmagazine.com">Smashing Magazine</a>, thanks!</p> <p>The theme is by <a href="http://smashingmagazine.com">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo --> </footer><!-- /#contentinfo -->
{% include 'analytics.html' %}
</body> </body>
</html> </html>