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

What is a confounding variable? Definition, examples and how to control for one

A confounding variable is a third factor that affects both the thing you changed and the result, so it looks like one caused the other. How to spot one in your analytics and how to control for it.

Emma Collins Reviewed by Su He Also called confounder Last updated Nov 4, 2026 Glossary

Quick answer

A confounding variable is a third factor that influences both the thing you think is the cause and the outcome you measure, creating a link between them that is partly or wholly not causal.

Formula: Confounder Z affects both X and Y: Z → X and Z → Y

What is a confounding variable?

A confounding variable (or confounder) is a third factor that affects both the thing you believe is the cause and the outcome you measure. Because it moves both, the two look related even when one does not cause the other.

A factor is a confounder when three things hold:

  1. It is associated with the supposed cause.
  2. It affects the outcome on its own.
  3. It is not a result of the cause (it is not a step in between).

The classic example: ice cream sales and drowning deaths rise together. Hot weather drives both. Ice cream does not cause drowning. This is why correlation is not causation.

An example from a dashboard

A product team launches a dark mode and compares conversion rates (sample numbers):

GroupUsersConvertedRate
Turned on dark mode600325.3%
Did not1,400322.3%

Dark mode users convert more than twice as often. Did dark mode help? Split by device:

DeviceDark mode onDark mode off
Desktop500 users, 6.0%100 users, 6.0%
Mobile100 users, 2.0%1,300 users, 2.0%

Within each device, the rate is identical. Desktop users both convert better and found the dark mode toggle more often. Device is the confounder. The overall gap came entirely from the mix of devices in each group. When the split reverses the overall direction instead of erasing it, the effect has a name: Simpson's paradox.

How to control for a confounder

  • Randomise. In an A/B test, chance decides who gets the change, so device, source and every factor you have not thought of are balanced between groups. This is the only method that handles unknown confounders.
  • Compare within segments (stratify). Look at the effect inside each value of the suspected confounder: desktop only, then mobile only. If the gap disappears, the confounder explained it.
  • Match or adjust. Compare users who are alike on the confounder (same plan, same country, same signup month), or use a regression that includes it.
  • Check the time order. A factor that changes because of the cause is a mediator, not a confounder. Controlling for it hides a real effect.

Common confounders in web and product analytics

ConfounderTypical false conclusion
Device or browser"Feature X raises conversion" when desktop users simply use X more
Traffic source"Page A converts better" when it gets more branded search traffic
User tenure"Users who use feature Y retain longer" when long-time users discover Y
Seasonality"The new pricing page lifted sales" when the launch coincided with a sale period
Plan or company size"Teams using integrations churn less" when larger accounts both integrate and stay

Checking for confounders in TapCub

TapCub does not run A/B tests, so most comparisons in it are observational and worth checking for confounders before acting. Click a row (device, source, country) on any web analytics table to add it as a filter, and repeat the comparison inside each value. Set the comparison to the previous period or the same period last week to rule out a date effect. For product questions, build a segment for each group and open it in analysis; a rule segment can also use a random bucket, which gives you a random holdout group to compare against. When the gap survives every split you can think of, treat it as a hypothesis worth testing, not proof. See also p-value and statistical significance.

Was this explanation clear?

We use your answers to fix and expand this page.

Emma Collins

Product Analyst

Focuses on event analysis, conversion funnels, and retention, using clear metric definitions and structured analysis to explain product performance.

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 a confounding variable in simple terms?

A hidden third factor that moves both of the things you are comparing, so they look connected even when one does not cause the other.

What is the difference between a confounding variable and a lurking variable?

They are usually used to mean the same thing. "Lurking" stresses that the factor was not measured or not noticed.

How do you control for a confounding variable?

Randomise who gets the change (an A/B test), or compare within groups that share the same value of the suspected confounder, such as one device type or one traffic source at a time.

Can you remove confounding from observational data completely?

No. Stratifying or adjusting handles the factors you know and measure. Only randomisation balances the ones you have not thought of.

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