IntermediateLesson 17 of 305 min read

Analytics and KPIs: Measure What Matters

Learn the main Google Analytics 4 ideas, compute engagement and key event rates by channel, and see how a total can point the wrong way until you split it, with a worked example.

In this lesson you will

  • Explain sessions, events and key events
  • Work out engagement rate and revenue per session
  • Pick a few KPIs that drive decisions
  • Spot a reversal when a total hides a mix

About 25 minutes

Which numbers deserve a place on the dashboard?

Noor connects free analytics to her shop and is faced with dozens of reports. Visitors, sessions, pages per session, bounce rate, events, sources. She feels busy and learns nothing. A good measurement habit has two parts: choose a few numbers that connect to decisions, and read them carefully, because even correct numbers can mislead. This lesson explains the main ideas in Google Analytics 4, which the free tool from Google uses, and shows how an innocent-looking comparison can point the wrong way.

The ideas that matter

  • Session. One visit, from arrival to leaving or going quiet.
  • Event. Anything the tool records, such as a page view, a click or a purchase.
  • Key event. An event you mark as important to your business. Google’s tool used to call these conversions.
  • Engaged session. According to Google’s definition, a session that lasted 10 seconds or longer, or had a key event, or had at least two page or screen views.
  • Engagement rate. Engaged sessions divided by all sessions. Bounce rate is the opposite: the share that were not engaged.

Menus and names in analytics tools change, so check the current help pages. The ideas stay the same: count the visits, decide what counts as success, and compare groups fairly.

Compute the numbers yourself

The program below takes 240 made-up sessions from three channels. For each session it decides whether it was engaged, using Google’s three rules, and then works out the engagement rate, the key event rate, and revenue per session for each channel. A key event here is a purchase worth 18 pounds. It also shows the overall bounce rate.

import pandas as pd

# MADE-UP sessions: duration in seconds, page views, key event (0 or 1), revenue
rows = []
for ch, n in (("email", 60), ("search", 80), ("social", 100)):
    for i in range(n):
        dur = (i * 7) % 40 + (3 if ch == "email" else 0)
        pages = 1 + (i % 3 == 0) + (i % 5 == 0)
        key = int(i % {"email": 6, "search": 10, "social": 25}[ch] == 0)
        rows.append({"channel": ch, "dur": dur, "pages": pages, "key": key, "rev": 18.0 * key})
df = pd.DataFrame(rows)
df["engaged"] = (df.dur >= 10) | (df.pages >= 2) | (df.key == 1)
g = df.groupby("channel").agg(sessions=("dur", "size"), engaged=("engaged", "sum"), hits=("key", "sum"), rev=("rev", "sum"))
for ch, r in g.iterrows():
    print(f"{ch}:")
    print(f"  engagement rate {100 * r.engaged / r.sessions:.0f}%")
    print(f"  key event rate {100 * r.hits / r.sessions:.1f}%")
    print(f"  revenue per session {r.rev / r.sessions:.2f}")
print("bounce rate overall:", round(100 * (1 - df.engaged.mean())), "%")

# the same two channels, split by device
data = {("email", "mobile"): (800, 32), ("email", "desktop"): (200, 20),
        ("social", "mobile"): (200, 6), ("social", "desktop"): (800, 64)}
for ch in ("email", "social"):
    s = sum(data[(ch, d)][0] for d in ("mobile", "desktop"))
    o = sum(data[(ch, d)][1] for d in ("mobile", "desktop"))
    print(f"{ch} overall: {100 * o / s:.1f}%")
for d in ("mobile", "desktop"):
    for ch in ("email", "social"):
        s, o = data[(ch, d)]
        print(f"{d} {ch}: {100 * o / s:.1f}%")
email:
  engagement rate 92%
  key event rate 16.7%
  revenue per session 3.00
search:
  engagement rate 88%
  key event rate 10.0%
  revenue per session 1.80
social:
  engagement rate 87%
  key event rate 4.0%
  revenue per session 0.72
bounce rate overall: 12 %
email overall: 5.2%
social overall: 7.0%
mobile email: 4.0%
mobile social: 3.0%
desktop email: 10.0%
desktop social: 8.0%

Email shows an engagement rate of 92 per cent and social 87, which looks like a small difference, and the real gap is in what happens next. The key event rate is 16.7 per cent for email and 4.0 for social, and the revenue per session is 3.00 pounds against 0.72. Overall 12 per cent of sessions were not engaged. Engagement is a useful health check, and revenue per session tells you what the channel is worth.

When the total lies

The last block in the output is a warning. Overall, social looks better than email: 7.0 per cent of sessions buy, against 5.2 per cent. But look at the devices. On mobile, email converts at 4.0 per cent and social at 3.0. On desktop, email converts at 10.0 and social at 8.0. Email wins on both devices, and loses overall. The reason is the mix: email sends most of its visitors to mobile, where everyone converts less, and social sends most to desktop. This effect is called Simpson’s paradox. It is a reminder to split a headline number by an obvious factor, such as device, new versus returning, or location, before you decide that one channel is better.

  1. Pick three to five measures that connect to decisions, such as sessions, engagement rate, key event rate and revenue per session.
  2. Mark your real goals, such as a purchase or a signup, as key events.
  3. Compare channels by revenue per session or per email, not by visits alone.
  4. Split any surprising comparison by device and by new or returning visitors.
  5. Review weekly, write one decision, and ignore the rest.
Common mistake: collecting without deciding

Reading the dashboard as a scoreboard. Numbers do not tell you what to do. They tell you where to look. Every report should end with a question and a decision.

Privacy and gaps

Analytics may need consent from visitors under local privacy rules, and visitors who decline are missing from your numbers. Follow the rules where your visitors live, and treat all figures as estimates.

Choose one comparison you rely on, such as which channel is best. Split it by device. Does the winner stay the same in both halves?

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 an engaged session in Google’s definition?

  1. Any session at all
  2. Only a purchase
  3. 10 seconds or longer, a key event, or two page views
  4. A session with a click

Any one of the three conditions makes a session engaged.

What is a key event?

  1. An event you mark as important to your business
  2. A page title
  3. A visitor
  4. A report

Key events were previously called conversions.

How is bounce rate related to engagement rate?

  1. It is the same
  2. It counts purchases
  3. It is the share that were not engaged
  4. It counts clicks

Bounce rate is the opposite of engagement rate.

What did the sample show about email versus social?

  1. Email won on both devices but lost overall
  2. Social won everywhere
  3. They tied
  4. Email lost everywhere

The mix of devices reversed the overall comparison.

What should you do with a surprising comparison?

  1. Publish it
  2. Split it by an obvious factor like device
  3. Ignore it
  4. Add more channels

Splitting reveals hidden mix effects.

Summary

  • Choose a few measures that connect to decisions.
  • Engaged sessions follow Google’s three rules.
  • Compare channels by value per session, not visits alone.
  • Split surprising totals by device or visitor type.

Next lesson

Lesson 18 covers proper A/B testing.

Questions

Do I need Google Analytics?

No. Other tools exist. The ideas of sessions, events and key events are similar, and the habit of choosing a few measures matters more than the tool.

Are the numbers real?

No. They are made-up sample sessions to show the method.

What is Simpson's paradox?

It is when a trend that holds in every group reverses once the groups are combined, because the groups differ in size or mix. Splitting the data reveals it.

Progress is saved in this browser.