Browse files

Add GA

  • Loading branch information...
1 parent 53e4a71 commit ea61ad87493d4e668e3827516a89e4be1dc22ad4 @rwdaigle committed Oct 23, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 app/views/layouts/application.html.haml
View
12 app/views/layouts/application.html.haml
@@ -11,6 +11,18 @@
= javascript_include_tag :application
= csrf_meta_tags
+ - if(Rails.env.production?)
+ :javascript
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-77805-14']);
+ _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);
+ })();
+
%body.launch
#profile
= link_to("logout", logout_path) if user_logged_in?

0 comments on commit ea61ad8

Please sign in to comment.