Skip to content

Commit

Permalink
Consen mode banner added
Browse files Browse the repository at this point in the history
  • Loading branch information
yevgen-nykytenko committed Oct 17, 2024
1 parent e1221d8 commit 00337c0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions themes/hugo-geekdoc/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
{{ partial "head/microformats" . }}
{{ partial "head/others" . }}
{{ partial "head/custom" . }}
{{ partial "head/consent-banner" . }}
{{ partial "head/google-tag-manager" . }}
</head>

{{ $navEnabled := default true .Page.Params.GeekdocNav }}
<body itemscope itemtype="https://schema.org/WebPage">
{{ partial "consentise-script" . }}
{{ partial "no-script" . }}
{{ partial "google-tag-manager-noscript" . }}
{{ partial "svg-icon-symbols" . }}
Expand Down
7 changes: 7 additions & 0 deletions themes/hugo-geekdoc/layouts/partials/consentise-script.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script src="https://www.consentise.com/v1.2/consent-min.js"
data-cookiedomain=".groupdocs.com"
data-privacy-policy-url="https://about.groupdocs.com/legal/privacy-policy"
data-preferred-color="#4FA5D3"
data-default-language="en"
defer>
</script>
16 changes: 16 additions & 0 deletions themes/hugo-geekdoc/layouts/partials/head/consent-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('set', 'url_passthrough', true);

// Set default consent to 'denied' as a placeholder
// Update values based on your requirements
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
//'analytics_storage': 'denied'
'analytics_storage': 'granted'
});
</script>

0 comments on commit 00337c0

Please sign in to comment.