Skip to content

Commit

Permalink
Added analytics support
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid committed Oct 20, 2009
1 parent d65d87e commit dcedaed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.py
Expand Up @@ -46,3 +46,6 @@

# Length (in words) of summaries, by default
summary_length = 200

# If you want to use Google Analytics, enter your 'web property id' here
analytics_id = None
11 changes: 11 additions & 0 deletions themes/default/base.html
Expand Up @@ -60,5 +60,16 @@ <h3>{{sidebar.0}}</h3>
</p>
</div>
</div>
{% if config.analytics_id %}
<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("{{config.analytics_id}}");
pageTracker._trackPageview();
} catch(err) {}</script>
{% endif %}
</body>
</html>

0 comments on commit dcedaed

Please sign in to comment.