Should I still use analytics?

2 ingve 1 6/3/2025, 1:25:30 PM martinfowler.com ↗

Comments (1)

Festro · 21h ago
I think the AnalyticsStorage:Denied is preventing pageviews from being tracked. They still fire, but only so that they can be tracked should consent be given retroactively for that pageview. This prevents the snippet from having to be re-fired once the user consents.

This is just a necessary quirk, since you want the pageview to be triggered on page load, but the user can't consent until the consent banner has loaded.

Since you're not loading a consent banner at all the pageview event triggers and is held in the data layer waiting for consent status to change. If the user exits or clicks to a different page that data is lost (because no cookie allowed). If they allow cookies later (somehow) then only the current pageview will be recorded (and as a landing page, even if it's not their actual, original, landing page).