Skip to content

Commit

Permalink
cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin committed Dec 10, 2024
1 parent 6d1a7ad commit aca65c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions _includes/cookie-consent.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
}

if(readCookie('cookie-notice-dismissed')=='true') {
{% include ga.js %}
{% include chatbutton.js %}
{% include ga.html %}
} else {
document.getElementById('cookie-notice').style.display = 'block';
}
Expand Down
8 changes: 8 additions & 0 deletions _includes/ga.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q12CPTSQDT"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-Q12CPTSQDT');
</script>
11 changes: 0 additions & 11 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@

</head>

{% if jekyll.environment == 'production' %}
<!-- change your GA id in _config.yml -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{site.google_analytics}}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}

{% capture layout %}{% if page.layout %}layout-{{ page.layout }}{% endif %}{% endcapture %}
<body class="{{layout}}">
Expand Down

0 comments on commit aca65c8

Please sign in to comment.