blob: 6162f5ac102c140d32406ecd50e46a4bd34f9393 [file] [log] [blame]
{{- with .Site.Params.google_tag_manager }}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');</script>
<!-- End Google Tag Manager -->
{{- end }}
{{ with .Site.GoogleAnalytics }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
function getEclipseCookieConsentStatus() {
var i,x,y,cookies_list=document.cookie.split(";");
for (i = 0; i < cookies_list.length; i++) {
x = cookies_list[i].substr(0,cookies_list[i].indexOf("="));
y = cookies_list[i].substr(cookies_list[i].indexOf("=")+1);
x = x.replace(/^\s+|\s+$/g,"");
if (x == 'eclipse_cookieconsent_status') {
return unescape(y);
}
}
}
var eclipse_cookieconsent_status = getEclipseCookieConsentStatus();
if (eclipse_cookieconsent_status === 'allow') {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ . }}');
}
</script>
{{- end -}}