Permalink
Browse files

Don't load analytics on dev

  • Loading branch information...
1 parent 6cc467e commit 7632b9f5202b4940bb8b96036767a9f3b29a03a9 @darkwing darkwing committed Mar 22, 2013
Showing with 7 additions and 7 deletions.
  1. +1 −1 apps/landing/test_templates.py
  2. +6 −6 templates/includes/google_analytics.html
@@ -27,7 +27,7 @@ def test_social_promo(self):
def test_google_analytics(self):
url = reverse('landing.views.home')
- constance.config.GOOGLE_ANALYTICS_ACCOUNT = ''
+ constance.config.GOOGLE_ANALYTICS_ACCOUNT = '0'
r = self.client.get(url, follow=True)
eq_(200, r.status_code)
ok_('var _gaq' not in r.content)
@@ -1,15 +1,15 @@
-{% if config.GOOGLE_ANALYTICS_ACCOUNT %}
+{% if config.GOOGLE_ANALYTICS_ACCOUNT != '0' %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ config.GOOGLE_ANALYTICS_ACCOUNT }}']);
_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);
- })();
+ (function(a, d) {
+ var ga = d.createElement(a); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = d.getElementsByTagName(a)[0]; s.parentNode.insertBefore(ga, s);
+ })('script', document);
</script>
{% endif %}

0 comments on commit 7632b9f

Please sign in to comment.