Sub topic 13
Measuring conversion rate
This chapter assumes you know how a landing page and an HTML form work, and that you are comfortable with percentages and ratios. It covers how to define conversion rate, which numbers to collect, and where the figure misleads. It also covers how to compare variants fairly.
What conversion rate means
A conversion is a visitor completing the action you want. For a lead page, that action is submitting the form. The conversion rate is the share of visitors who convert:
conversion rate = leads / visitors
If 2,400 visitors reach your page and 96 submit the form, the rate is 4.0%. The calculation is simple. Most mistakes come from choosing the wrong numerator or denominator, or from comparing numbers that were counted differently.
def conversion_rate(leads, visitors):
if visitors == 0:
return 0.0
return leads / visitors
visitors = 2400
leads = 96
print(f"{conversion_rate(leads, visitors):.1%}") # 4.0%The zero check matters in practice. A new page, or a segment such as "visitors from one email campaign", can have no traffic yet. Returning 0.0 keeps a report from crashing, but a rate of 0.0% on zero visitors means "no data", not "no one converted". Show such cells as empty in a real dashboard.
Pick the denominator on purpose
"Visitors" can mean several things, and each gives a different rate.
| Denominator | What it counts | Typical effect on the rate |
|---|---|---|
| Sessions | Every visit, including repeat visits by the same person | Lowest rate, because one person is counted several times |
| Unique visitors | Each person (or browser) once in the period | Higher rate, closer to "what share of people converted" |
| Landing page views | Only visits that loaded the page you are judging | Isolates the page from earlier steps |
| Ad clicks | Clicks recorded by the ad platform | Higher than page views, because some clicks never load the page |
Choose one definition and write it down. If your analytics tool reports sessions and your form tool reports unique submissions, dividing one by the other mixes definitions and gives a number nobody can reproduce.
The numerator needs the same care. Count a lead only when a valid submission arrives. Do not count button clicks, page loads of the thank-you page after a refresh, or submissions that fail validation. The usual safeguards are:
- Count the thank-you page view once per person, or count records in your form backend instead.
- Remove duplicates, such as the same email submitted twice.
- Filter obvious bot and spam submissions.
Measure each step of the funnel
A single overall rate tells you that something is wrong but not where. Break the path into stages and compute the rate between each pair. That shows where visitors drop off, which is the main use of the funnel from the first chapter.
stages = [
("Visitors", 2400),
("Started the form", 300),
("Submitted the form", 110),
("Valid leads", 96),
]
for (prev_name, prev_n), (name, n) in zip(stages, stages[1:]):
step = n / prev_n if prev_n else 0.0
print(f"{prev_name} -> {name}: {step:.1%}")
overall = stages[-1][1] / stages[0][1]
print(f"Overall: {overall:.1%}")This prints:
Visitors -> Started the form: 12.5%
Started the form -> Submitted the form: 36.7%
Submitted the form -> Valid leads: 87.3%
Overall: 4.0%Each step points to a different fix:
- A low visitors-to-start rate points at the headline, offer, or page layout. People are not interested enough to try the form.
- A low start-to-submit rate points at form friction: too many fields, unclear labels, or a consent checkbox that surprises people.
- A low submit-to-valid rate points at spam, typos in email fields, or a missing validation message.
Form starts require event tracking. Most analytics tools can record a "focus on the first field" event, and you will need to add it yourself.
Segment before you conclude anything
An overall rate hides differences between groups. Break it down by:
- Traffic source (search ads, email, social, direct).
- Device (phone or desktop).
- New or returning visitors.
- Landing page or offer.
Segmenting also protects you from a trap. Suppose your blended rate rises after a change. The cause may be that you sent more traffic from a high-intent source such as a partner email, not that the page improved. Compare like with like: the same source, the same period, the same definitions.
Beware of small segments. A segment of 40 visitors with 3 leads shows 7.5%, but one extra lead moves it to 10.0%. Treat rates from small counts as rough hints, and report the counts next to the percentages.
Conversion rate is not the whole story
A higher rate is not always better. Shortening a form usually raises visit-to-lead conversion, but it can also let in people who are less likely to buy. To see this, measure the next rate as well: the share of leads who become customers.
def lead_to_customer_rate(customers, leads):
return customers / leads if leads else 0.0
variants = {
"A: short form": {"visitors": 1000, "leads": 60, "customers": 3},
"B: long form": {"visitors": 1000, "leads": 35, "customers": 4},
}
for name, v in variants.items():
visit_to_lead = v["leads"] / v["visitors"]
lead_to_cust = lead_to_customer_rate(v["customers"], v["leads"])
print(f"{name}: {visit_to_lead:.1%} of visitors become leads, {lead_to_cust:.1%} of leads become customers")The output is:
A: short form: 6.0% of visitors become leads, 5.0% of leads become customers
B: long form: 3.5% of visitors become leads, 11.4% of leads become customersVariant A wins on lead volume. Variant B produces more customers per 1,000 visitors (4 against 3), and its leads are better. Which is the right choice depends on your costs. If follow-up is cheap, A may still be better once you have more data. If each lead needs a sales call, B's smaller and warmer list may be cheaper to work. The later chapter on lead quality returns to this trade-off.
Time lag and attribution
Leads rarely become customers on the same day. If you measure "customers from this week's leads" on Friday, the rate will look low because most of those leads are still deciding. Use cohorts instead: group leads by the week they arrived, then check each group again after a fixed delay, such as 30 days. Compare cohorts only at the same age.
Attribution has a similar problem. A visitor may click an ad on Monday, read a blog post on Wednesday, and submit the form on Friday from a direct visit. The form submission will be credited to "direct" unless you record the first source. Decide on a rule, for example "credit the source of the first visit", store it with the lead, and apply it consistently.
Common errors
- Mixing definitions. Sessions in the denominator and unique people in the numerator produce a number that cannot be compared with any other.
- Counting thank-you page loads. Refreshes, back-button visits, and bookmarks inflate the lead count.
- Ignoring bots. Automated traffic adds visitors without leads and lowers the rate, and spam submissions add false leads and raise it.
- Reading too much into small numbers. Always report the counts, and wait for enough traffic before acting on a difference.
- Chasing the rate alone. A form with only an email field may convert best and still produce leads who never respond.
- Changing the page and the traffic source at once. You then cannot tell which one moved the rate.
A reporting checklist
Before you share a conversion rate, check that you can answer these questions:
- What exactly counts as a visitor, and what counts as a lead?
- Over what dates, and for which traffic sources?
- Are duplicates, bots, and failed submissions removed?
- What are the raw counts behind the percentage?
- What is the next-stage rate (lead to customer), and how old are the leads it covers?
Exercise
A landing page had 1,800 visitors. 270 started the form, 90 submitted it, and 81 of those were valid leads after spam and duplicates were removed. Calculate the overall conversion rate and the rate at each step. Which step loses the most visitors in relative terms, and what would you look at first?
Show answer
Overall: 81 / 1,800 = 4.5%. Visitors to form starts: 270 / 1,800 = 15.0%. Form starts to submissions: 90 / 270 = 33.3%. Submissions to valid leads: 81 / 90 = 90.0%. The biggest relative loss after the first step is between starting and submitting the form, where two thirds of people who begin leave. Look at the form first: the number of fields, unclear labels, a surprising consent checkbox, or validation errors on mobile. The first step also drops most visitors, but that is a message and offer question, which you would check second.
Exercise
Form A converts 5.0% of visitors to leads and 4.0% of those leads to customers. Form B converts 3.0% of visitors to leads and 8.0% of those leads to customers. Which form produces more customers per 1,000 visitors? What else would you check before choosing?
Show answer
Form A gives 1,000 x 0.05 x 0.04 = 2 customers. Form B gives 1,000 x 0.03 x 0.08 = 2.4 customers, so B is ahead. Before choosing, check the raw counts, because with so few customers the gap may be noise. Also check that the leads are the same age (same cohort length), and compare the cost of following up the extra leads from Form A.