Sub topic 5
Sampling: when GA4 estimates instead of counting
This chapter assumes you can build a Free-form exploration in the Explore section. It also assumes you know that standard reports, Explorations, the Data API, and the BigQuery export are different reporting surfaces. The previous chapters covered thresholds. Sampling is a separate mechanism with a different cause and a different fix.
What sampling is
Sampling means GA4 analyzes a subset of your events and scales the result up to estimate the full total. The numbers in the table are estimates, not counts. A sampled report is not wrong. It is approximate, and the approximation gets worse as the sample gets smaller relative to the full data.
GA4 does this for speed. An exploration runs a custom query against raw event data when you open it. If the query would scan too many events, GA4 reads only part of them.
Sampling differs from thresholding in what it does to the table:
| Mechanism | What happens | What you see |
|---|---|---|
| Thresholding | Rows are withheld to protect users | Missing rows, totals that exceed the sum of rows |
| Sampling | Numbers are estimated from a subset | All rows present, values slightly off |
| (other) row | Rows beyond a limit are merged | A row labeled (other) |
Where sampling happens
Sampling depends on the reporting surface.
- Standard reports (Reports section) read from pre-aggregated tables. They are not sampled.
- Explorations build custom queries on event-level data. They are the main place sampling occurs.
- Data API reports can be sampled in some cases. The response metadata tells you.
- BigQuery export contains the raw events. Nothing is sampled, because you run the query yourself.
The practical rule: when a number in an exploration disagrees slightly with a standard report, check for sampling first.
The quota that triggers sampling
Each exploration query has an event quota. Reading more events than the quota allows triggers sampling. The commonly documented limits are:
| Property type | Events per query before sampling |
|---|---|
| Standard GA4 property | 10 million |
| GA4 360 property | 1 billion |
Three things matter about how the quota works.
- The quota applies per query. Each time you change the report and it re-runs, GA4 checks again.
- The count is driven by the date range. A wider range means more events, so a longer range is the most common cause of sampling.
- Event volume matters more than user count. A site with few users but many events per user (for example, scroll or custom interaction events) reaches the quota sooner than you expect.
The limits are Google's published values at the time of writing. They can change, so check the current Analytics Help documentation if your numbers matter.
Sampling also depends on the type of exploration. Techniques such as funnel, path, and segment overlap explorations run heavier queries, and they are more likely to be sampled than a simple free-form table over the same dates.
The sampling indicator
Every exploration shows a shield icon at the top left of the report. Its color tells you the state.
- Green: the data is unsampled. The numbers are complete counts.
- Yellow: the data is sampled. Hover over the icon to see how many events were used and what percentage of the total that represents.
Make a habit of reading this icon before you copy a number out of an exploration. A yellow shield with 95% of events sampled is fine for most purposes. A yellow shield with 8% of events is a signal to redesign the report before you trust small values.
Why sampling error is uneven
Sampling does not distort every number equally. GA4 estimates by scaling what it saw in the sample. The estimate is reliable for large, evenly spread values, and unreliable for small or rare ones.
Suppose a report samples 10% of events and a rare event, such as purchase, appears in 40 sampled events. GA4 scales that to roughly 400. If purchases cluster on a few days, the sample may have missed some of them. The scaled estimate for purchases can then be off by far more than the estimate for page views.
This gives you two rules.
- Totals of common events are usually safe in a sampled report.
- Breakdowns of rare events, small segments, or long-tail dimension values are the numbers most likely to mislead you.
Sampled results are also not reproducible. Re-running the same exploration can give a slightly different number, because the subset GA4 picks can change. If two people compare an exploration and get different values, sampling is a likely cause.
Reading sampling details in the Data API
The Data API reports sampling in the response metadata. Each date range gets an entry with two numbers: how many events were read and how large the full space was. Dividing them gives the sampling percentage. If the response has no entries, the report was not sampled.
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import DateRange, Dimension, Metric, RunReportRequest
client = BetaAnalyticsDataClient()
request = RunReportRequest(
property="properties/123456789",
dimensions=[Dimension(name="eventName")],
metrics=[Metric(name="eventCount")],
date_ranges=[DateRange(start_date="2026-01-01", end_date="2026-01-31")],
)
response = client.run_report(request)
if not response.metadata.sampling_metadatas:
print("Report was not sampled.")
for index, meta in enumerate(response.metadata.sampling_metadatas):
share = meta.samples_read_count / meta.sampling_space_size
print(f"Date range {index}: {share:.1%} of events read")Replace the property ID with your own. The later chapter on the Data API covers the other metadata flags in more detail.
Reducing sampling
You cannot turn sampling off in a standard property, but you can lower the number of events a query reads.
- Shorten the date range. Run one month at a time instead of a year, then combine results outside GA4. This is the most effective change.
- Start from a standard report. If the question can be answered there, use it. It is unsampled.
- Use fewer segments and simpler techniques. Each extra segment, filter, or breakdown makes the query heavier. Keep the layout minimal.
- Check the quota-saving options. Explorations have settings that affect how much data is read. Look at the report settings panel for options that apply to your report type.
- Use the BigQuery export when you need exact counts over a long period. It is the one surface where sampling cannot occur.
- Consider GA4 360 if you routinely hit the 10 million limit. The 1 billion per-query quota makes sampling much rarer.
Filtering to a small segment does not always avoid sampling. The quota is generally based on the events in the date range for the property, not only the events that match your filter. If a short range doesn't clear the shield, the problem is volume, not your filter.
A worked example
You open a Free-form exploration for a full year with Page path as the rows, Sessions and Key events as values, and a segment for mobile users. The shield is yellow and shows 12% of events.
- Compare a large value with the standard report.
Sessionsfor your top page is within about 1% of the standard report. The estimate is fine here. - Look at a small value.
Key eventsfor a low-traffic page is 18 in the exploration. The standard report shows 31. This is the unevenness described above. - Change the date range to a single month. The shield turns green, and the counts now match.
- Run the other eleven months the same way and add them up in a spreadsheet, or query BigQuery for the full year.
The same SQL approach works in the export. This query counts events per month without any sampling:
SELECT
FORMAT_DATE('%Y-%m', PARSE_DATE('%Y%m%d', event_date)) AS month,
COUNT(*) AS events
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260101' AND '20261231'
GROUP BY month
ORDER BY month;Replace the project and dataset names with your own.
Common mistakes
- Treating a yellow shield as an error. It is a statement about precision. Decide based on how large the sample is and how small the numbers you need are.
- Comparing an exploration with a standard report and blaming one of them. The standard report is unsampled, so a gap often means the exploration is sampled.
- Ignoring sampling on rare events. Check conversions and small segments first, not page views.
- Assuming a narrow filter fixes sampling. The date range is usually the setting that matters.
Exercise
An exploration over 14 months shows a yellow shield. The total sessions match the standard report within 1%, but the purchase count for a small product category is 60% lower than the figure in BigQuery. Explain why, and name two changes that would improve the exploration.
Show answer
The exploration is sampled, and sampling is least accurate for rare events and small segments. Total sessions are large and evenly spread, so the scaled estimate is close. Purchases in a small category occur in few sampled events, so the scaled estimate is unstable and can miss days where they clustered. To improve it, shorten the date range (for example, one month per run) and simplify the report by removing extra segments or breakdowns. For an exact figure, use the BigQuery export, which is not sampled.
Exercise
A colleague runs the same exploration an hour after you and reports a number that differs by about 2%. The shield is yellow for both. What is the likely cause, and how can you make the two numbers agree?
Show answer
Sampling is the likely cause, because the subset of events GA4 reads can vary between runs, so sampled results are not exactly reproducible. To make the numbers agree, reduce the query below the event quota (shorter date range, simpler report) until the shield turns green, which gives exact counts. You can also use the same figure from a standard report or BigQuery.