Skip to content

Google Analytics fires unconditionally with no consent mechanism — visitors cannot opt out before being tracked #223

Description

@ooloth

Why

The Google Analytics script fires on every page load for every visitor with no consent gate, meaning visitor behaviour data is sent to Google's servers before visitors have a chance to opt out — an issue separate from where the tracking ID is stored.

Current state

gatsby-config.js line 88–93:

{
  resolve: 'gatsby-plugin-google-analytics',
  options: {
    trackingId: 'UA-9710963-7',
    head: true,
    respectDNT: true,
  },
}

head: true loads the GA script in <head>, firing before the page is interactive. respectDNT: true only skips tracking if the browser sends DNT: 1, which most modern browsers no longer do by default. There is no cookie banner, consent modal, or opt-in mechanism anywhere in the codebase.

Ideal state

  • Visitor data is not sent to Google Analytics until the visitor has been informed and has had the opportunity to opt out (or, for stricter compliance, affirmatively opted in).
  • Alternatively, Google Analytics is replaced with a privacy-preserving analytics provider (e.g. Plausible, Fathom) that does not require consent under most privacy laws.
  • A privacy policy page explains what data is collected and sent to Google.

Out of scope

Starting points

  • gatsby-config.js — the gatsby-plugin-google-analytics configuration block.
  • Any existing privacy policy or terms page in the site content.

QA plan

  1. Open the deployed site in a browser — confirm no GA network request fires before any user interaction.
  2. If a consent banner is added, accept it — confirm GA fires after consent.
  3. If GA is replaced with a privacy-preserving alternative, confirm the replacement loads correctly and no request to google-analytics.com or googletagmanager.com fires.

Done when

No visitor data is sent to Google Analytics on page load without prior opportunity for the visitor to opt out.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions