Sub topic 12
How sure can you be? Limits of the estimate
This chapter assumes you have built exposed and comparison query cohorts, computed CTR before and after the change, and calculated a difference-in-differences (DiD) figure. It also assumes you can read basic pandas and know what a confidence interval is. Here you will put a range around that figure and state what the range does not cover.
Why a single number is not enough
The DiD calculation returns one number, such as "CTR fell 0.5 percentage points more for exposed queries." That number is an estimate. A stakeholder who reads it as a fact will make a decision that is too confident in one direction or the other.
Two kinds of doubt apply, and they need different handling:
- Sampling uncertainty comes from random variation. Some queries got lucky clicks and some did not. You can measure it with a confidence interval.
- Structural uncertainty comes from the design and the data being imperfect. A confidence interval cannot measure it. You can only list the assumptions and test the ones that can be tested.
Sampling uncertainty: bootstrap the cohorts
The usual formulas for a confidence interval assume independent rows. Your rows are not independent. The same query appears on many days, and the same query can appear under several pages. If you resample individual rows, the interval comes out too narrow. Resample whole queries instead. This is a cluster bootstrap, which means you draw queries with replacement and keep each query's rows together.
The script below builds a small synthetic dataset, so it runs without any credentials. To use it on real data, replace make_queries with a per-query table that has the same columns. Each row holds one query, summed over the pre period and over the post period.
import numpy as np
import pandas as pd
rng = np.random.default_rng(42)
def make_queries(n, cohort, relative_shift):
base_ctr = rng.beta(2, 38, n) # mean CTR about 5%
imps_pre = rng.lognormal(5, 1, n).astype(int) + 20
imps_post = rng.lognormal(5, 1, n).astype(int) + 20
return pd.DataFrame({
"cohort": cohort,
"imps_pre": imps_pre,
"imps_post": imps_post,
"clicks_pre": rng.binomial(imps_pre, base_ctr),
"clicks_post": rng.binomial(imps_post, base_ctr * (1 + relative_shift)),
})
# Exposed queries lose 12% of CTR; comparison queries lose 2% (seasonality).
queries = pd.concat([
make_queries(300, "exposed", -0.12),
make_queries(600, "comparison", -0.02),
], ignore_index=True)
def did_estimate(t):
s = t.groupby("cohort")[["clicks_pre", "imps_pre", "clicks_post", "imps_post"]].sum()
pre = s["clicks_pre"] / s["imps_pre"]
post = s["clicks_post"] / s["imps_post"]
change = post - pre
return change["exposed"] - change["comparison"]
point = did_estimate(queries)
boot = []
for i in range(1000):
resampled = queries.groupby("cohort").sample(frac=1, replace=True, random_state=i)
boot.append(did_estimate(resampled))
low, high = np.percentile(boot, [2.5, 97.5])
print(f"DiD estimate: {point:.4f}")
print(f"95% bootstrap interval: [{low:.4f}, {high:.4f}]")Read the output as a range. If the interval excludes zero, the data are hard to explain by random query-level variation alone. If it includes zero, you cannot rule out no effect. That is a statement about precision. It does not show that the effect is absent.
What makes the interval wide
- Few queries in the exposed cohort. A cohort of 40 queries gives a much wider interval than one of 400.
- A few queries carrying most of the impressions. A brand term with a huge share of clicks dominates the sums, so the bootstrap swings with whether that one query is drawn.
- Low CTR combined with low impressions. Click counts near zero are noisy in relative terms.
The first remedy is to drop or separate branded queries. Branded searches rarely behave like informational ones, and they are the queries you least want to treat as comparable. The second remedy is to report the interval for the cohort you can defend, not the one with the most data.
Structural uncertainty: the assumptions behind DiD
DiD is only as good as one assumption: without the AI Overview change, the exposed and comparison cohorts would have moved in parallel. This is called the parallel trends assumption. You cannot observe the counterfactual, so you can only look for evidence against it.
Placebo tests
A placebo test applies the same method to a period where nothing should have happened. Take only the pre-change data, pick a fake change date, and compute DiD between the two halves. The estimate should be close to zero. If it is not, the cohorts were already drifting apart, and your real estimate is contaminated by that drift.
Run at least two placebo dates. Check that the real estimate is clearly larger than the placebo spread. If the placebo estimates are about as large as the real one, the real one is not distinguishable from background divergence.
Exposure misclassification
Your exposed list comes from a SERP tracker. A tracker checks a fixed set of queries, from one location, device and logged-out state, at certain times. AI Overviews vary by user, location, device and time. So:
- Some "exposed" queries were not shown an Overview to many real users.
- Some "comparison" queries were shown one that the tracker missed.
Both errors push the two cohorts toward each other, so the estimated effect usually shrinks toward zero. Treat your estimate as closer to a lower bound on the effect of seeing an Overview than as an exact figure. A sensitivity check helps: redefine exposure more strictly (for example, an Overview present in every tracker snapshot, not just one) and see whether the estimate moves. A large move tells you the cohort rule matters.
Selection and regression to the mean
If you chose exposed queries because their clicks recently dropped, you picked queries at an unusually low point. Their CTR would tend to bounce back with no intervention, and that biases the estimate. Select cohorts using information from before the change window only, and do not select on the outcome.
Spillover and shared causes
Queries are not isolated. If an Overview on one query reduces visits to a page, that page's other queries may also lose clicks, even if they were never exposed. This contaminates the comparison cohort and again understates the effect. Pages can also share a cause, such as a template change or a ranking drop. Several of these shared causes belong in the confounders chapter, but they limit certainty here too, because you cannot fully remove them.
Data limits you inherit
| Source | Limit | Effect on your estimate |
|---|---|---|
| Search Console | Anonymized queries are left out of query-level rows | Totals by query are lower than totals by page or by site; rare queries are missing from cohorts |
| Search Console | Row limits per request and a cap on rows available per search type | Long-tail queries can be absent from the pull |
| Search Console | Position is an average across impressions | A rise in average position can hide mixed results |
| Search Console | AI feature clicks are not reported separately | You infer exposure from outside the tool |
| GA4 | Consent mode, ad blockers and thresholding reduce observed sessions | Session counts are lower than real visits |
| GA4 | Attribution reports credit a session, not a cause | Revenue per landing page is not revenue caused by the page |
| BigQuery export | Joins on `user_pseudo_id` and `ga_session_id` miss purchases outside the session | Revenue can be undercounted |
Two of these deserve extra attention. First, the anonymized-query gap means your cohorts describe the queries Google chose to show you, not all queries. If AI Overviews shift traffic toward rare queries, the shift is partly invisible. Second, revenue per landing page is an attribution figure. A change in it may reflect shifts in who visits and how they convert, not only the number of clicks.
Carrying uncertainty into revenue
You can turn the CTR interval into a revenue range with simple arithmetic. Take the lower and upper bootstrap bounds for the CTR change and apply each to the post-period impressions of the exposed cohort. That gives lost clicks at each bound. Then multiply by revenue per organic session from your BigQuery output, using a conservative and an optimistic value for that rate.
The result is a range, not a point. Name three inputs in the report: the CTR interval, the revenue-per-session assumption, and the exposed impression base. A reader can then see which input drives the width.
Multiple comparisons and slicing
Once you have the machinery, you may be tempted to cut the data many ways: by topic, by device, by country, by page type. Each cut gives a new estimate, and some will look significant by chance. With twenty cuts, one is expected to look significant at the 95% level even when nothing is going on.
Decide before looking which two or three slices matter to the business, and report those. If you explore more, label the extra cuts as exploratory and do not build a decision on a single striking subgroup.
What to say and what not to say
A defensible statement has four parts: the estimate, the interval, the assumption it rests on, and the main way it could be wrong. For example:
- "Exposed queries lost about 0.5 percentage points of CTR relative to comparison queries."
- "The 95% interval runs from 0.3 to 0.7 points, resampling by query."
- "This assumes the cohorts would have moved in parallel; placebo tests on two earlier dates gave estimates within 0.1 points of zero."
- "Exposure was detected by a tracker from one location, so the true effect on users who see an Overview is probably larger."
Avoid words such as "caused," "proved," and "lost revenue of exactly." Prefer "is consistent with," "we estimate," and "at least."
Checklist before you publish an estimate
- Bootstrap by query, not by row, and report the interval.
- Run at least two placebo tests on pre-change data.
- Rerun with a stricter exposure rule and note the change.
- Remove or separate branded queries and check the result.
- Confirm cohorts were chosen on pre-period information only.
- Compare totals from the query-level pull against page-level and site-level totals to see how much is anonymized or truncated.
- Carry the interval into any revenue figure.
Exercise
Your exposed cohort has 25 queries, and one branded query accounts for 60% of its impressions. Your bootstrap interval for the DiD in CTR is [-0.015, +0.004]. A manager asks, "So AI Overviews are not hurting us, right?" What do you answer, and what would you do to improve the analysis?
Show answer
Do not say there is no harm. The interval includes zero but also includes a drop of 1.5 points, so the data are too imprecise to decide either way. Two features cause the width: only 25 queries, and one branded query that dominates the sums so results swing with whether it is drawn. Improve the analysis by separating branded queries from the cohort, expanding the exposed cohort with more non-branded queries if the tracker data allow, running placebo tests on earlier dates, and extending the post period if possible. Then report the new interval together with the caveat that the estimate may be a lower bound because the tracker can miss exposure.