Skip to content
Browse files

Consistency improvement for the Google Analytics partial (copied from…

… master branch).
  • Loading branch information...
1 parent 7fb5004 commit 8c28cd3842f0936f93ff5624d0fe5cfa98806e45 @vanderhoorn vanderhoorn committed Nov 11, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 app/views/shared/_google_analytics.html.haml
View
9 app/views/shared/_google_analytics.html.haml
@@ -1,8 +1,13 @@
-- if current_site.content.analytics_code.present? || Settler[:google_analytics_key].present?
+- if current_site.content.analytics_code.present?
+ - analytics_code = current_site.content.analytics_code
+- elsif Settler[:google_analytics_key].present?
+ - analytics_code = Settler[:google_analytics_key]
+
+- if analytics_code
/ Google Analytics code
:javascript
var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '#{escape_javascript(current_site.content.analytics_code || Settler[:google_analytics_key])}']);
+ _gaq.push(['_setAccount', '#{escape_javascript(analytics_code)}']);
_gaq.push(['_trackPageview']);
(function () {

0 comments on commit 8c28cd3

Please sign in to comment.
Something went wrong with that request. Please try again.