Website Analytics

How to Track Website Visitors

What tracking visitors actually involves, which numbers to start with, how to install a tracking script and the mistakes that make your data unreliable.

Illustration of a website analytics chart

Most people start tracking visitors for a simple reason: they want to know if anyone is reading. A few weeks later the questions get sharper. Which pages bring people in? Where do they come from? Did last month's campaign do anything?

Answering those questions doesn't require a complicated setup. It does require setting things up carefully once, so the numbers you look at later can be trusted.

What "tracking visitors" really means

When a page loads, a small script (or the server itself) records that a visit happened, along with a few details: which page was opened, which page or site sent the person there, the type of device, the approximate country and the time.

From those records, an analytics tool builds the numbers you see in reports:

  • Visitors: an estimate of how many different people came to the site.
  • Sessions (or visits): how many times people came. One person can make several sessions.
  • Pageviews: how many pages were opened in total.
  • Entry pages: the first page of each session, which tells you what is attracting people.
  • Sources: where the session started, such as a search engine, an ad, another website or a typed address.

Keep in mind that "visitors" is always an estimate. The same person on a phone and a laptop usually counts as two. Someone who clears cookies or blocks scripts may not be counted at all. That is fine, as long as you use the numbers to compare periods and spot changes, not as an exact headcount.

Step 1: decide what you want to learn

Before installing anything, write down two or three questions you want answered. For example:

  1. How many people visit each week, and is that going up or down?
  2. Which pages do they land on first?
  3. How much of the traffic comes from search engines, from ads and from social media?

This list keeps you from drowning in reports later. Most tools show dozens of metrics. You only need the ones that answer your questions. We go deeper into this in Website Analytics Metrics That Actually Matter.

Step 2: install the tracking code on every page

Almost every analytics tool works the same way: you add a short snippet to the <head> section of your site. Some practical notes:

  • Use a template, not individual pages. In WordPress, Shopify, Wix and most site builders, there is a place for header code or a plugin that adds it to every page. If you paste the snippet on just one page, you'll only measure that page.
  • Include checkout and thank-you pages. These are often hosted in a different template or even on a different domain, and they are exactly the pages you'll want to measure later.
  • Install it once. A snippet added twice (for example, by a plugin and by hand) counts every pageview twice. If your numbers look suspiciously high, check for this first.

Step 3: check that it's working

After installing, open your site in a private browser window and visit two or three pages. Then:

  • Look at the real-time or "today" view of your analytics tool and confirm the visit appeared.
  • Open the browser's developer tools (Network tab) and check that the tracking request was sent without errors.
  • Test on a phone too, using mobile data rather than your office Wi-Fi.

If nothing shows up, the usual causes are a cache plugin serving old pages, a consent banner blocking the script until someone accepts, or the snippet placed inside a section that isn't rendered on every page.

Step 4: exclude your own visits

Your team opens the site every day. On a small website, that alone can distort the numbers. Most tools let you exclude visits by IP address or with a browser setting. Do this early, because you can't remove internal visits from data that was already collected.

Step 5: tag your campaigns

If you send newsletters, publish on social media or run ads, add UTM parameters to the links. Without them, a lot of campaign traffic ends up labeled as "direct" or as a generic social visit, and you can't tell one campaign from another. Our guide on how to use UTM parameters explains how to build them consistently.

Step 6: write down what you change

This is the step most people skip. Numbers tell you that something changed; they rarely tell you why. Keep a simple dated log: "March 4 – new homepage", "March 12 – started Google Ads, 20 USD/day", "March 20 – published pricing guide". When traffic moves, check the log first.

You can do this in a spreadsheet. In WEBPilot, it's built in: the strategy timeline keeps those notes next to each website.

Common mistakes

Changing the setup without noting it. Switching analytics tools, changing the consent banner or moving to a new domain can all create a sudden jump or drop that has nothing to do with real visitors. Note the date.

Comparing different period lengths. A 31-day month will usually show more visits than a 28-day month. Compare equal periods, and compare the same days of the week when possible.

Looking only at totals. A stable total can hide a big shift underneath, such as search traffic falling while paid traffic rises. Always look at sources too. Our article on understanding traffic sources shows how.

Ignoring privacy rules. Depending on where your visitors are, laws such as the GDPR in Europe or the LGPD in Brazil may require consent before certain cookies are set. Choose a setup that collects only what you need and check what applies to your business.

A simple routine to start

Once tracking is running, a weekly 15-minute check is enough for most small sites:

  1. Compare this week's visits with last week's and with the same week last month.
  2. Look at the top five entry pages. Did any new page appear?
  3. Look at sources. Did any of them change much?
  4. Check your log of changes and add anything new.

After a couple of months, you'll know what a normal week looks like, and that is what makes unusual weeks easy to spot.


WEBPilot articles are written and reviewed by our editorial team. They don't contain sponsored content.

Put this into practice

Register your websites in WEBPilot and keep a dated record of every change you make. Strategy Tracking →

Related articles

← Back to all articles