Sub topic 13
Measure, test and improve
This chapter closes the tutorial. You already have a hub site, traffic from several channels, tagged campaign links, analytics goals, a lead form and a consent setup. Here you turn those into a repeatable routine for improving the site.
It assumes you know what a conversion rate is and have seen a goal or event report in a web analytics tool. It also assumes you have read the earlier chapters on UTM tagging, KPIs and consent. No programming is required. The one Python example is explained line by line.
The improvement loop
Improvement works best as a cycle. Each pass produces a decision and a written record, so the next pass starts from what you learned.
The loop has two properties worth protecting. Every change is tied to a metric you chose before the test, and every outcome is recorded, including the failures.
Start from the baseline
You cannot tell whether a change helped without knowing where you started. Before you touch anything, capture a baseline for the page or funnel you plan to change:
- The primary conversion rate, for example form submissions divided by sessions on the landing page.
- The volume behind it, meaning how many sessions and conversions you get per week.
- The split by source and medium, using the UTM tags from earlier chapters.
- The usual week-to-week variation, which you can see by looking at the last 8 to 12 weeks.
The last point is the one people skip. If your conversion rate normally moves between 4.2% and 5.8% from week to week, a move from 5.0% to 5.4% tells you nothing.
Find where to look
Use the funnel to choose what to improve. Compare each stage with the next, and look for the largest drop among pages that get a lot of traffic.
Common signals and what they usually point to:
| Signal in analytics | Likely cause | First thing to check |
|---|---|---|
| High exits on a landing page from paid search | Message mismatch between ad and page | Does the headline repeat the promise in the ad? |
| Many form starts, few submissions | Form friction | Number of fields, error messages, mobile layout |
| Good desktop rate, poor mobile rate | Layout or speed problem | Page speed and tap targets on a phone |
| Traffic up, leads flat | Low-intent traffic | Conversion rate by source and medium |
| Many visits, no goal events | Tracking gap | Whether the goal fires at all, and whether consent blocks it |
Do not treat a signal as a diagnosis. It tells you where to look, and you still have to form an explanation that a test can confirm or reject.
Prioritize ideas
You will have more ideas than traffic to test them. A simple scoring method keeps the list honest. Score each idea from 1 to 10 on three questions: how large is the likely impact, how confident are you, and how easy is it to ship. Multiply or average the scores and test the highest first.
The scores are opinions, so use them to order the list and not to justify it. Pages with little traffic are poor test candidates. A page with 200 visits a month cannot detect anything except a very large effect, so fix obvious problems there without a test.
Write a testable hypothesis
A useful hypothesis names the change, the expected effect, the reason, and the metric. For example:
"If we shorten the guide download form from five fields to one, more visitors will finish it, because each extra field adds effort. We will judge it by the form submission rate per landing page session."
Decide three things before the test starts and write them down:
- The primary metric, such as submission rate. Pick one.
- A guardrail metric that must not get worse, such as lead quality (the share of leads your sales team accepts) or page speed.
- The smallest improvement that would be worth shipping.
A shorter form may raise submissions and lower lead quality. Without the guardrail you could "win" the test and lose money.
Run a controlled test
An A/B test sends visitors at random to version A (the control) or version B (the variant) at the same time, and compares a metric. Running both versions at once matters. Comparing this month with last month mixes your change with seasonality, campaigns and news.
Rules that prevent most bad tests:
- Change one thing, or one coherent bundle, per test. Otherwise you will not know what caused the result.
- Randomize per visitor, not per page view, so a visitor sees the same version each time.
- Test only traffic that can see both versions, and keep the split stable once it starts.
- Run for whole weeks, at least one and usually two. Weekday and weekend behavior differs.
- Fix the sample size or duration in advance.
How much traffic you need
A rough rule for 80% power and a 5% significance level is:
visitors per variant ≈ 16 × p × (1 − p) ÷ d²
Here p is the baseline conversion rate and d is the smallest absolute change you care about. For a 5% baseline and a target of 6% (d = 0.01), that gives 16 × 0.05 × 0.95 ÷ 0.0001 = 7,600 visitors per variant. If the page gets 3,000 visits a week, the test needs about five weeks with a 50/50 split. If that is too long, test a bigger change or a higher-traffic page.
Tag test traffic
Email and ad links can point to a variant, so keep the tracking clean. The utm_content parameter is designed to tell similar links apart, for example utm_content=short_form. Then you can compare the results by campaign in your analytics tool. Do not put the variant name in utm_campaign, because that splits one campaign into two rows in every report.
Read the result
For conversion rates, a two-proportion z-test is the standard check. It asks how likely a difference this large would be if the two versions were really identical. That probability is the p-value.
import math
def two_proportion_z(conv_a, n_a, conv_b, n_b):
"""Compare two conversion rates. Returns rates, z score and two-sided p-value."""
rate_a = conv_a / n_a
rate_b = conv_b / n_b
pooled = (conv_a + conv_b) / (n_a + n_b)
std_err = math.sqrt(pooled * (1 - pooled) * (1 / n_a + 1 / n_b))
z = (rate_b - rate_a) / std_err
p_value = math.erfc(abs(z) / math.sqrt(2))
return rate_a, rate_b, z, p_value
rate_a, rate_b, z, p = two_proportion_z(400, 8000, 488, 8000)
print(f"A: {rate_a:.1%} B: {rate_b:.1%} z = {z:.2f} p = {p:.4f}")The script prints A: 5.0% B: 6.1% z = 3.04 p = 0.0024. The function pools both groups to estimate the shared rate, computes how much random noise to expect in the difference (the standard error), and converts the z score to a p-value with the complementary error function.
A p-value below 0.05 is the usual bar for calling a result "statistically significant". It is not the same as "important". Also look at the size of the change and its confidence interval, and ask whether the gain justifies the cost of shipping and maintaining it.
Common errors
| Error | What goes wrong | Prevention |
|---|---|---|
| Peeking and stopping early | Checking daily and stopping at the first p < 0.05 inflates false positives well above 5% | Fix the duration first, or use a tool built for sequential testing |
| Too many variants or metrics | With 20 comparisons, one will look significant by chance | Declare one primary metric before starting |
| Slicing after the fact | Finding "it won for mobile visitors from email" in a flat test is usually noise | Treat segment findings as new hypotheses and test them |
| Sample ratio mismatch | A 50/50 split that delivers 52/48 on large traffic signals a bug in assignment or tracking | Check the split before reading results |
| Novelty effect | A new design wins for two weeks because it is new | Run long enough and recheck after rollout |
| Ignoring seasonality | A sale week or holiday lifts both versions, or only one | Run both versions at once, and avoid atypical weeks |
| Winning on a vanity metric | Clicks rise, qualified leads do not | Use a guardrail tied to the CRM outcome |
Tracking quality is another source of error. If a cookie banner blocks analytics for visitors who decline, your test sees only the consenting group. That is acceptable when both versions are affected equally, but the results describe consenting visitors only. If the banner or consent flow itself is under test, the missing data is no longer random and you must account for it.
Privacy applies to testing too
Testing tools usually set identifiers to keep each visitor in the same version, and some record behavior such as clicks or sessions. Check three things:
- The tool is listed in your consent categories and does not run before consent where the law requires it.
- Your privacy notice mentions testing and analytics purposes.
- Test results are reviewed in aggregate. You do not need individual-level data to decide between A and B.
Decide, ship and record
After the test ends, you have three outcomes:
- The variant wins on the primary metric and does not harm the guardrail. Roll it out to everyone, then check the metric for a few weeks against your baseline.
- The variant loses. Keep the original and write down what you learned about visitor behavior.
- The difference is too small to call. Treat it as "no detectable effect". Pick a bolder change or move to a higher-impact page, instead of extending the test indefinitely.
Keep a simple test log with these columns: date range, page, hypothesis, primary metric, baseline, result, decision, and what you would try next. After a year this log is one of your most useful marketing assets, because it stops you from repeating failed ideas and shows which kinds of changes work for your audience.
Not everything needs a test. Fixing a broken form, repairing a slow page, or correcting a tracking error is maintenance. Reserve tests for decisions where you honestly do not know which option is better.
Close the loop with the hub
Every part of the hub-and-spoke model feeds this cycle. Tagged campaign links tell you which spokes send visitors who convert. Analytics shows what they do on the site. The lead form and CRM show whether those conversions became customers. Consent settings define what you are allowed to measure. Improvement comes from combining these: send more of the traffic that converts well, fix the pages where it drops off, and test changes before committing to them.
Exercise
A landing page converts 4% of 5,000 weekly sessions. After one week of an A/B test, variant B shows 4.6% against 4.0% for A, with p = 0.03. A colleague wants to stop and ship B. Give two checks you would make before agreeing, and one reason the p-value alone is not enough.
Show answer
Check that the planned sample size or duration was reached (a single week may not cover weekday and weekend patterns, and stopping at the first p < 0.05 inflates false positives), and check the guardrail metric, such as lead quality from the CRM or page speed, along with the traffic split for sample ratio mismatch. The p-value alone is not enough because it only says a difference this size is unlikely if the versions were identical. It does not show that the effect is large enough to matter, that it will last past the novelty period, or that it did not harm another metric.
Exercise
Your baseline conversion rate is 5% and you want to detect an improvement to 6%. Using the rule visitors per variant ≈ 16 × p × (1 − p) ÷ d², how many visitors does each variant need, and how long will the test take if the page gets 2,000 sessions per week split evenly between two versions?
Show answer
p = 0.05 and d = 0.01, so 16 × 0.05 × 0.95 ÷ 0.0001 = 7,600 visitors per variant, or 15,200 in total. At 2,000 sessions per week that takes 7.6 weeks, so plan on about 8 weeks (a whole number of weeks). If that is too long, test a larger change or a page with more traffic.
Exercise
You send the same email to your list with two links to the same landing page, one pointing at the short form and one at the long form. Which UTM parameter should differ between the links, and why should utm_campaign stay the same?
Show answer
Use utmcontent to tell the two links apart (for example shortform and longform). Keep utmcampaign identical so that the analytics report groups both links under one campaign and you can compare the variants within it, instead of splitting the campaign into two unrelated rows.