Skip to content

Commit 9e142a1

Browse files
author
Marylou Kunkle
committed
Google Analytics code only for production mode
Google Analytics code will now only run if the site is in production mode.
1 parent e78d4c2 commit 9e142a1

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

views/layout.haml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
%link{:rel => "stylesheet", :href => "/stylesheets/reset.css", :type => 'text/css'}
66
%link{:rel => "stylesheet", :href => "/stylesheets/site.css", :type => 'text/css'}
77
%link{:rel => "stylesheet", :href => "/stylesheets/ruby.css", :type => 'text/css'}
8-
:javascript
9-
var _gaq = _gaq || [];
10-
_gaq.push(['_setAccount', 'UA-10499799']);
11-
_gaq.push(['_trackPageview']);
12-
13-
(function() {
14-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
15-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
16-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
17-
})();
18-
8+
- if production?
9+
:javascript
10+
var _gaq = _gaq || [];
11+
_gaq.push(['_setAccount', 'UA-10499799']);
12+
_gaq.push(['_trackPageview']);
13+
14+
(function() {
15+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
16+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
17+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
18+
})();
1919
%body
2020
%nav{:style => "float:right;"}
2121
<a href="/">Home</a> \

0 commit comments

Comments
 (0)