Web Analytics Basics: Understanding User Behavior
The basics of web analytics: how Google Analytics 4 measures a site with events, users, sessions, engagement and key events, how UTM tags attribute traffic, and what 12,330 real shop sessions reveal about browsing depth, new versus returning visitors and page value, including two numbers that mislead if read naively.
GloryTecks Team
Training & Placement Faculty
Last updated: 25 September 2026
Web analytics measures how people find a website and what they do once they arrive. It answers practical questions: which channels bring visitors who buy, which pages lose people, and whether a redesign helped. The numbers are easy to collect and easy to misread. This guide covers how modern analytics tools measure a site, using Google Analytics 4 (GA4) definitions, then reads real session data to show where naive interpretation goes wrong.
How GA4 measures a website
GA4 records everything as events. An event measures a specific interaction or occurrence, such as a page view, a scroll, a file download or a purchase. Some events are collected automatically, some through enhanced measurement, and others are implemented by the site, either with Google's recommended names or as custom events (GA4: about events). Events are grouped into sessions, and sessions belong to users.
| Metric | What it counts |
|---|---|
| Users | Distinct people, as far as the tool can identify them, usually by browser or device |
| Sessions | Visits: groups of events from one user in a period of activity |
| Engaged session | A session lasting over 10 seconds, with a key event, or with two or more page views (GA4: engagement rate) |
| Engagement rate | Share of sessions that were engaged |
| Bounce rate | Share of sessions that were not engaged |
| Key event | An event marked as particularly important to the business, such as a purchase or a sign-up (GA4: key events) |
"Users" deserves caution. The same person on a phone and a laptop usually counts as two users, and clearing cookies creates a new one.
Where visitors come from: UTM tags
GA4 classifies traffic sources automatically, but campaigns need help. Adding UTM parameters to the links in emails, ads and social posts, at minimum utm_source, utm_medium and utm_campaign, records which campaign sent each visitor, visible in the traffic acquisition report (GA4: URL builders). A link ending in ?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale separates the spring newsletter from every other email. Agree on lower-case naming rules, because Email and email become two different mediums.
Reading behaviour data: 12,330 real sessions
The Online Shoppers Purchasing Intention dataset records 12,330 sessions on an online shop, 1,908 of which ended in a purchase, with page counts, visitor type and metrics measured by Google Analytics (UCI: Online Shoppers Purchasing Intention). First, how conversion varies with browsing depth:
import io
import urllib.request
import zipfile
import pandas as pd
url = "https://archive.ics.uci.edu/static/public/468/online+shoppers+purchasing+intention+dataset.zip"
sessions = pd.read_csv(zipfile.ZipFile(io.BytesIO(urllib.request.urlopen(url).read())).open("online_shoppers_intention.csv"))
sessions["pages"] = sessions["Administrative"] + sessions["Informational"] + sessions["ProductRelated"]
sessions["pages viewed"] = pd.cut(sessions["pages"], [-1, 1, 5, 20, 1000], labels=["0-1", "2-5", "6-20", "21+"])
print(sessions.groupby("pages viewed", observed=True)["Revenue"].agg(sessions="size", conversion="mean").round(3).to_string()) sessions conversion
pages viewed
0-1 603 0.013
2-5 1456 0.041
6-20 4192 0.124
21+ 6079 0.218Sessions with one page or none almost never convert; sessions with more than 20 pages convert at 21.8%. That does not mean forcing people to view more pages would raise sales: people who intend to buy browse more. Depth is a symptom of intent, useful for spotting where engaged visitors leave, not a lever to pull directly.
New versus returning visitors: a session trap
print(sessions.groupby("VisitorType")["Revenue"].agg(sessions="size", conversion="mean").round(3).to_string()) sessions conversion
VisitorType
New_Visitor 1694 0.249
Other 85 0.188
Returning_Visitor 10551 0.139New visitors' sessions convert at 24.9%, returning visitors' at 13.9%. Read naively, that says new visitors are better customers. But these are session rates. A returning visitor who researches on three visits and buys on the fourth contributes one purchase and four sessions, a 25% session conversion rate for a person who did buy. Loyal browsers generate many sessions, which dilutes the rate. Whenever a metric could be computed per session or per user, ask which one the question needs; for "are returning visitors valuable?", the answer needs purchases per user over time, which session data alone cannot give.
Page value: a metric that already knows the answer
sessions["saw valued page"] = sessions["PageValues"] > 0
print(sessions.groupby("saw valued page")["Revenue"].agg(sessions="size", conversion="mean").round(3).to_string()) sessions conversion
saw valued page
False 9600 0.039
True 2730 0.563Sessions that included a page with a page value convert at 56.3%, against 3.9% for the rest. Impressive, until you read the definition: page value is the average value of a page that users visited before completing a transaction (UCI: Online Shoppers Purchasing Intention). It is computed from purchases, so pages on the path to checkout have it by construction. The metric is useful for ranking which pages lead towards purchases, but it cannot be used as evidence that those pages cause buying, or as an input to predict purchases fairly.
Bounce rate has changed meaning
This dataset's bounce rate follows the older Google Analytics definition: visitors who entered on a page and left without triggering any other request. GA4 redefined bounce rate as the share of sessions that were not engaged, so a visitor who reads one article for two minutes bounced under the old definition but not under the new one. Never compare bounce rates across tools or versions without checking the definition, and prefer engagement rate in GA4.
Data quality habits
- Filter internal traffic and known bots, which inflate sessions and distort engagement.
- Expect gaps. Consent choices, ad blockers and browser privacy features mean analytics tools see only part of the traffic. Reconcile purchases against the order system.
- Annotate changes such as site releases, tracking changes and campaigns, so trend breaks can be explained.
- Segment before concluding. Device, traffic source and new versus returning often behave completely differently.
For the full path from visit to purchase, funnel analysis builds a step-by-step funnel on the same sessions, and marketing analytics metrics compares traffic sources by conversion. Product analytics 101 covers following identified users over time, which answers the questions session data cannot.
Is Google Analytics the only web analytics tool?
What is a good engagement rate?
Why do GA4 numbers differ from my sales system?
What should a beginner look at first?
Web analytics and dashboard reporting build on the data visualisation material in the Data Analytics course.
Sources
- GA4: About events (Analytics Help) — Google Analytics Help
- GA4: Engagement rate and bounce rate (Analytics Help) — Google Analytics Help
- About key events (Analytics Help) — Google Analytics Help
- URL builders: Collect campaign data with custom URLs (Analytics Help) — Google Analytics Help
- Online Shoppers Purchasing Intention Dataset (UCI Machine Learning Repository) — UCI Machine Learning Repository
GloryTecks Team
Training & Placement Faculty
The GloryTecks faculty team mentors learners across Data Science, AI and Data Engineering, with a focus on real-time projects and placement readiness in Hyderabad.
Want to master Data Analytics?
Join GloryTecks’ expert-led Data Analytics training in Hyderabad with real-time projects and 100% placement support.
Related articles
Business Analytics Explained: A Beginner's Guide
Business analytics explained for beginners: what it is for, the four types of analytics and the business question each answers, the process that turns a question into a decision, the roles and tools involved, and a worked example on a real online shop's sales that goes from what happened to why it happened.
Data Analyst Roadmap 2026: Skills, Tools and Timeline
A data analyst roadmap for 2026: the six stages to learn in order, from spreadsheets and SQL to BI tools, statistics and communication, what each stage should let you do, a realistic part-time timeline, a project that proves each stage, and how to tell when you are ready to apply for analyst roles.
Excel vs Power BI: Which Should You Learn First?
Should you learn Excel or Power BI first? For most beginners, a slice of Excel first, then Power Query and the data model, which Excel and Power BI share, and then Power BI. Here is why, what each tool teaches on its own, and which to start with in your situation.