Permalink
Browse files

moved google analytics code to erb template

  • Loading branch information...
1 parent be0a649 commit 89cc272f34ab98b6972309042f40668b4e907050 @markryall markryall committed Apr 3, 2013
Showing with 16 additions and 18 deletions.
  1. +13 −0 app/views/layouts/_ga.html.erb
  2. +1 −3 app/views/layouts/application.html.slim
  3. +2 −6 app/views/layouts/landing.html.slim
  4. +0 −9 public/ga.js
@@ -0,0 +1,13 @@
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-35730418-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);
+ })();
+
+</script>
@@ -1,18 +1,16 @@
doctype html
html
head
+ = render partial: 'layouts/ga'
title Ocelots
link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"
= stylesheet_link_tag '/bootstrap/css/bootstrap.min.css'
= stylesheet_link_tag '/bootstrap/css/bootstrap-responsive.min.css'
= stylesheet_link_tag 'application', media: 'all'
= stylesheet_link_tag '/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.css'
= csrf_meta_tags
- = javascript_include_tag '/ga.js'
= yield :style_includes
-
body
-
div.navbar.navbar-fixed-top
div.navbar-inner
div.container
@@ -2,21 +2,17 @@ doctype html
html
head
= render partial: 'layouts/gace'
+ = render partial: 'layouts/ga'
title Ocelots
-
= stylesheet_link_tag '/bootstrap/css/bootstrap.min.css'
-
=stylesheet_link_tag 'style', media: 'all'
=stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Patrick+Hand'
=stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Unica+One'
=stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Titillium+Web:400,700'
= csrf_meta_tags
- = javascript_include_tag '/ga.js'
-
body
-
div.container
= yield
= javascript_include_tag 'application'
- = javascript_include_tag 'https://login.persona.org/include.js'
+ = javascript_include_tag 'https://login.persona.org/include.js'
View
@@ -1,9 +0,0 @@
-var _gaq = _gaq || [];
-_gaq.push(['_setAccount', 'UA-35730418-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);
-})();

0 comments on commit 89cc272

Please sign in to comment.