Skip to content

Unconditional preconnect to google-analytics.com connects to tracking infrastructure before user consent #230

Description

@ooloth

Current state

src/components/Metadata.tsx renders <link rel="preconnect" href="https://www.google-analytics.com" /> unconditionally on every page load. This initiates a DNS lookup and TCP/TLS handshake with Google's analytics infrastructure before any user interaction — leaking the visitor's IP address and browser fingerprint to Google regardless of whether the visitor consents to tracking. This bypasses any consent gate that would be added to defer the GA script itself.

Ideal state

  • The preconnect tag is absent from the default render, or is injected only by the same consent gate that controls the GA script load.
  • No connection to google-analytics.com is initiated on a page load before the user has had the opportunity to consent.

Out of scope

Starting points

QA plan

  1. Open the site in a browser with the Network tab open — confirm no DNS request or TCP connection to google-analytics.com fires on initial page load before any interaction.
  2. After the consent mechanism from GA script loaded in <head> with no consent gate — respectDNT is no longer effective in most browsers #226 is in place, confirm the preconnect fires only after the consent event.
  3. Inspect the rendered HTML <head> — expect no preconnect tag targeting google-analytics.com in the initial HTML.

Done when

No connection to google-analytics.com is initiated on page load before the user has had the opportunity to consent to analytics.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions