Sub topic 10
Measuring the Hub: Analytics, Goals and KPIs
This chapter explains how to measure what happens on your website. It covers the data a web analytics tool collects, how to turn business goals into measurable events, how to choose KPIs, and how to read the reports without misleading yourself.
Prerequisites
This chapter assumes you know the following:
- The hub-and-spoke model: the website is the hub, and channels such as search, social and email are spokes that send visitors to it.
- The difference between owned, paid and earned media.
- What a UTM parameter is. The previous chapter showed how to tag campaign links so traffic sources can be told apart.
- The customer journey stages: awareness, consideration and decision.
You do not need to write code. The short examples are explained as they appear.
Why measurement belongs at the hub
Most spokes report only their own numbers. An ad platform reports impressions and clicks. An email tool reports opens. None of them can tell you what visitors did after they arrived on your site. The website is the one place where you can see the whole path, from the first visit through to a form submission or purchase.
A web analytics tool is software that records visits and actions on your site and turns them into reports. Common examples are Google Analytics 4 (GA4), Matomo and Plausible. The concepts in this chapter apply to all of them, though the names of some features differ.
What analytics tools actually record
Analytics tools record events. An event is a single thing a visitor did, such as loading a page, clicking a link or submitting a form. Each event has a name, a time, and extra details called parameters, for example the page address or the button label.
Events are grouped into larger units:
| Term | Meaning | Example |
|---|---|---|
| User | A person, usually identified by a cookie or device identifier | One browser on one laptop |
| Session | A group of events by one user in a continuous period | A visit that lasts 6 minutes |
| Event | A single action | `page_view`, `form_submit` |
| Conversion | An event you have marked as valuable | A completed newsletter signup |
Two limits matter from the start.
- Users are approximate. If the same person visits from a phone and a laptop, most tools count two users. If a visitor clears cookies or declines tracking, they may be counted again or not at all.
- Definitions differ between tools. A "session" in one tool may end after 30 minutes of inactivity, and another tool may use a different rule. Do not compare raw numbers across tools without checking the definitions.
How the data gets there
A small piece of JavaScript, often called a tag, is added to every page. When a visitor loads the page, the tag sends a record to the analytics service. The tag also reads the URL. That is how the UTM parameters you added to campaign links are picked up.
Look again at the tagged link from the previous chapter:
https://www.example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring_saleWhen someone clicks it, the analytics tag reads utm_source, utm_medium and utm_campaign and stores them with the session. In your reports, that visit is attributed to the newsletter source, the email medium and the spring_sale campaign. Without those parameters, the visit might be filed under "direct" or "referral", and you would lose the link between the campaign and the result.
From business objective to goal
A goal is a specific visitor action that signals progress toward a business objective. In GA4 these are called key events (previously conversions). Start from the objective, then pick the action that shows it is happening.
Work through three questions for each page or campaign:
- What do we want the business to achieve? For example, more qualified leads.
- What visitor action shows that? For example, submitting the lead form.
- Can the tool detect that action reliably? For example, by loading a thank-you page or firing a
generate_leadevent.
Here is the lead capture form from the Topic Spine. It asks for one field and the button states the benefit.
<form action="/subscribe" method="post">
<label for="email">Email address</label>
<input id="email" name="email" type="email" required>
<button type="submit">Get the free guide</button>
</form>You can measure this form in two common ways.
- Destination goal. After a successful submission, the server sends the visitor to a page such as
/thank-you. You mark visits to that page as a conversion. This is simple and robust, because the thank-you page loads only after the submission succeeds. - Event goal. The page runs a small script that sends a named event, such as
generate_lead, when the form is submitted. This works without a thank-you page but can overcount if the event fires before the server accepts the data.
Prefer the destination approach when you can. If you use events, fire them only after the server confirms success.
Macro and micro conversions
A macro conversion is the main outcome you want, such as a purchase or a lead. A micro conversion is a smaller step that suggests interest, such as watching a product video, downloading a price list or reaching the pricing page. Micro conversions are useful because macro conversions are rare. A site with 10,000 visits and a 1% lead rate gives you only 100 leads to analyze. Micro conversions give you more data points to spot where visitors lose interest.
Keep the list short. If you mark every click as a conversion, the conversion count stops meaning anything.
Metrics, KPIs and the difference
A metric is any number you can measure. A KPI (key performance indicator) is a metric you have chosen because it tracks progress toward a specific objective. You may have dozens of metrics but should have only a handful of KPIs.
The table below links journey stages to typical KPIs.
| Journey stage | Question | Example KPIs |
|---|---|---|
| Awareness | Are the right people finding us? | Sessions from organic search, new users, share of traffic by channel |
| Consideration | Are they engaging? | Engaged sessions, pages per session, return visits, micro conversions |
| Decision | Are they acting? | Conversion rate, leads, purchases, revenue |
| After the sale | Do they stay? | Repeat purchase rate, newsletter retention |
Common rates and how to calculate them
A rate divides a count of outcomes by a count of opportunities. State both the numerator and the denominator, because the same word can hide different formulas.
- Conversion rate = conversions ÷ sessions (or ÷ users). If 40 leads come from 2,000 sessions, the rate is 2%.
- Click-through rate (CTR) = clicks ÷ impressions. This is measured on the spoke, for example in a search ad.
- Cost per lead (CPL) = campaign spend ÷ leads from that campaign. If you spend 600 and get 40 leads, CPL is 15.
- Return on ad spend (ROAS) = revenue from the campaign ÷ spend on it.
The short script below calculates these values from campaign totals. It runs as shown with any recent Python 3.
def safe_div(numerator, denominator):
return numerator / denominator if denominator else 0.0
campaigns = [
{"name": "spring_sale_email", "sessions": 2000, "leads": 40, "spend": 600.0, "revenue": 2400.0},
{"name": "spring_sale_search", "sessions": 1500, "leads": 15, "spend": 900.0, "revenue": 1350.0},
]
for c in campaigns:
conversion_rate = safe_div(c["leads"], c["sessions"])
cpl = safe_div(c["spend"], c["leads"])
roas = safe_div(c["revenue"], c["spend"])
print(f'{c["name"]}: conv rate {conversion_rate:.1%}, CPL {cpl:.2f}, ROAS {roas:.2f}')The output is:
spring_sale_email: conv rate 2.0%, CPL 15.00, ROAS 4.00
spring_sale_search: conv rate 1.0%, CPL 60.00, ROAS 1.50In this example, email produces cheaper leads and a higher return. That does not prove email is a better channel in general. Search ads may reach new audiences that email cannot, so the two serve different journey stages. Compare channels against their own role, not only against each other.
Reading the standard reports
Most analytics tools provide the same core reports. Learn to answer one question with each.
- Acquisition. Which source, medium and campaign brought visitors? This is where your UTM tags pay off.
- Engagement or behavior. Which pages do visitors view, and how long do they stay engaged?
- Conversions. Which goals were completed, and from which sources?
- Audience. Which countries, devices and new or returning groups are present?
The most useful move is to combine two views, such as conversion rate by source and device. A total conversion rate of 2% might hide a mobile rate of 0.5% and a desktop rate of 3.5%. That gap points to a mobile design or speed problem, linking back to the technical foundations chapter.
Bounce rate and engagement rate
Older tools reported bounce rate, the share of sessions with only one page view. GA4 replaced it with engagement rate, the share of sessions that lasted longer than 10 seconds, had a conversion event, or had at least two page views. Bounce rate in GA4 is simply the opposite: 100% minus engagement rate.
A high bounce rate is not always bad. A visitor who reads a blog post, finds the answer and leaves has had a good experience, though your site recorded no further action. Judge it in context, by page type and by intent.
Attribution: which spoke gets the credit?
A visitor might first find you through a social post, return via a search ad, and finally convert from an email. Attribution is the rule that decides which of those touchpoints gets credit for the conversion.
Common models are:
- Last click: all credit goes to the final touchpoint.
- First click: all credit goes to the first touchpoint.
- Linear: credit is split evenly across touchpoints.
- Data-driven: a statistical model assigns credit based on observed patterns. This needs enough conversion volume to work.
Last-click attribution tends to favor channels near the end of the journey, such as branded search and email. It undervalues awareness channels. Pick one model for routine reporting, state it in every report, and compare a second model when you decide how to move budget.
Common errors
These mistakes appear often and are worth checking for first.
- Missing or inconsistent UTM tags.
utm_medium=Emailandutm_medium=emailappear as separate rows in many tools. Agree on lowercase names and keep a shared list. - Tagging internal links. Adding UTM parameters to links between pages of your own site can overwrite the original source and start a new session. Use UTM tags only on links that bring people to the site.
- Counting your own team. Internal traffic inflates sessions and can distort conversion rates on small sites. Exclude office IP addresses or use the tool's internal traffic filter.
- Duplicate tags. If the analytics tag loads twice, every page view is counted twice. Check with your browser's developer tools or a tag debugging extension.
- Goals that fire on page load. A conversion tied to the form page rather than the confirmation page counts everyone who viewed the form.
- Judging too soon. Daily numbers vary. Wait for a full cycle, such as a week or a business month, before drawing conclusions.
- Ignoring missing data. Visitors who decline cookies, use blockers or switch devices are not fully counted. Treat the numbers as a consistent sample, not a perfect census. The next chapters on privacy and consent cover this further.
Setting a baseline and targets
A KPI is only useful when you know what normal looks like. Before changing anything:
- Record the current value of each KPI over at least four weeks.
- Note seasonal effects, such as a sale or holiday, that make that period unusual.
- Set a target that is specific and has a date, such as "raise the lead conversion rate on the guide page from 2.0% to 2.5% within eight weeks".
- Record the date of each major site change, campaign launch or tracking change, so you can explain shifts later.
A simple KPI dashboard layout
A dashboard should answer a few questions at a glance. A workable layout for a small marketing site has four blocks:
- Traffic: sessions and new users by channel, compared with the previous period.
- Engagement: engagement rate and top landing pages.
- Outcomes: conversions, conversion rate, and CPL or revenue where relevant.
- Quality checks: share of traffic labeled "unassigned" or "direct", which is a warning sign for missing UTM tags.
Compare to the previous period and, where you have the data, the same period last year. A rise in sessions with a falling conversion rate may mean a new campaign is attracting less relevant visitors.
Summary of the working model
Events are recorded by a tag on each page. UTM parameters tell the tool where the visitor came from. You mark the few events that match business objectives as conversions, and you choose a short list of KPIs tied to journey stages. You read them by segment, with a stated attribution model, against a baseline. The result feeds the final chapters on privacy and the measure, test and improve cycle.
Exercise
An email campaign sends 4,000 sessions to your site and produces 60 leads. The campaign cost 900. (a) Calculate the conversion rate and the cost per lead. (b) A colleague reports that the conversion rate is 3% because 120 sessions reached the thank-you page. Give two possible reasons for the difference and say how you would check each.
Show answer
(a) Conversion rate = 60 ÷ 4,000 = 1.5%. Cost per lead = 900 ÷ 60 = 15. (b) The 3% figure comes from 120 ÷ 4,000. Possible reasons: the thank-you page counts page views rather than unique submissions, so refreshes or revisits are counted more than once (check by counting unique users or by comparing with the form submissions stored in the CRM); or the analytics tag fires twice on that page (check with a tag debugging tool and compare event counts to page view counts). A third possibility is that the 120 includes visitors from other sources, so filter the report to the campaign's source, medium and campaign values first.
Exercise
Your overall conversion rate is steady at 2%, yet leads have fallen. Name two analyses in your analytics tool that could explain this and what each would show.
Show answer
First, compare sessions by channel over time. If sessions from a high-converting channel such as email have fallen while low-converting traffic has grown, the blended rate can stay at 2% while the total number of leads changes. Second, segment conversion rate by device or landing page. A drop on one segment may be hidden by a rise in another. Check also the share of unassigned traffic, since lost UTM tags could move leads to the wrong row.