Permalink
Browse files

adds GA code

  • Loading branch information...
1 parent a84a5ae commit 4e41e8782dfa60c58073ffd1e6622ee31afcbc86 @videlalvaro committed Sep 20, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/clojure_demo/views/common.clj
@@ -2,13 +2,26 @@
(:use [noir.core :only [defpartial]]
[hiccup.page :only [include-css html5]]))
+(defpartial analytics []
+ [:script {:type "text/javascript"}
+ "var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-34953372-1']);
+ _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);
+ })();"])
+
(defpartial layout [active & content]
(html5
[:head
[:title "Cloud Foundry Clojure Integration"]
(include-css "/css/bootstrap.min.css"
"/css/bootstrap-responsive.min.css"
- "/css/styles.css")]
+ "/css/styles.css")
+ (analytics)]
[:body
[:div {:class "navbar navbar-inverse navbar-fixed-top"}
[:div {:class "navbar-inner"}

0 comments on commit 4e41e87

Please sign in to comment.