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

What is a constant in an experiment? Control variables explained

A constant is any factor you keep the same so the result can be pinned on the one thing you changed. Constant vs control group vs confounder, a worked device-mix example and how to hold variables constant in website tests.

Lucas Hayes Reviewed by Chen Yu Also called control variable Last updated Nov 29, 2026 Glossary

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.

TermWhat it isQuestion it answersCheckout-test example
Constant (control variable)A factor kept the same across all groupsWhat did we hold fixed?Price, layout, traffic mix, test dates
Control groupThe group that does not receive the treatmentWhat happens without the change?Visitors who see the old button text
Experimental groupThe group that receives the treatmentWhat happens with the change?Visitors who see the new button text
Confounding variableA factor that changed along with the treatment and also affects the outcomeWhat 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.

SegmentMonth A (old text)Month B (new text)
Desktop6,000 sessions at 4.0% = 240 orders3,000 sessions at 4.2% = 126 orders
Mobile4,000 sessions at 1.5% = 60 orders7,000 sessions at 1.6% = 112 orders
All sessions300 ÷ 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

Was this explanation clear?

We use your answers to fix and expand this page.

Lucas Hayes

Data Engineer

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

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 are constants in an experiment examples?

In a plant experiment testing fertiliser: pot size, soil, water, light, temperature and plant variety. In a website test of checkout button text: price, page layout, traffic source mix, device mix and the dates both versions run. Each could change the outcome, so each is kept the same.

What is the difference between a constant and a control group?

A constant is a factor held the same across all groups, such as price. A control group is a set of subjects that does not receive the treatment, such as visitors who see the old button. An experiment needs both: the control group gives the comparison, constants keep it fair.

Why is it important to keep variables constant?

If another factor changes along with the treatment, it becomes a confounder and can produce the result on its own. In the example here, a shift from 40% to 70% mobile traffic made conversion fall from 3.00% to 2.38% even though the new button raised conversion on every device.

How many constants should an experiment have?

As many as there are factors you can name that could affect the outcome, usually many, with only one independent variable. Fix what you can by running versions at the same time, randomise what you cannot fix, and write the list down before the test starts.

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