Permalink
Browse files

add kissmetrics code

  • Loading branch information...
1 parent 0cb420b commit 0f2885fec260bb5df1285d92836ad70f79a7949b @aehlke committed Feb 15, 2012
Showing with 21 additions and 0 deletions.
  1. +4 −0 fabfile.py
  2. +17 −0 templates/base.html
View
4 fabfile.py
@@ -23,6 +23,9 @@ def build_media():
with cd(env.path):
python('manage.py collectstatic --noinput')
+def git_push():
+ local('git push')
+
def git_pull():
with cd(env.path):
run('git pull origin master')
@@ -32,6 +35,7 @@ def backup():
sudo('cron/tarsnap_backup.sh')
def lite_deploy():
+ git_push()
git_pull()
upload_settings()
restart_webserver()
View
17 templates/base.html
@@ -9,6 +9,23 @@
<html>
<head>
+ <script type="text/javascript">
+ var _kmq = _kmq || [];
+ function _kms(u){
+ setTimeout(function(){
+ var s = document.createElement('script'); var f = document.getElementsByTagName('script')[0]; s.type = 'text/javascript'; s.async = true;
+ s.src = u; f.parentNode.insertBefore(s, f);
+ }, 1);
+ }
+ _kms('//i.kissmetrics.com/i.js');_kms('//doug1izaerwt3.cloudfront.net/79d44fed4c032657d06cd8f6635adcd178885255.1.js');
+ </script>
+
+ {% if user.is_authenticated %}
+ <script type="text/javascript">
+ _kmq.push(['identify', '{{ user.username|escapejs }}']);
+ </script>
+ {% endif %}
+
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

0 comments on commit 0f2885f

Please sign in to comment.