aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-04-11 15:30:29 +0100
committerDave Arter <davea@mysociety.org>2018-04-11 16:06:55 +0100
commit5134dfd97c0190c5cecb6438baf80c9b72388527 (patch)
tree8ecdcb101ac714368d007a88c23ee9067901314d
parentdfc361813c6a7412d70b8782e29e712b4f06bba2 (diff)
[BANES] Add Google Analytics script
-rw-r--r--templates/web/bathnes/header_extra.html1
-rw-r--r--templates/web/bathnes/tracking_code.html12
2 files changed, 13 insertions, 0 deletions
diff --git a/templates/web/bathnes/header_extra.html b/templates/web/bathnes/header_extra.html
new file mode 100644
index 000000000..8a977495f
--- /dev/null
+++ b/templates/web/bathnes/header_extra.html
@@ -0,0 +1 @@
+[% INCLUDE 'tracking_code.html' %]
diff --git a/templates/web/bathnes/tracking_code.html b/templates/web/bathnes/tracking_code.html
new file mode 100644
index 000000000..e6f20b90f
--- /dev/null
+++ b/templates/web/bathnes/tracking_code.html
@@ -0,0 +1,12 @@
+[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
+<script async src="https://www.googletagmanager.com/gtag/js?id=UA-418184-9"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', 'UA-418184-9');
+</script>
+[% ELSE %]
+<!-- Tracking code not inserted as "[% c.config.BASE_URL %]" not "https://www.fixmystreet.com" -->
+[% END %]