Skip to content

docs: load analytics and marketing tags only after cookie consent - #16088

Merged
devGregA merged 1 commit into
DefectDojo:bugfixfrom
devGregA:devgrega/docs-consent-gated-tags
Sep 25, 2026
Merged

devGregA merged 1 commit into
DefectDojo:bugfixfrom
devGregA:devgrega/docs-consent-gated-tags

Conversation

@devGregA

Copy link
Copy Markdown
Contributor

Summary

docs.defectdojo.com loaded the Reo and Apollo trackers for every visitor without asking. This change puts every analytics and marketing tag on the docs behind cookie consent, the same way defectdojo.com already works.

  • Consent banner. The docs now load HubSpot's cookie banner. The HubSpot portal already has an opt-in policy for docs.defectdojo.com, but the docs never loaded the script, so the banner never appeared.
  • Nothing loads before consent. Until the visitor accepts, only the HubSpot script runs. Google Consent Mode v2 starts as denied.
  • What loads on accept. GA4 and the defectdojo.com tag container load, matching the main site. Apollo now comes from that container instead of a hard-coded snippet, and Reo loads alongside it.
  • Withdrawal. Withdrawing consent through "Cookie settings" clears the tags' first-party cookies and reloads the page, which then loads nothing. Reo cookies left by the old ungated tag are removed for visitors who have not consented.
  • Footer. Adds "Privacy policy" (defectdojo.com/privacy-policy) and "Cookie settings" links in all eight languages. "Cookie settings" reopens the banner.
  • Dev builds. hugo server builds load no tags at all, so local previews never send analytics.

Tested against a production build served locally. Before consent and after decline, no third-party requests or cookies. After accept, the expected tags load. After withdrawal, cookies are cleared and nothing loads after the reload.

🤖 Generated with Claude Code

The docs site loaded the Reo and Apollo trackers for every visitor with
no consent prompt. It now loads HubSpot's cookie banner (the portal
already has an opt-in policy for docs.defectdojo.com) and waits for the
visitor's choice before loading anything else:

- Google Consent Mode v2 defaults to denied.
- GA4 and the defectdojo.com tag container load on accept, matching
  defectdojo.com. Apollo now comes from that container, and Reo loads
  with it.
- Withdrawing consent clears the tags' first-party cookies and reloads
  the page. Reo cookies left by the old ungated tag are removed for
  visitors who have not consented.
- The footer gains "Privacy policy" and "Cookie settings" links in all
  eight languages. Cookie settings reopens the banner.
- Development builds (hugo server) load no tags at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devGregA
devGregA requested a review from Maffooch as a code owner September 25, 2026 04:16
@devGregA devGregA added this to the 3.3.300 milestone Sep 25, 2026
@github-actions github-actions Bot added the docs label Sep 25, 2026
@devGregA
devGregA enabled auto-merge September 25, 2026 04:17
@devGregA
devGregA disabled auto-merge September 25, 2026 04:39
@devGregA
devGregA merged commit ff8c496 into DefectDojo:bugfix Sep 25, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant