Browse Source

google analytics code added

master
Christian Mueller 14 years ago
parent
commit
5849893a7c
  1. 1
      .gitignore
  2. 9
      resources/public/js/google-analytics.js
  3. 4
      src/NoteHub/views/common.clj

1
.gitignore vendored

@ -6,5 +6,4 @@ pom.xml
/lib/ /lib/
/classes/ /classes/
.lein-* .lein-*
resources/public/js/*
.crossover-cljs .crossover-cljs

9
resources/public/js/google-analytics.js

@ -0,0 +1,9 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32546723-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);
})();

4
src/NoteHub/views/common.clj

@ -3,6 +3,7 @@
[NoteHub.settings :only [get-message]] [NoteHub.settings :only [get-message]]
[NoteHub.views.css-generator] [NoteHub.views.css-generator]
[noir.core :only [defpartial]] [noir.core :only [defpartial]]
[noir.options :only [dev-mode?]]
[hiccup.page :only [include-js html5]] [hiccup.page :only [include-js html5]]
[hiccup.element :only [javascript-tag]])) [hiccup.element :only [javascript-tag]]))
@ -22,7 +23,8 @@
"&subset=latin,cyrillic") " " "+") "&subset=latin,cyrillic") " " "+")
:rel "stylesheet" :rel "stylesheet"
:type "text/css"}] :type "text/css"}]
[:style {:type "text/css"} (global-css params)]] [:style {:type "text/css"} (global-css params)]
(if-not dev-mode? (include-js "/js/google-analytics.js"))]
(if (params :js) (if (params :js)
[:body content [:body content
(javascript-tag "var CLOSURE_NO_DEPS = true;") (javascript-tag "var CLOSURE_NO_DEPS = true;")

Loading…
Cancel
Save