<%- if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.fixmytransport.com' %>
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-24232514-1']);
      <% if content_for?(:tracking) %>
      _gaq.push(['_trackPageview', <%= yield(:tracking) %>]);
      <%- else %>
      _gaq.push(['_trackPageview']);
      <%- end %>
      (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>
<%- end %>

<%- if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.fixmytransport.com' %>
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-24232514-1']);
      <% if content_for?(:tracking) %>
      _gaq.push(['_trackPageview', <%= yield(:tracking) %>]);
      <%- else %>
      _gaq.push(['_trackPageview']);
      <%- end %>
      (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>
<%- else %>
<script type="text/javascript">
  var _gaq = _gaq || [];
</script>

<%- end %>

Add _gaq var in non-prod sites.
Add _gaq var in non-prod sites.
