Quick answer
A constant in an experiment, also called a control variable or controlled variable, is a factor that could affect the outcome but is deliberately kept the same for every group and measurement, so a change in the result can be pinned on the independent variable. It is not a control group.
What is a constant in an experiment?
A constant in an experiment, also called a control variable or controlled variable, is any factor that could affect the result but that the experimenter deliberately keeps the same for every group and every measurement. Holding it fixed removes it as an explanation, so a change in the outcome can be attributed to the one factor you actually changed.
Every experiment has three kinds of variables:
- Independent variable: the factor you change on purpose (the treatment).
- Dependent variable: the outcome you measure.
- Constants (control variables): everything else that could influence the outcome and is kept fixed.
The NIST/SEMATECH e-Handbook describes the same structure in engineering terms: factors the experimenter deliberately changes, measured responses, controllable factors that can be set at will and uncontrolled factors, such as ambient temperature, that the design still has to account for. A constant is a controllable factor you choose not to vary.
A typical experiment has one independent variable and many constants. In a plant-growth experiment where the independent variable is fertiliser, the constants are pot size, soil, water, light, temperature and the plant variety. In a website test where the independent variable is the checkout button text, the constants are the price, the page layout, the traffic sources, the device mix and the dates.
Constant vs control group vs confounding variable
Three terms that sound alike are often mixed up. They answer different questions.
| Term | What it is | Question it answers | Checkout-test example |
|---|---|---|---|
| Constant (control variable) | A factor kept the same across all groups | What did we hold fixed? | Price, layout, traffic mix, test dates |
| Control group | The group that does not receive the treatment | What happens without the change? | Visitors who see the old button text |
| Experimental group | The group that receives the treatment | What happens with the change? | Visitors who see the new button text |
| Confounding variable | A factor that changed along with the treatment and also affects the outcome | What else could explain the result? | A sale that started the same week as the new text |
The relationship is simple: a confounder is a would-be constant that you failed to hold constant. Every variable you control is one fewer confounder to worry about. Randomisation handles the factors you cannot list or fix, by spreading them evenly across groups; constants handle the ones you can name.
"Control" also has a third meaning in regulated research. U.S. drug-trial rules (21 CFR 314.126) recognise five kinds of control: placebo concurrent control, dose-comparison concurrent control, no-treatment concurrent control, active-treatment concurrent control and historical control. The regulation says historical controls are "usually reserved for special circumstances" because the groups are harder to compare on key variables, and that assignment should make the groups comparable on pertinent variables such as age, sex and disease severity. A before/after comparison in analytics is a historical control: last month plays the role of the control group, and nothing guarantees the two months were alike.
A worked example: holding device mix constant
Sample data: a store changes its checkout button text on the first of the month and compares conversion with the previous month. Each month has 10,000 checkout sessions.
| Segment | Month A (old text) | Month B (new text) |
|---|---|---|
| Desktop | 6,000 sessions at 4.0% = 240 orders | 3,000 sessions at 4.2% = 126 orders |
| Mobile | 4,000 sessions at 1.5% = 60 orders | 7,000 sessions at 1.6% = 112 orders |
| All sessions | 300 ÷ 10,000 = 3.00% | 238 ÷ 10,000 = 2.38% |
Read naively, the new text cut conversion by 0.62 points. Within each device it raised conversion: desktop from 4.0% to 4.2%, mobile from 1.5% to 1.6%. The overall rate fell because device mix was not held constant: a mobile campaign shifted traffic from 40% mobile to 70% mobile, and mobile converts at less than half the desktop rate.
Holding the mix constant fixes it. Apply month B's device rates to month A's mix: 0.6 × 4.2% + 0.4 × 1.6% = 2.52% + 0.64% = 3.16%, against 3.00% before. With device held constant, the change is +0.16 points, not −0.62.
This reversal is Simpson's paradox, and it is the most common way an uncontrolled variable misleads a website analysis. Device is only one candidate; traffic source, new vs returning visitors, country, price and day of week can each do the same.
How to hold variables constant in online tests and comparisons
- List the candidates before you look at results. For a web change, the usual list is: traffic source and campaign mix, device and browser, new vs returning visitors, country, price and promotions, page speed, day of week and season, and tracking code changes.
- Fix what you can by design. Run variants at the same time rather than in sequence, so dates, seasonality and campaigns are identical for both groups. Freeze price and layout during the test.
- Randomise what you cannot fix. Random assignment of visitors spreads unknown factors evenly. This is what makes a controlled experiment stronger than any before/after comparison.
- Stratify or segment what varies anyway. When the mix shifts, compare within segments (desktop with desktop) and reweight to a common mix, as in the example.
- Align calendars in before/after comparisons. Compare Monday with Monday and the same length of period; a week containing a holiday is not a constant.
- Write the constants down. A one-line list in the test plan ("price, layout, traffic mix held constant; campaign X paused") turns an argument after the test into a check.
Common mistakes
- Calling the control group "the constant". The control group is a group of subjects; a constant is a factor. Both are needed.
- Assuming randomisation makes constants unnecessary. Randomisation balances groups on average, but a price change during the test affects both groups and changes what you are measuring.
- Holding too much constant. If you only test on desktop traffic from one campaign, the result may not hold for mobile. Every constant narrows the conclusion to the conditions you fixed.
- Ignoring measurement as a variable. A new tracking snippet, a changed goal definition or a consent banner that launched mid-test changes the dependent variable itself.
- Letting bots vary. A crawler spike in one period inflates sessions in the denominator; bot traffic needs to be excluded the same way in both periods.
Holding variables constant in TapCub
TapCub does not split traffic or run A/B tests. It is the place where you check what changed between two periods or groups, and where you hold the obvious variables fixed when comparing them. The button-text example above would run like this:
- Mark the change date. Add an annotation in Configuration › Annotations on the day the new text went live, so everyone reading the chart knows where "before" ends.
- Compare like with like. In All-platform analytics › Behavior › Event analysis, compare the purchase metric with the previous period and turn on weekday alignment, so Mondays are compared with Mondays. Break the result down by device, then by channel, to see whether the mix moved.
- Fix a segment. Filter both periods to the same segment, for example desktop visitors from organic search, or build a rule segment in All-platform analytics › Users › Segments & tags and apply it to both sides. The comparison then holds device and source constant.
- Check the denominator. Recognised bots go to Web analytics › Bots and are not counted as visitors in either period, so a crawler spike does not change the conversion denominator.
- Look at the mix directly. Web analytics › Sources shows channel and UTM shares for each period; if paid social jumped from 10% to 40% of sessions, treat channel as a confounder and compare within channels.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 5.1.1 What is experimental design? (factors, responses, controllable and uncontrolled factors).
- U.S. Code of Federal Regulations, 21 CFR 314.126 Adequate and well-controlled studies (five types of control; historical controls usually reserved for special circumstances; assignment to assure comparability of groups).
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Engineer
Writes about event design, data quality, and collection workflows, with verifiable implementation methods for reliable analytics.