aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-15 09:35:15 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-15 09:35:15 +0100
commitdf5c0b55cc3ccdd61329c6cc37b2f993471016b7 (patch)
tree74bedcaae62d4001bb7dc02c264e6ccd743dcd58
parent8d78cb8844549dc901cd901371be6ec604fb7f68 (diff)
parent6513737cca18266b3ee8c0a9f04502b36721c2df (diff)
Merge remote-tracking branch 'wombleton/feature/google_analytics' into develop
Conflicts: config/general.yml-example
-rw-r--r--app/views/layouts/default.rhtml14
-rw-r--r--config/general.yml-example11
2 files changed, 19 insertions, 6 deletions
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index f439b27d2..5f6d5c721 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -154,6 +154,20 @@
<br />
<input type="text">
</div>
+ <%
+ ga_code = MySociety::Config.get('GA_CODE', '')
+ unless ga_code.empty?
+ %>
+ <script>
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script>
+ var pageTracker = _gat._getTracker("<%=ga_code%>");
+ pageTracker._trackPageview();
+ </script>
+ <% end %>
+
</body>
</html>
diff --git a/config/general.yml-example b/config/general.yml-example
index 7325202c1..3c50e8005 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -1,7 +1,7 @@
# general.yml-example:
# Example values for the "general" config file.
#
-# Configuration parameters, in YAML syntax.
+# Configuration parameters, in YAML syntax.
#
# Copy this file to one called "general.yml" in the same directory. Or
# have multiple config files and use a symlink to change between them.
@@ -37,7 +37,7 @@ FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
# URL of theme to install (when running rails-post-deploy script)
THEME_URL: 'git://github.com/sebbacon/alavetelitheme.git'
-# Whether a user neis eds to sign in to start the New Request process
+# Whether a user needs to sign in to start the New Request process
FORCE_REGISTRATION_ON_NEW_REQUEST: false
@@ -146,11 +146,10 @@ EXCEPTION_NOTIFICATIONS_TO:
# This rate limiting can be turned off per-user via the admin interface
MAX_REQUESTS_PER_USER_PER_DAY: 6
+
# This is used to work out where to send purge requests. Should be
# unset if you aren't running behind varnish
VARNISH_HOST: localhost
-# Set this to true if you want to use secure the admin interface with
-# HTTP Basic auth
-
-# config_username = MySociety::Config.get('ADMIN_USERNAME', '')
+# Adding a value here will enable Google Analytics on all non-admin pages.
+GA_CODE: ''