From 0b4b22e9ae88e73a3f3b8407a1bdbf0ed4c3a735 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Sun, 3 May 2026 01:18:23 +0300 Subject: feat(docs): add Cookiebot CMP and GTM with Consent Mode v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inject Cookiebot CMP, Google Consent Mode v2 defaults, and Google Tag Manager into the Sphinx layout. Cookiebot loads first so its auto-blocker can scan and block other tags before they execute; Consent Mode v2 starts denied for all categories except security_storage and updates only after Cookiebot fires the consent update. 🤖 Generated by [robots](https://vyos.io) --- docs/_templates/layout.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 30a53d56..ca72005d 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -1,6 +1,37 @@ {% extends "!layout.html" %} {%- set current_version = "1.4.x sagitta" %} {% block extrahead %} + {# Cookiebot CMP — must load first so its auto-blocker can scan/block other tags #} + + + {# Google Consent Mode v2 defaults — deny everything until Cookiebot fires the update #} + + + {# Google Tag Manager #} + + @@ -30,3 +61,10 @@ {% endblock %} + +{% block body %} + {# GTM noscript fallback #} + + {{ super() }} +{% endblock %} -- cgit v1.2.3 From d7ef8b28838a8fedbe25ad2f7631a2f72f47c889 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 May 2026 13:41:09 +0000 Subject: fix(docs): use window.dataLayer in gtag() and remove stray closing script tag Agent-Logs-Url: https://github.com/vyos/vyos-documentation/sessions/498fb4de-0a2a-43b8-b567-eb8d8883111b Co-authored-by: andamasov <12631358+andamasov@users.noreply.github.com> --- docs/_templates/layout.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index ca72005d..91880816 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -11,7 +11,7 @@ {# Google Consent Mode v2 defaults — deny everything until Cookiebot fires the update #} - {% endblock %} {% block body %} -- cgit v1.2.3 From f8a2fe705ce759b513db84422475a929d9d5568e Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Thu, 7 May 2026 17:17:11 +0300 Subject: fix(docs): add title attribute to GTM noscript iframe for a11y MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated by [robots](https://vyos.io) --- docs/_templates/layout.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 91880816..d22402ba 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -64,6 +64,7 @@ {% block body %} {# GTM noscript fallback #} + height="0" width="0" style="display:none;visibility:hidden" + title="Google Tag Manager"> {{ super() }} {% endblock %} -- cgit v1.2.3 From f3f8b5c0744fad94808306a019739cad3113e6e2 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Thu, 7 May 2026 17:19:45 +0300 Subject: feat(docs): read GTM_ID from environment instead of hardcoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the Google Tag Manager container ID out of the template and into conf.py via os.environ.get('GTM_ID', ''), exposed to Jinja via html_context. Set GTM_ID in the RTD project environment variables. 🤖 Generated by [robots](https://vyos.io) --- docs/_templates/layout.html | 4 ++-- docs/conf.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index d22402ba..a2b50be3 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -30,7 +30,7 @@ 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-T5VQHRT'); + })(window,document,'script','dataLayer','{{ gtm_id }}'); @@ -63,7 +63,7 @@ {% block body %} {# GTM noscript fallback #} - {{ super() }} diff --git a/docs/conf.py b/docs/conf.py index 8efd0d42..cbee4a36 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -147,6 +147,7 @@ html_context = { 'github_repo': 'vyos-documentation', 'github_version': _github_version, 'conf_py_path': '/docs/', + 'gtm_id': os.environ.get('GTM_ID', ''), } # Custom sidebar templates, must be a dictionary that maps document names -- cgit v1.2.3 From 82c53b5444c75f7e2d0cc1e462616ff8d5fc3c10 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Thu, 7 May 2026 17:47:01 +0300 Subject: fix(docs): guard GTM/Cookiebot blocks with {% if gtm_id %} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents broken googletagmanager.com requests with empty container IDs when GTM_ID is not set (local builds, preview environments). 🤖 Generated by [robots](https://vyos.io) --- docs/_templates/layout.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index a2b50be3..e4781d89 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -1,6 +1,7 @@ {% extends "!layout.html" %} {%- set current_version = "1.4.x sagitta" %} {% block extrahead %} + {% if gtm_id %} {# Cookiebot CMP — must load first so its auto-blocker can scan/block other tags #} @@ -64,7 +64,7 @@ {% endblock %} {% block body %} - {% if gtm_id %} + {% if gtm_id and cookiebot_id %} diff --git a/docs/conf.py b/docs/conf.py index cbee4a36..7f4bf4eb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -148,6 +148,7 @@ html_context = { 'github_version': _github_version, 'conf_py_path': '/docs/', 'gtm_id': os.environ.get('GTM_ID', ''), + 'cookiebot_id': os.environ.get('COOKIEBOT_ID', ''), } # Custom sidebar templates, must be a dictionary that maps document names -- cgit v1.2.3 From 85fa1d4467f3790f53d37d4b48fb53f59d290cc4 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Thu, 7 May 2026 18:19:48 +0300 Subject: fix(docs): add missing space after colon in personalization_storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated by [robots](https://vyos.io) --- docs/_templates/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 6c100ca9..adc6278d 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -19,7 +19,7 @@ 'ad_personalization': 'denied', 'analytics_storage': 'denied', 'functionality_storage': 'denied', - 'personalization_storage':'denied', + 'personalization_storage': 'denied', 'security_storage': 'granted', 'wait_for_update': 500 }); -- cgit v1.2.3