diff --git a/_includes/cookie_notice.html b/_includes/cookie_notice.html new file mode 100644 index 0000000..e952441 --- /dev/null +++ b/_includes/cookie_notice.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index f348e31..84f2d94 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -6,6 +6,8 @@ {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} + + @@ -14,5 +16,4 @@ - diff --git a/_includes/js_files.html b/_includes/js_files.html index 732be30..3134ed6 100644 --- a/_includes/js_files.html +++ b/_includes/js_files.html @@ -1,7 +1,14 @@ + + + + + + + diff --git a/_layouts/default.html b/_layouts/default.html index f2f4e18..130ffea 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -4,7 +4,7 @@ {% include head.html %} - + {% include cookie_notice.html %} {% include topnav.html %}
diff --git a/js/page.js b/js/page.js index 63d3dbe..4d56fa2 100644 --- a/js/page.js +++ b/js/page.js @@ -1,3 +1,29 @@ - $("#small-nav-dropdown").change(function() { - window.location = $(this).find("option:selected").val(); - }); \ No newline at end of file +$('#small-nav-dropdown').change(function() { + window.location = $(this) + .find('option:selected') + .val() +}) + +$(function() { + // Load GA upfront because we classify it as essential cookie + window.dataLayer = window.dataLayer || [] + function gtag() { + dataLayer.push(arguments) + } + gtag('js', new Date()) + gtag('config', 'UA-62780441-30', { anonymize_ip: true }) + + if (mscc) { + if (!mscc.hasConsent()) { + window.addEventListener('click', function() { + if (!mscc.hasConsent()) { + mscc.setConsent() + } + }) + + // Where future non-essential tracking cookie need to go + mscc.on('consent', function() { + }) + } + } +}) \ No newline at end of file