Skip to content

Commit 7943b4c

Browse files
committedMay 23, 2018
replace Google analytics code with consent code
1 parent 51e792b commit 7943b4c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed
 

‎_includes/head.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<link rel="apple-touch-icon" href="apple-touch-icon.png">
9-
<link href="//fonts.googleapis.com/css?family=Cabin:400,400i,600,700" rel="stylesheet">
9+
<link href="//fonts.googleapis.com/css?family=Cabin:400,400i,600,700" rel="stylesheet">
1010
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
1111
<script src="{{ "/js/vendor/modernizr-2.8.3.min.js" | prepend: site.baseurl }}"></script>
12+
{% if site.googleanalytics %}
13+
<script>
14+
var okiConsent = {
15+
analyticsTrackingID: '{{ site.googleanalytics }}',
16+
}
17+
</script>
18+
<script src="https://a.okfn.org/html/oki/consent/assets/js/consent.js"></script>
19+
{% endif %}
1220
</head>

‎_layouts/default.html

-11
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,5 @@
5656
});
5757
</script>
5858
{% endif %}
59-
60-
{% if site.googleanalytics %}
61-
<script>
62-
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
63-
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
64-
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
65-
e.src='https://www.google-analytics.com/analytics.js';
66-
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
67-
ga('create','{{ site.googleanalytics }}','auto');ga('send','pageview');
68-
</script>
69-
{% endif %}
7059
</body>
7160
</html>

0 commit comments

Comments
 (0)