[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-660910-4', {'cookieDomain': '.fixmystreet.com'});
ga('set', 'anonymizeIp', true);
[% IF created_report %]
ga('require', 'ecommerce');
ga('ecommerce:addItem', {
    'id': 'report/[% problem.id %]',
    'name': 'Report'
});
ga('ecommerce:send');
[% END %]
ga('send', 'pageview');

</script>
[% ELSE %]
<!-- Tracking code not inserted as "[% c.config.BASE_URL %]" not "https://www.fixmystreet.com" -->
[% END %]

[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-660910-4', {'cookieDomain': '.fixmystreet.com'});
ga('set', 'anonymizeIp', true);
[% IF created_report %]
ga('require', 'ecommerce');
ga(function(tracker) {
    var page = tracker.get('location');
    var extra = '';
    if ( page.indexOf('?') != -1 ) {
        extra = '&created_report=1';
    } else {
        extra = '?created_report=1';
    }
    tracker.set('location', page + extra);
});
ga('ecommerce:addItem', {
    'id': 'report/[% problem.id %]',
    'name': 'Report'
});
ga('ecommerce:send');
[% END %]
ga('send', 'pageview');

</script>
[% ELSE %]
<!-- Tracking code not inserted as "[% c.config.BASE_URL %]" not "https://www.fixmystreet.com" -->
[% END %]

Put back GA special created report URI.
Put back GA special created report URI.

Think it's needed for it to hang together.
