UI/UX Design Basics for MarketersTesting with users and iterating · Lesson 20 of 21

Analytics, heatmaps and A/B testing

Article · 11 min · 9 min lecture

Video lecture

Analytics, heatmaps and A/B testing

13 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 13

Analytics, heatmaps and A/B testing

  • 'Conversion went up!' Compared to what?
  • Right questions for data
  • Tracking, recordings, experiments
  • A reliable improvement cycle

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

Two kinds of evidence

Usability testing tells you why people struggle. Analytics tells you what happens at scale — where people come from, where they drop off, what they click. You need both.

Key analytics for UX

MetricWhat it revealsCaution
Conversion rateShare of visitors completing the goalDepends heavily on traffic quality
Funnel drop-offWhich step loses the most usersNeeds correct event tracking
Engagement/scroll depthHow far people readHigh scroll doesn't mean understanding
Bounce/engagement rateLeaving without interactionDefinitions differ between tools
Device and browser splitWhere problems may be device-specificCheck in-app browsers separately
Traffic source performanceWhich channels bring converting visitorsAttribution is imperfect
Site search termsWhat people can't findGreat source of label ideas
Form analyticsWhich fields cause abandonmentNeed privacy-safe setup

Setting up useful tracking

  • Define conversion events (form submitted, purchase, booking confirmed) and micro-conversions (CTA clicked, pricing viewed, video played).
  • Name events consistently.
  • Tag campaign links (e.g. with UTM parameters) so you know which ad or post drove visits.
  • Respect privacy: follow consent requirements for cookies and tracking (e.g. under GDPR/UK GDPR and applicable local laws), avoid collecting personal data in analytics, and document what you collect.

Heatmaps and session recordings

Behavior analytics tools show:

  • Click maps: where people click — including on things that aren't clickable (a sign of false affordance).
  • Scroll maps: how far people get.
  • Session recordings: individual journeys — helpful for spotting confusion ("rage clicks", back-and-forth).

Use responsibly: mask sensitive inputs, disclose use in your privacy policy, obtain consent where required, and don't record more than you need.

A/B testing basics

An A/B test shows different versions of a page (or element) to randomly split groups of visitors and compares outcomes.

A/B test plan
Hypothesis:  Because [insight], changing [element] to [variant] will improve [metric]
             for [audience].
Example:     Because 4/5 test users missed per-staff pricing, adding a price calculator
             will increase booking-call conversions on mobile.
Primary metric: Booking-call conversion rate
Guardrail metrics: Refund requests, lead quality, page speed
Audience/traffic: Mobile visitors from paid social
Sample size & duration: Calculated in advance; run full weeks
Decision rule: Ship if variant beats control with pre-agreed confidence

A/B testing pitfalls

  • Too little traffic: small sites often can't reach reliable results for small changes. Use qualitative testing and make bolder changes instead.
  • Stopping early: checking results daily and stopping when one version looks ahead inflates false positives. Decide sample size or duration in advance.
  • Testing many things at once without an appropriate design, making results hard to interpret.
  • Ignoring segments and seasonality: results can differ by device, channel or time (e.g. during Ramadan or sales periods).
  • Optimizing the wrong metric: a manipulative change can raise clicks while increasing refunds or complaints — use guardrail metrics.
  • Treating one test as universal truth: results depend on context.

When not to A/B test

  • Fixing obvious usability bugs (just fix them).
  • Accessibility improvements (required, not optional).
  • Very low-traffic pages.
  • Changes that are legally or ethically necessary.

Combining evidence

A reliable improvement cycle:

  1. Analytics shows where the problem is (e.g. 60% drop at step 2 on mobile).
  2. Recordings and usability tests show why (users can't find the delivery date field).
  3. Design a fix based on the insight.
  4. Validate with a quick usability test.
  5. Launch — as an A/B test if traffic allows, otherwise monitor before/after with care.

Worked example: a Dubai e-commerce store

Analytics: mobile checkout conversion far below desktop. Recordings: users repeatedly tapping a tiny promo-code field and leaving to search for codes. Usability test: users felt they were "missing a discount". Fix: collapsed the promo field behind a small "Have a code?" link and showed automatic discounts clearly. A/B test over three full weeks showed improved mobile checkout completion, with no increase in customer service contacts.

Common mistakes

  • Collecting data without clear questions.
  • Tracking without consent where it's required.
  • Running A/B tests on low traffic and trusting noisy results.
  • Using analytics to confirm opinions rather than to learn.

Hands-on: track the events that matter in GA4

Many form and CTA interactions aren't tracked by default. If you use Google Tag Manager, create tags for the events you need; if you add code directly, the pattern with the Google tag (gtag.js) looks like this. Fire events only after the user has given any consent your jurisdiction requires, and never send personal data (names, emails, phone numbers) in event parameters.

<script>
  // CTA click (micro-conversion)
  document.querySelectorAll('[data-cta]').forEach(function (btn) {
    btn.addEventListener('click', function () {
      gtag('event', 'cta_click', { cta_id: btn.dataset.cta, page_type: 'landing' });
    });
  });

  // Successful form submission (conversion) — call this from your form's success handler
  function trackLead(formId) {
    gtag('event', 'generate_lead', { form_id: formId });
  }
</script>

generate_lead is one of GA4's recommended event names; you can mark it as a key event (GA4's term for a conversion) in the admin settings. Then build a Funnel exploration (Explore → Funnel exploration) with steps such as page_view on the landing page → cta_click → generate_lead, and break it down by device category and session source.

Tag your campaign links consistently so traffic sources are clear:

https://example.com/webinar?utm_source=instagram&utm_medium=paid_social&utm_campaign=sep26_webinar&utm_content=story_v2

Hands-on: behavior analytics setup checklist

Tools such as Microsoft Clarity (free), Hotjar or Contentsquare provide heatmaps and session recordings.

[ ] Installed only after consent where required; mentioned in the privacy notice
[ ] Masking enabled for all form inputs and any sensitive text
[ ] Recording retention set to the minimum you need
[ ] Filters saved: device = mobile, source = paid social, page = landing
[ ] Weekly routine: watch 10 recordings of drop-offs; check rage/dead-click reports

Checking an A/B result responsibly

If your testing tool shows a winner, sanity-check it: Did the test run for the pre-set duration in whole weeks? Were the groups similar in size (a large mismatch can signal a setup problem, often called a sample ratio mismatch)? Did guardrail metrics hold? Are results consistent across major segments such as device? When in doubt, re-run or treat the result as a hint, not a fact. The sample-size calculator in the "Landing page UX testing" lesson helps you decide in advance whether a test is feasible.

How to measure success

A good analytics setup is one where you can answer, within minutes, "Where do mobile visitors from paid social drop off, and what did they do just before?" Measure the number of decisions made from evidence each month, the share of tests with pre-registered plans, and the proportion of shipped changes that held their gains after launch.

Summary

Use analytics to find where problems occur, heatmaps and recordings (responsibly) to see behavior, usability tests to understand why, and A/B tests with clear hypotheses, pre-set sample sizes and guardrail metrics to validate changes.

Key takeaways

  • Analytics shows what happens at scale; usability testing shows why.
  • Define conversion and micro-conversion events and respect consent and privacy rules.
  • A/B tests need a clear hypothesis, pre-set sample size or duration and guardrail metrics.
  • Don't A/B test obvious bug fixes or accessibility improvements — just fix them.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. Why shouldn't you stop an A/B test as soon as one version looks ahead?
  2. What is a guardrail metric?
  3. Which change should not be A/B tested but simply implemented?

Put it into practice

Map the funnel for one conversion path using your analytics, find the biggest drop-off, and write an A/B test plan (or a before/after plan if traffic is low) using the template.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.