Landing Pages and Conversion
Learn what a landing page should do, audit two pages with a real HTML parser, and compare conversion rates with ranges that show how much a result could wobble by chance.
In this lesson you will
- Explain landing pages and conversions
- Know what a good landing page does
- Audit a page by program
- Compare two pages without being fooled by luck
About 22 minutes
Two pages, one advert
Noor sends the same advert to two different pages on her site, half the visitors to each, over a few weeks. Page A is her home page, with a welcome message, her story, three buttons and a long form. Page B is a simple page made for the advert, with one clear headline, one photo and a short signup form. When she compares the results, page B does more than twice as well. The only difference was the page. A landing page is the page a visitor arrives on after clicking an advert, a link or a post. Its job is to get one thing done, which is called a conversion: a signup, a purchase or a message.
What a good landing page does
- Matches the promise. The headline repeats what the advert or link said.
- Has one goal. One main button, one main action, not three competing ones.
- Asks for little. Each extra form field gives people a reason to leave. Ask only what you need.
- Shows proof. A review, a number, a photo that backs up the claim.
- Works on a phone. Most visits come from phones, so test it on one.
- Is accessible. Images have short alternative text so people using screen readers know what they show.
Audit a page with a program
The program below reads the HTML of two pages, using a standard tool for parsing web pages, and counts the things that matter: headings, calls to action, form fields and images without descriptions. Then it compares the results of the two pages with a made-up test of 800 visitors each, and works out a range around each conversion rate. A single measured rate is only an estimate, and the range shows how much it could wobble by chance. The 95 per cent range here is a standard rule of thumb for this kind of estimate.
import math
from bs4 import BeautifulSoup
PAGE_A = """<html><body><h1>Welcome</h1><h1>Our story</h1>
<a class="btn" href="/shop">Shop</a><a class="btn" href="/blog">Read</a><a class="btn" href="/about">About</a>
<img src="a.jpg"><form><input name="n"><input name="e"><input name="p"><input name="a">
<input name="c"><input name="z"><input name="m"></form></body></html>"""
PAGE_B = """<html><body><h1>Calm evenings for busy mums</h1><p>Hand-poured candles, 40 hours of burn time.</p>
<img src="a.jpg" alt="A lit candle on a shelf"><form action="/join"><input name="email" type="email">
<input name="first"><button>Get 10% off</button></form></body></html>"""
def audit(html):
s = BeautifulSoup(html, "html.parser")
fields = len(s.find_all("input"))
buttons = len(s.find_all(class_="btn")) + len(s.find_all("button"))
noalt = sum(1 for i in s.find_all("img") if not i.get("alt"))
return {"h1": len(s.find_all("h1")), "calls to action": buttons, "form fields": fields, "images without alt": noalt}
for name, page in (("A", PAGE_A), ("B", PAGE_B)):
r = audit(page)
print(f"page {name}: " + ", ".join(f"{v} {k}" for k, v in r.items()))
def interval(wins, n):
p = wins / n
h = 1.96 * math.sqrt(p * (1 - p) / n)
return p, max(0, p - h), p + h
for name, wins, n in (("A", 24, 800), ("B", 52, 800)):
p, lo, hi = interval(wins, n)
print(f"page {name}: {100 * p:.1f}% (range {100 * lo:.1f}-{100 * hi:.1f})")
a, b = interval(24, 800), interval(52, 800)
print("ranges overlap:", a[2] >= b[1])
page A: 2 h1, 3 calls to action, 7 form fields, 1 images without alt
page B: 1 h1, 1 calls to action, 2 form fields, 0 images without alt
page A: 3.0% (range 1.8-4.2)
page B: 6.5% (range 4.8-8.2)
ranges overlap: False
Page A has two main headings, three calls to action, seven form fields and an image with no alternative text. Page B has one heading, one call to action, two form fields and a described image. In the test, page A converted 3.0 per cent, with a range from 1.8 to 4.2. Page B converted 6.5 per cent, with a range from 4.8 to 8.2. The last line says the ranges do not overlap, so the gap is unlikely to be luck. That is a reason to believe the difference, not a promise it will always hold. If the ranges had overlapped, the right answer would be: we do not know yet, collect more visitors.
Test one change at a time
- Pick the one thing you suspect is hurting conversion, such as a long form.
- Make a version with just that change.
- Send equal numbers of visitors to each version at the same time.
- Wait until you have enough visitors that the ranges are narrow. A handful of visits proves nothing.
- Keep the winner, then try the next idea.
Declaring a winner after twenty visitors. Small numbers swing wildly. If page B gets 3 sales and page A gets 1, that tells you almost nothing. Wait for a sample large enough to trust.
This is a simple range, good for learning. For serious testing, use the calculator or testing tool you trust and plan the sample size in advance. Never let a test run past your agreed stop point just to chase a win.
Practice for this lesson
Check what you learned
Five quick questions. Pick an answer and you will see straight away whether it is right and why.
What is a landing page?
- Your site’s footer
- A type of advert
- A password page
- The page a visitor arrives on after a click
It is the first page visitors see from a link or advert.
What is a conversion?
- A page view
- The action you want, such as a signup or purchase
- A like
- A photo
A conversion is the single action the page aims for.
Why ask for fewer form fields?
- Fields are illegal
- Forms are slow
- Search engines dislike them
- Each extra field gives a reason to leave
Shorter forms ask for less effort.
In the sample, did the ranges overlap?
- No, so luck is an unlikely reason
- Yes completely
- Only for page A
- They were not measured
Page B’s range sat above page A’s.
What if the ranges overlapped?
- Pick page B anyway
- Stop testing
- Collect more visitors before deciding
- Double the budget
Overlap means you cannot tell yet.
Summary
- A landing page has one job and one main action.
- Ask for little and show proof.
- A single conversion rate is an estimate with a range.
- Test one change at a time with enough visitors.
Questions
How many visitors do I need for a test?
It depends on your conversion rate and how big a difference you want to detect. Plan this before you start, and do not stop early because one version looks ahead.
Does alternative text matter?
Yes. It helps people who use screen readers and shows when an image does not load. Write a short, plain description of what the image shows.
Are the visitor numbers real?
No. They are made up to show the method. Use your own data.
