Analytics

First-Party Data and A/B Testing in a Post-Cookie World

First-party data A/B testing: what browser storage limits and consent really cost you, how identity loss inflates sample size, and what to fix first.

Flat illustration of a shield holding neat stacked rows of data blocks, with dotted lines stopping at its edge and one solid line entering from a trusted source below

A/B testing never depended on third-party cookies, so the privacy shift did not break the method; it broke the bookkeeping around it. The split happens on your own domain, with your own visitors, measured against your own conversions, which is first-party by construction. What degraded is the durability of the identity that carries the assignment from one visit to the next, and the completeness of the analytics that describe the visitors who were assigned. This article is a child of the complete guide to GA4 and A/B testing and answers one practical question: what a testing program has to change when a meaningful share of its visitors cannot be measured, or cannot be recognised on their second visit.

The short version: your required sample size does not move, your weekly denominator does, and almost every practical problem downstream comes from teams not redoing that second piece of arithmetic.

What changed, precisely

Three different things are usually bundled together under “the cookie apocalypse”, and they have very different consequences for an experiment.

Change What it affects Effect on an A/B test
Third-party cookies blocked by default in Safari and Firefox Cross-site tracking and ad measurement Almost none: the split and the conversion are same site
Client-side first-party storage capped in lifetime How long an assignment survives Real: returning visitors get reassigned, diluting the measured effect
Consent required before measurement tags fire Who appears in analytics at all Real: the measured population becomes a self-selected subset

The first row is the one that gets the headlines and the one that matters least here. Google announced in April 2025 that Chrome would not ship a standalone prompt for third-party cookies and would keep the user’s existing choice in place, while Safari and Firefox have blocked them by default for years. Either way, none of that touches a same-site experiment.

The second row is where the damage lives. Apple’s Intelligent Tracking Prevention caps the lifetime of cookies written by JavaScript on the client, documented by the WebKit team since ITP 2.1 in 2019, with a further cap on script-writable storage after cross-site navigations with link decoration. A test whose assignment is stored that way loses returning visitors on a schedule set by the browser, not by you.

The third row is a design decision you control, and the one most often applied inconsistently.

Identity loss dilutes the effect, it does not bias it

This distinction is worth being precise about, because the two failure modes call for different responses.

When a returning visitor is re-randomized, roughly half the time they land back on the same side and nothing happens, and roughly half the time they cross over. Crossovers do not systematically favour either variation, so they do not create a fake winner; they mix the two populations and pull the observed difference toward zero. A real 10% improvement measures as something smaller, and a test sized for 10% is now underpowered for what it can actually detect.

Bias, by contrast, comes from anything that treats the two branches differently: a consent flow that gates one side and not the other, a tag that fires before the render on one branch, a script blocker that hits the variation’s extra request and not the control’s. Those produce wrong answers rather than weak ones.

Dilution from re-randomized returning visitors compared with asymmetric biasOn the left, identity loss sends returning visitors back through randomization, so about half cross to the other variation. The two populations mix and the measured difference shrinks toward zero without favouring either side. On the right, an asymmetric problem such as consent gating only one branch removes visitors from one side only, which moves the measured difference in a specific direction and produces a wrong answer rather than a weak one.Identity loss: dilutionvariation Avariation Breturning visitors cross both waysthe two populations mix, the measuredgap shrinks toward zeroweaker answer, not a wrong oneAsymmetric loss: biasvariation Avariation Bvisitors removed from one side onlythe gap moves in a specific directionwrong answer, at any sample size
Dilution costs you time and statistical power. Asymmetry costs you the conclusion. Only one of the two is fixed by running longer.

The arithmetic: same sample, longer calendar

Here is the part teams get wrong. The required sample per variation is a property of the statistics, not of your tracking, so it does not move when visibility drops. What moves is how fast you accumulate it.

Take a 4% baseline and a target of detecting a 10% relative improvement (4.0% to 4.4%), at 95% confidence and 80% power. The math returns 39,475 visitors per variation. Now vary only the measurable weekly traffic:

Measurable visitors per week What that represents Days to fill both variations
25,000 Everyone measurable about 23 days
17,500 30% of visitors not measurable about 32 days
12,500 Half not measurable about 45 days

Run your own baseline and traffic through the calculator before committing to a date:

Sample size calculator
-Visitors per variation
-Total (2 variations)
-Estimated duration

Two-proportion normal approximation, 2 variations (50/50). Tweak the inputs and watch it update live.

The dangerous version of this mistake is not the longer calendar, it is keeping the original one. A team that planned 23 days, lost 30% of measurable traffic and stopped on day 23 anyway ends up with roughly 28,750 per variation instead of 39,475. At that sample, the power to detect the same 10% relative effect falls to about 67%, meaning that if the improvement is real, the test misses it one time in three. The result is not a negative finding, it is no finding at all, reported as if it were one.

Days needed to fill the same sample as measurable traffic fallsThe required sample stays fixed at 39,475 visitors per variation. At 25,000 measurable visitors per week the test needs about 23 days. At 17,500 per week, which is a 30 percent loss of visibility, it needs about 32 days. At 12,500 per week, half the traffic, it needs about 45 days. Stopping on the original 23 day date at reduced traffic leaves about 28,750 per variation, where the power to detect the target effect is only about 67 percent.Days to reach 39,475 per variation (2 variations)25,000/weekabout 23 days17,500/weekabout 32 days, 30% less visibility12,500/weekabout 45 days, half the trafficStopping on day 23 with reduced traffic leaves about 28,750 per variation: power near 67%, not 80%.
The sample requirement is fixed by the statistics. Only the calendar absorbs the loss of visibility, and only if you let it.

Where the assignment should live

Four places, in increasing order of durability and cost.

A caution about the second option, because it is often oversold: an HttpOnly first-party cookie makes the assignment durable, it does not make it consented. Whether you may set it before consent depends on how your jurisdiction and your own policy classify a cookie that exists to run an experiment rather than to deliver the service. Decide that with your legal owner, document the decision, and apply it identically to both branches.

The one rule that keeps a consented experiment honest is symmetry. Whatever the banner does, it must do to both branches at exactly the same point in the flow. If control renders immediately while the variation waits for a consent callback, you are no longer comparing two page designs, you are comparing a page against a page plus a delay, and the delay is usually worth more conversion points than the design change you were testing.

Two consequences follow that are worth writing into the test plan rather than discovering afterwards:

  1. State the population. If measurement starts after acceptance, the finding applies to consenting visitors. That is a legitimate population and an honest sentence in the report. Presenting it as “our visitors” is where it becomes misleading.
  2. Do not compare across a consent change. A test that ran before a banner redesign and one that ran after are measuring different populations. Treat the banner change as the boundary of a measurement era, the same way you would treat a tracking migration.

What first-party data actually buys you

The framing so far has been defensive, which undersells the opportunity. A first-party identity you control, especially a logged-in one, enables readings that third-party tracking never supported well.

A worked example, reading a test with reduced visibility

A pricing page converts at 4.00% among measurable visitors. The team runs the test to 20,000 visitors per variation and closes with 800 conversions in control and 880 in the variation (4.40%). Running those four numbers through the same two-proportion math used everywhere on this blog: z = 1.99, p-value about 0.046, an observed relative lift of +10.0%, and a 95% confidence interval on the difference from +0.007 to +0.793 percentage points.

Significant, and barely. The interval’s lower bound is seven thousandths of a percentage point above zero, which is another way of saying that a small amount of extra noise would have flipped the verdict. That is exactly the position a program with degraded identity keeps finding itself in: dilution shrinks the observed gap, the gap lands near the threshold, and the decision rests on the last few hundred visitors. Paste your own numbers below to see where your test sits:

Statistical significance calculator
Control (A)
Variation (B)
Control (A) · Rate-
Variation (B) · Rate-
Relative lift-
p-value-
95% CI of the difference-

Two-sided two-proportion z-test. "Not significant" almost always means not enough sample, not that the versions are equal.

The right response is not to declare the win louder. It is to note that the estimate is compatible with anything from a negligible gain to a solid one, and to decide whether the change is cheap enough to ship on a weak positive or important enough to deserve a confirmation run with better identity persistence.

What not to do

Make this automatic with Donnu

The failure mode described in this article is rarely a missing feature; it is an arithmetic step nobody redid. Traffic visibility dropped, the sample requirement stayed the same, the stop date did not move, and a test that never had the power to answer the question was reported as an answer.

Donnu handles the web and client-side half of this: a first-party snippet served from your own domain, sample sizing computed from your real baseline rather than a default, and honest statistics that show the confidence interval next to the verdict instead of a single green number. It does not build you a cross-device identity graph and does not pretend to; what it does is refuse to call a diluted, underpowered result a winner. Start a free trial and see the interval, not just the arrow.


Read also: GA4 and A/B Testing: The Complete Integration Guide · Client-Side vs Server-Side A/B Testing · CRO for Low-Traffic Sites · Common A/B Testing Mistakes

References

Frequently asked questions

Did the end of third-party cookies break A/B testing?
No, and the confusion is worth clearing up. A/B testing has always been a first-party activity: you split your own visitors on your own domain and measure your own conversions, so no third-party cookie was ever required for the split itself. What the privacy shift changed is the reliability of the identity that carries the assignment, and the completeness of the analytics that report on it. The experiment still works; the bookkeeping around it gets noisier.
What actually breaks when browser storage is restricted?
The persistence of the assignment, not the randomization. When a browser expires or clears the storage key that holds "this visitor is in variation B", the returning visitor is treated as new and gets randomized again, which can put the same person on both sides of the test across visits. That dilutes the measured difference toward zero and, in the worst case, breaks the split ratio. The statistics remain valid; what degrades is the assumption that one visitor equals one consistent exposure.
Does a consent banner make my A/B test invalid?
It makes it partial, which is different from invalid. If measurement only starts after consent, you are running the experiment on the subset of visitors who accept, and that subset is not a random sample of your traffic. The result is still valid for that population, and you should say so when you report it. What is genuinely invalid is applying consent asymmetrically, for example letting the variation branch run before the banner while the control branch waits, because then the banner itself becomes part of what you are measuring.
Should I move my A/B tests server-side because of privacy changes?
Only if the constraint you are hitting is identity persistence, and only with clear eyes about the cost. A server-side assignment written to an HttpOnly first-party cookie survives client-side storage restrictions better than a key written by JavaScript, and it cannot be removed by a script blocker. In exchange, you give up the fast iteration of a snippet, you need engineering for every change, and you now own the caching problem, since a cached page cannot vary per visitor without extra work at the edge.
How much extra sample does identity loss cost me?
Not extra sample, extra time, which is the trap. The required sample per variation does not change: with a 4% baseline and a target of detecting a 10% relative improvement at 95% confidence and 80% power, it is 39,475 per variation whether or not you can measure everybody. What changes is the weekly denominator that fills it. At 25,000 measurable visitors a week the test takes about 23 days; if 30% of them stop being measurable, the same test takes about 32 days; at half, about 45 days. Teams that do not redo this arithmetic end up stopping on the original date with a fraction of the sample they planned: about three quarters of it if 30% of traffic became unmeasurable, and about half of it if half did.
Is fingerprinting a legitimate replacement for cookies in testing?
No, on two independent grounds. Legally, identifying a device without consent is treated as personal data processing under the GDPR and under Brazilian law, and doing it specifically to evade a storage restriction is hard to defend as legitimate interest. Technically, it is unstable in exactly the way that matters here, because a fingerprint drifts with browser updates, screen changes and network conditions, so the same person can drift across variations mid experiment. A fragile identity that is also a compliance risk is a bad trade for an experiment.