Digital marketing tutorial: measure a campaign funnel without misleading percentages
By Gistmax Tutorials · 2026-11-04
A campaign can attract many visitors and still produce few completed actions. This tutorial builds a small funnel report from fictional counts: landing visits, signup starts and completed signups. You will calculate both step conversion and overall conversion, then explain what the difference means.
1. Define the events before calculating
For this exercise, a visit is one eligible landing-page session, a start is a session that begins the signup form, and a completion is a session that finishes it. Counts must use the same campaign, time window and counting unit. Do not mix page views, unique users and sessions in one funnel.
The sample counts have already been deduplicated and ordered into a funnel. A real event stream needs that preparation first: simply counting every click can include retries or completions that originated outside the campaign.
2. Calculate two kinds of conversion
Save this Python program as `funnel.py` and run it with Python 3.12 or later.
def percentage(numerator, denominator):
return None if denominator == 0 else 100 * numerator / denominator
def funnel(visits, starts, completions):
if any(type(x) is not int or x < 0 for x in (visits, starts, completions)):
raise ValueError("Counts must be non-negative integers")
if not completions <= starts <= visits:
raise ValueError("These counts do not describe a nested funnel")
return {
"visit_to_start": percentage(starts, visits),
"start_to_complete": percentage(completions, starts),
"overall": percentage(completions, visits),
"started_not_completed": starts - completions,
}
report = funnel(1000, 200, 80)
print(report)
assert report["visit_to_start"] == 20
assert report["start_to_complete"] == 40
assert report["overall"] == 8
assert funnel(0, 0, 0)["overall"] is None3. Turn the numbers into a question
The fictional campaign has an 8% overall conversion rate. Of the sessions that started signup, 40% completed it. Those statements use different denominators, so write the denominator beside the percentage in your report.
The 120 unfinished starts suggest a place to investigate, not proof of a particular cause. Check validation errors, page speed and the wording of required fields. Talk to users where appropriate. The numbers alone cannot tell you whether price, trust or an unrelated interruption caused abandonment.
4. Design one follow-up experiment
Choose one measurable change, such as explaining a confusing field. Define the primary outcome before launching and keep the same event definitions. Compare equivalent periods or use a properly assigned experiment; do not announce a winner because a small early sample happens to look better.
The zero-denominator case returns `None`, meaning the rate is unavailable. Showing 0% would incorrectly suggest an observed failure. Your dashboard should display “not enough data” or a similar label instead.
Extension and troubleshooting
Add a second campaign with 50 visits, 15 starts and 6 completions. Its overall rate is 12%, but that small example does not establish that it will outperform the first campaign. Report counts beside rates. If completions exceed starts, inspect event definitions, the reporting window and duplicate events before changing the formula.