summaryrefslogtreecommitdiff
path: root/docs/_templates/layout.html
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2026-05-06 13:42:08 +0000
committerYuriy Andamasov <yuriy@vyos.io>2026-05-07 18:22:52 +0300
commitf34f1d66b760d6616080ca07ad1b403cf75338bb (patch)
tree1a0f7062ba3d87453202e2681af06cc9010da4e0 /docs/_templates/layout.html
parent6179b066e69514f714c883df423a441621ee0013 (diff)
downloadvyos-documentation-f34f1d66b760d6616080ca07ad1b403cf75338bb.tar.gz
vyos-documentation-f34f1d66b760d6616080ca07ad1b403cf75338bb.zip
fix(docs): deduplicate GTM ID via Jinja var and use window.dataLayer in gtag()
Agent-Logs-Url: https://github.com/vyos/vyos-documentation/sessions/f6d95cc7-cdbe-4d76-8077-f7fae5e9ddf2 Co-authored-by: andamasov <12631358+andamasov@users.noreply.github.com>
Diffstat (limited to 'docs/_templates/layout.html')
-rw-r--r--docs/_templates/layout.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index cfc59dca..8c57a066 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -1,5 +1,6 @@
{% extends "!layout.html" %}
{%- set current_version = "1.5.x circinus" %}
+{%- set gtm_id = "GTM-T5VQHRT" %}
{% block extrahead %}
{# Cookiebot CMP — must load first so its auto-blocker can scan/block other tags #}
<script id="Cookiebot"
@@ -11,7 +12,7 @@
{# Google Consent Mode v2 defaults — deny everything until Cookiebot fires the update #}
<script>
window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
+ function gtag(){window.dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
@@ -30,7 +31,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');</script>
+ })(window,document,'script','dataLayer','{{ gtm_id }}');</script>
<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>
@@ -64,7 +65,7 @@
{% block body %}
{# GTM noscript fallback #}
- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T5VQHRT"
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ gtm_id }}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
{{ super() }}
{% endblock %}