diff --git a/assets/js/hugo_cookie_consent/tracker_code.js b/assets/js/hugo_cookie_consent/tracker_code.js index d6c5158..e9cb158 100644 --- a/assets/js/hugo_cookie_consent/tracker_code.js +++ b/assets/js/hugo_cookie_consent/tracker_code.js @@ -1,6 +1,6 @@ (function () { function trackVisit() { - var banner = document.getElementById('cookie_banner'); + var banner = document.getElementById('cookie-banner'); if (!banner) return; var matomoUrl = banner.dataset.matomoUrl; var siteId = banner.dataset.matomoSiteId; @@ -23,4 +23,4 @@ if (localStorage.getItem('cookie_consent') === 'accepted') { trackVisit(); } -})(); \ No newline at end of file +})(); diff --git a/layouts/_partials/hugo_cookie_consent/scripts.html b/layouts/_partials/hugo_cookie_consent/scripts.html index de0162b..f4981bf 100644 --- a/layouts/_partials/hugo_cookie_consent/scripts.html +++ b/layouts/_partials/hugo_cookie_consent/scripts.html @@ -3,4 +3,5 @@ {{- if eq .Site.Params.hugo_cookie_consent.enable_tracking true -}} {{- $js := resources.Get "js/hugo_cookie_consent/tracker_code.js" | minify -}} -{{- end -}} \ No newline at end of file +{{- end -}} +