diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 19:18:08 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-07 19:18:08 +0300 |
| commit | 2e9cc677e63a89a14e1e61a3e6d7b33925ca5c44 (patch) | |
| tree | e0104cc1d4a2eb6088f7dbf0db8ff8b92e99bef1 /docs | |
| parent | b80bfcc09b225d31a90e0c5053467a79c5caf264 (diff) | |
| parent | ca6ffd09a1551d6047722c5e12738aad709239ae (diff) | |
| download | vyos-documentation-2e9cc677e63a89a14e1e61a3e6d7b33925ca5c44.tar.gz vyos-documentation-2e9cc677e63a89a14e1e61a3e6d7b33925ca5c44.zip | |
Merge pull request #1872 from vyos/feat/docs-cookiebot-gtm-consent-circinus
feat(docs): add Cookiebot CMP and GTM with Consent Mode v2 (circinus)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/_templates/layout.html | 43 | ||||
| -rw-r--r-- | docs/conf.py | 3 |
2 files changed, 44 insertions, 2 deletions
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 5736a26f..f74f77f7 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -1,6 +1,44 @@ {% extends "!layout.html" %} {%- set current_version = "1.5.x circinus" %} {% block extrahead %} + {% if gtm_id and cookiebot_id %} + {# Cookiebot CMP — must load first so its auto-blocker can scan/block other tags #} + <script id="Cookiebot" + src="https://consent.cookiebot.com/uc.js" + data-cbid="{{ cookiebot_id }}" + data-blockingmode="auto" + type="text/javascript"></script> + + {# Google Consent Mode v2 defaults — deny everything until Cookiebot + fires the consent update. Cookiebot's uc.js with data-blockingmode="auto" + automatically pushes gtag('consent','update', …) into dataLayer when + the visitor accepts/declines categories in the CMP banner; no in-repo + update logic is required. Categories are mapped via the Cookiebot + admin UI, not here. See https://www.cookiebot.com/en/google-consent-mode/ #} + <script> + window.dataLayer = window.dataLayer || []; + function gtag(){window.dataLayer.push(arguments);} + gtag('consent', 'default', { + 'ad_storage': 'denied', + 'ad_user_data': 'denied', + 'ad_personalization': 'denied', + 'analytics_storage': 'denied', + 'functionality_storage': 'denied', + 'personalization_storage': 'denied', + 'security_storage': 'granted', + 'wait_for_update': 500 + }); + gtag('set', 'ads_data_redaction', true); + </script> + + {# 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_id }}');</script> + {% endif %} + <style>#vyos-header-iframe{position:fixed;top:0;left:0;right:0;z-index:999999999;width:100%;border:none}</style> <style>#vyos-footer-iframe{width:100%;border:none}</style> <iframe src='https://vyos.io/iframes/header' id='vyos-header-iframe'></iframe> @@ -28,5 +66,8 @@ <script type="text/javascript" charset="utf8" src="{{ pathto("_static/js/codecopier.js", True) }}"></script> <script type="text/javascript" charset="utf8" src="{{ pathto("_static/js/sidebar.js", True) }}"></script> <script type="text/javascript" charset="utf8" src="{{ pathto("_static/js/footer.js", True) }}"></script> - </script> +{% endblock %} + +{% block body %} + {{ super() }} {% endblock %} diff --git a/docs/conf.py b/docs/conf.py index 1cfe669e..99f83984 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -142,6 +142,8 @@ html_context = { 'github_repo': 'vyos-documentation', 'github_version': _github_version, 'conf_py_path': '/docs/', + 'gtm_id': os.environ.get('GTM_ID', ''), + 'cookiebot_id': os.environ.get('COOKIEBOT_ID', ''), } # sphinx-sitemap: baseurl already includes /en/1.5/, so skip lang+version @@ -152,7 +154,6 @@ sitemap_url_scheme = '{link}' # _templates/llms.txt.j2 by the _write_llms_txt() build-finished hook # below; llms-full.txt is still auto-generated by sphinx-llms-txt. llms_txt_file = False - # Custom sidebar templates, must be a dictionary that maps document names # to template names. # |
