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

6 May 2026 5 min read

Last updated: 25 September 2026

Share:

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.

MetricWhat it counts
UsersDistinct people, as far as the tool can identify them, usually by browser or device
SessionsVisits: groups of events from one user in a period of activity
Engaged sessionA session lasting over 10 seconds, with a key event, or with two or more page views (GA4: engagement rate)
Engagement rateShare of sessions that were engaged
Bounce rateShare of sessions that were not engaged
Key eventAn 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:

python
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())
text
              sessions  conversion
pages viewed                      
0-1                603       0.013
2-5               1456       0.041
6-20              4192       0.124
21+               6079       0.218

Sessions 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

python
print(sessions.groupby("VisitorType")["Revenue"].agg(sessions="size", conversion="mean").round(3).to_string())
text
                   sessions  conversion
VisitorType                            
New_Visitor            1694       0.249
Other                    85       0.188
Returning_Visitor     10551       0.139

New 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

python
sessions["saw valued page"] = sessions["PageValues"] > 0
print(sessions.groupby("saw valued page")["Revenue"].agg(sessions="size", conversion="mean").round(3).to_string())
text
                 sessions  conversion
saw valued page                      
False                9600       0.039
True                 2730       0.563

Sessions 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?

No. Alternatives include privacy-focused tools and self-hosted platforms. The concepts of events, sessions, sources and key events carry over, though definitions differ in detail.

What is a good engagement rate?

It varies by site type and traffic source. Track your own trend and compare segments, rather than relying on outside benchmarks.

Why do GA4 numbers differ from my sales system?

Consent choices, ad blockers, tracking errors and different attribution and time zone settings all cause gaps. Treat the order system as the source of truth for revenue.

What should a beginner look at first?

Traffic by source and medium, engagement rate by landing page, and key events by source. Those three answer where visitors come from, whether they engage, and whether they act.

Web analytics and dashboard reporting build on the data visualisation material in the Data Analytics course.

Sources

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.

Explore course