diff options
author | Dave Arter <davea@mysociety.org> | 2016-06-24 16:24:34 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-06-24 16:37:39 +0100 |
commit | ce789a66f0ec4b4a30e1f2921ae31f2ea5bd3a98 (patch) | |
tree | 07d75d12e3233fbee4d6809d5785ac72c2c2fbbc | |
parent | 3f4948ceab38c184fbcf4521f3ec3351fccacce6 (diff) |
[Bristol] Add Google Analytics code
-rw-r--r-- | templates/web/bristol/header_extra.html | 2 | ||||
-rw-r--r-- | templates/web/bristol/tracking_code.html | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/templates/web/bristol/header_extra.html b/templates/web/bristol/header_extra.html new file mode 100644 index 000000000..d03e34e1f --- /dev/null +++ b/templates/web/bristol/header_extra.html @@ -0,0 +1,2 @@ +<script src="[% start %][% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> +[% INCLUDE 'tracking_code.html' %] diff --git a/templates/web/bristol/tracking_code.html b/templates/web/bristol/tracking_code.html new file mode 100644 index 000000000..a8fefe229 --- /dev/null +++ b/templates/web/bristol/tracking_code.html @@ -0,0 +1,15 @@ +[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %] + +<script> + !function(b,r,i,s,t,o,l){b.GoogleAnalyticsObject=i;b[i]||(b[i]=function(){ + (b[i].q=b[i].q||[]).push(arguments)});b[i].l=+new Date;o=r.createElement(s); + l=r.getElementsByTagName(s)[0];o.src=t;l.parentNode.insertBefore(o,l)} + (window,document,'ga','script','https://www.google-analytics.com/analytics.js'); + + ga('create', 'UA-79501135-1', 'auto'); + ga('send', 'pageview'); +</script> + +[% ELSE %] +<!-- Tracking code not inserted as "[% c.config.BASE_URL %]" not "https://www.fixmystreet.com" --> +[% END %] |