Skip to content

New analytics#27

Merged
Xykon merged 3 commits into
mainfrom
new-analytics
Jul 7, 2026
Merged

New analytics#27
Xykon merged 3 commits into
mainfrom
new-analytics

Conversation

@Xykon

@Xykon Xykon commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This pull request simplifies analytics integration in the custom Sphinx HTML layout by removing environment-based configuration and hardcoded analytics IDs directly into the template. It also streamlines the logic for loading Google Tag Manager (GTM) and displaying the cookie consent banner.

Analytics integration and configuration:

  • Removed the _env_id function and all related logic from conf.py, eliminating the use of environment variables for analytics configuration. (conf.py [1] [2]
  • Hardcoded the Google Tag Manager container ID (GTM-PWRR783T) directly into the _templates/layout.html template, removing conditional logic for loading analytics scripts. (_templates/layout.html _templates/layout.htmlL4-R30)

Template and cookie consent logic:

  • Simplified and consolidated the analytics script loading in the extrahead block of _templates/layout.html, always loading GTM and removing support for GA4/gtag and conditional script inclusion. (_templates/layout.html _templates/layout.htmlL4-R30)
  • Updated the template to always render the cookie consent banner and backdrop, regardless of analytics configuration, by removing conditional checks. (_templates/layout.html [1] [2]
  • Added the GTM noscript fallback iframe to the extrabody block for improved tag coverage. (_templates/layout.html _templates/layout.htmlL4-R30)

Copilot AI review requested due to automatic review settings July 7, 2026 11:35
@Xykon
Xykon merged commit 8fa400d into main Jul 7, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Sphinx docs site’s custom HTML layout to simplify analytics by removing environment-based analytics configuration from conf.py and hardcoding a single Google Tag Manager (GTM) container ID directly in the template.

Changes:

  • Removed _env_id() and all analytics-related html_context variables from conf.py (no more env-var-driven analytics IDs).
  • Simplified _templates/layout.html to always load GTM using a hardcoded container ID and added the GTM <noscript> fallback.
  • Made the cookie consent banner/backdrop always render by removing conditional checks around analytics configuration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
conf.py Removes environment-based analytics context/config helpers.
_templates/layout.html Hardcodes GTM loading and simplifies consent/banner rendering logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread _templates/layout.html
Comment on lines 6 to 10
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
window.dataLayer.push({
'event': 'default_consent',
'analytics_storage': 'denied',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants