TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Sampling bias: types, examples and how to spot it in analytics

Sampling bias means some people are more likely to end up in your data than others, so results are off no matter how much data you collect. Types, a consent-banner example, sources in analytics and how to reduce it.

Su He Reviewed by Emma Collins Also called sample bias Last updated Nov 5, 2026 Glossary

Quick answer

Sampling bias is a systematic error that occurs when the method of collecting a sample makes some members of the population more likely to be included than others, so the sample does not represent the population and estimates are skewed regardless of sample size.

What is sampling bias?

Sampling bias happens when the way a sample is collected makes some members of the population more or less likely to be included than others, so the sample does not represent the population. Any estimate from that sample (an average, a rate, a share) is then systematically off, and collecting more data the same way does not fix it.

That last point is what separates bias from noise. Random sampling error shrinks as the sample grows; sampling bias does not. A survey of 50,000 people who all chose to answer is still a survey of people who chose to answer.

Sampling bias vs selection bias

The terms overlap and are often used interchangeably. A useful distinction:

  • Sampling bias is about who gets into the data: the sample does not reflect the population you want to describe. It threatens external validity (does the result generalize?).
  • Selection bias is broader and includes how people are assigned to the groups you compare, for example users who opt into a feature being different from users who do not. It threatens internal validity (is the comparison fair?).

Common types of sampling bias

TypeWhat goes wrongAnalytics example
UndercoveragePart of the population cannot be sampled at allVisitors whose browsers block the analytics script never appear
Self-selection (voluntary response)People choose whether to be in the sampleFeedback widgets answered mostly by very happy or very angry users
NonresponseSome people sampled do not respond, and they differ from those who doExit surveys skipped by visitors in a hurry
Convenience samplingOnly easy-to-reach units are measuredUser interviews only with customers on the highest plan
Survivorship biasOnly the ones that "survived" a process remainAnalyzing only retained users to learn why users stay
Time-window biasThe period sampled is unusualBenchmarking conversion during a holiday sale

Worked example: consent-based tracking

Suppose a site only records analytics for visitors who accept a cookie banner (sample data):

  • 55% of visitors accept; they convert at 3.5%.
  • 45% decline; they convert at 1.8%.
  • The true conversion rate of all visitors is 0.55 × 3.5% + 0.45 × 1.8% = 2.74%.
  • The dashboard, which only sees acceptors, reports 3.5%, about 28% too high.

Now acceptance rates change. If a new banner design lowers acceptance to 40% while each group converts as before, the true rate falls to 2.48%, but the dashboard still shows 3.5%. The bias is invisible from inside the data because the excluded visitors are, by definition, not in it.

Sources of sampling bias in web and app analytics

  • Script and tracker blocking. Ad blockers and privacy browsers block many analytics scripts. Blocking rates differ by audience: developer and gaming audiences block far more than general consumers. See do ad blockers block TapCub.
  • Consent-dependent tracking. When tracking waits for consent, only consenting visitors are counted, and they differ from those who decline.
  • Cookie expiry and deletion. Returning visitors whose identifiers were cleared show up as new, biasing new vs returning ratios.
  • Logged-in only analysis. Product analytics on signed-in users excludes everyone who never signed up.
  • Sampled reports. Tools that sample large date ranges can over- or under-represent small segments; see data sampling.
  • Bots. Unfiltered automated traffic adds a population you did not mean to measure.

How to detect sampling bias

  1. Compare against an independent source. Server logs, payment records or CRM counts should roughly match analytics trends. A widening gap means coverage is changing.
  2. Check the sample's composition. Compare device, country or plan mix in the sample with what you know about the whole population.
  3. Watch coverage over time. A sudden step change in sessions with no change in orders often means tracking coverage changed, not demand.
  4. Look at who is missing. Ask which visitors could not be recorded, and whether they are likely to behave differently.

How to reduce it

  • Measure without depending on optional storage where you can. Counting that does not need cookies is not affected by banner acceptance; see cookieless analytics.
  • Send key business events server-side (orders, sign-ups), so they are recorded even when the browser blocks scripts.
  • Use stratified or weighted estimates when you know the population mix; see stratified sampling.
  • Sample randomly for surveys and interviews instead of asking whoever is easiest to reach.
  • State the population. "Conversion among consenting desktop visitors" is honest; "conversion" is not.

In TapCub

TapCub's default website counting is anonymous and writes no cookie or local storage, so visit counts do not depend on whether visitors accept a cookie banner (regional presets that wait for consent are the exception). Server-side events through the API are recorded regardless of browser blocking. Bot filtering removes known automated traffic before reports. Reports use all collected events rather than a sample. None of this removes bias from people who block the script entirely; compare with server-side order counts to see the size of that gap.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is an example of sampling bias?

Tracking only visitors who accept a cookie banner. If acceptors convert at 3.5% and decliners at 1.8%, a dashboard showing 3.5% overstates the true rate.

Does a larger sample fix sampling bias?

No. A larger sample reduces random error, but if the collection method excludes or over-includes certain people, the bias stays.

What is the difference between sampling bias and selection bias?

Sampling bias concerns who gets into the data at all; selection bias also covers how people end up in the groups you compare.

How do you reduce sampling bias in analytics?

Reduce dependence on optional storage, send key events server-side, filter bots, compare with independent sources, and weight results when you know the population mix.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics