Yes, you need a cookie banner for visitors in the EU and the UK, even when Google Analytics is the only tracker on your website. Google Analytics 4 (GA4) stores cookies on each device and sends every page view to Google. The ePrivacy Directive and the UK Privacy and Electronic Communications Regulations (PECR) require consent before a site stores or reads anything on a device that it does not strictly need. Measuring visits is not strictly necessary.

First-party cookies fall under the same rule. GA4 sets _ga and _ga_<container-id> on your own domain, and the rule looks at what happens on the device, not at which domain sets the cookie. Small websites have no exemption either, so a blog with 100 EU visitors a month and a large store answer to the same rule. Compare how analytics tools fit the rule in the post on analytics tools and GDPR consent.

Where your visitors are decides the answer

The location of your visitors decides whether this consent rule reaches your website. A website with no visitors from the EU or the UK falls under other rules, which you check in US-Only Consent Banner.

The UK adds a narrow exception. Schedule 12 of the Data (Use and Access) Act 2025, in force since 5 February 2026, added an exception to PECR for statistics that improve a service. The ICO, the UK data protection regulator, lists its conditions: clear information, a simple and free way to object, aggregate figures only, and no advertising use. Most third-party analytics setups do not meet those conditions, so have a lawyer review yours before you stop asking UK visitors.

Without a consent banner, GA4 sets its cookies on the first page view of every visitor, before anyone answers. Your website then runs analytics on EU and UK visitors without their consent, and it does not keep a record of who agreed to what.

TermsFeed Privacy Consent (CMP) changes this through its GA4 template. The Google tag still loads on every page view and sends pings without cookies, and GA4 sets its cookies only after the visitor clicks I Agree. The consent log records each answer. GA4 does not set a cookie for a visitor who clicks I Decline or leaves the consent banner unanswered, so your reports show fewer visits than before.

The template form tells you to check with your legal adviser that this Google setup suits your regions, because some regulators expect no request to Google before consent. A custom vendor holds the Google tag back until the visitor accepts, and you weigh the 2 setups in Set Up Google Consent Mode v2.

A new consent banner starts on the "Strict" consent logic, so it asks every visitor first. On "Standard", a visit follows the opt-out model when the visitor and your company are both outside the EU, the European Economic Area, the UK, and Switzerland. That visitor does not see a consent banner, and GA4 sets its cookies at once. A visitor in Quebec sees the consent banner. A company in Quebec asks visitors in Canada, and visitors in other countries follow their own location. Check each location in Cookie Banner by Visitor Location.

Analytics tools that do not set cookies

Cookieless analytics tools (Plausible, Fathom, Cloudflare Web Analytics) do not set cookies on the device, which removes the cookie question for many websites. Each tool still receives the IP address of every visit, so some legal advisers treat these tools as exempt and others ask for consent anyway. Decide with Add Cookieless Analytics.

Matomo runs in both modes, and the mode decides whether it needs a vendor. GA4 has no mode that replaces consent, because Google Consent Mode v2 changes only what Google tags send before an answer. Pick the Matomo mode with Add Matomo.

How to keep Google Analytics cookies off the device until visitors agree

Setup takes 4 steps and about 5 minutes, with the Privacy Consent script already on your website. Follow the full recipe, with the cookie list and the Privacy Policy text, in Add Google Analytics 4.

  1. Open your consent banner in the TermsFeed app, select "Vendors", click "Add a vendor", and click the "Google Analytics 4" card.
  2. Enter your "Measurement ID", which starts with G-, and click "Add Google Analytics 4".
  3. Delete every other copy of the Google tag with that ID from your theme, your plugins, and Google Tag Manager.
  4. Open a new private window, open DevTools on the Network tab, filter for google-analytics.com, and load your website. A collect request carries gcs=G100 while the consent banner waits, and the Application tab lists a _ga cookie only after you click I Agree.

A _ga cookie that appears before you click I Agree means a copy of the Google tag still runs outside Privacy Consent.