diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 17:47:01 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 18:02:34 +0300 |
| commit | 82c53b5444c75f7e2d0cc1e462616ff8d5fc3c10 (patch) | |
| tree | a11b754f55f967904b93729a9b7c44b860664351 /docs | |
| parent | f3f8b5c0744fad94808306a019739cad3113e6e2 (diff) | |
| download | vyos-documentation-82c53b5444c75f7e2d0cc1e462616ff8d5fc3c10.tar.gz vyos-documentation-82c53b5444c75f7e2d0cc1e462616ff8d5fc3c10.zip | |
fix(docs): guard GTM/Cookiebot blocks with {% if gtm_id %}
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)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/_templates/layout.html | 5 |
1 files changed, 4 insertions, 1 deletions
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 #} <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" @@ -31,6 +32,7 @@ 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> @@ -62,9 +64,10 @@ {% endblock %} {% block body %} - {# GTM noscript fallback #} + {% if gtm_id %} <noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ gtm_id }}" height="0" width="0" style="display:none;visibility:hidden" title="Google Tag Manager"></iframe></noscript> + {% endif %} {{ super() }} {% endblock %} |
