Questions

Why do my analytics and my server logs disagree?

Analytics and server logs count different things. Analytics counts visits by browsers that loaded and ran a tracking script — and, where consent is required, agreed to it. Server logs count every request that reached the server, including automated clients, and none of the requests a CDN answered from cache. So analytics is usually lower than logs for pages and higher than origin logs for cached sites, and a gap is normal. What deserves attention is a gap that changed suddenly, or analytics figures that look doubled.

Why analytics counts fewer

Visitors who decline consent are, correctly, not measured by a script that waits for consent.

Content blockers and privacy features prevent many tracking scripts from loading at all.

A visitor who leaves before the script runs is never counted, which on a slow page is a meaningful share.

Automated clients — crawlers, monitors, scrapers — mostly do not run scripts, so they appear in logs and not in analytics.

None of these is a malfunction. They are the difference between measuring browsers and measuring requests.

Why origin logs count fewer

A CDN serving a cached page answers the request itself, so the origin server never sees it.

On a well-cached site this can be most requests, which makes origin logs a poor measure of audience.

The CDN's own logs are the ones that see those requests, and they are the fair comparison.

Assets served from another domain never appear in the site's logs at all.

So comparing analytics with origin logs on a cached site compares an audience measure with a cache-miss measure.

When analytics looks too high

The same tracking tag loaded twice — once directly and once through a tag manager — counts every page view twice.

It is one of the most common causes of inflated figures, and it produces a bounce rate that looks implausibly low.

A single-page application sending a view on every route change and again on load can double-count in the same way.

Several teams each adding their own copy of a tag over the years produces the same result more gradually.

This is the gap worth fixing, because it distorts every metric built on page views.

When the gap changes suddenly

A consent banner deployed or reconfigured changes the share of visitors measured overnight.

A tag removed or broken by a template change produces a drop in analytics with no drop in logs.

A CDN introduced or reconfigured changes origin logs without any change in the audience.

A surge of automated traffic raises logs without touching analytics.

Compare the date of the change with your deployment history before assuming the audience moved.

Trackers that load before consent

If analytics figures did not fall when a consent banner was introduced, check whether the script waits for consent at all.

A tag that fires on page load, before any choice is made, measures everyone and ignores the banner.

That produces higher, more complete figures and a compliance problem at the same time.

It is observable from outside: the tracker's requests and cookies appear before any interaction.

Which makes it a question worth settling before trusting any comparison between periods.

Which number to use for what

Analytics for behaviour — which pages people read, where they came from, what they did — accepting that it is a sample of consenting, script-running browsers.

Logs for load and errors — how many requests the infrastructure handled and how many failed.

CDN logs for total demand, including what never reached the origin.

Neither for an exact visitor count, which no method provides.

Frequently asked questions

Which number is the real one?
Neither. Analytics counts consenting browsers that ran a script; logs count requests that reached a server. They answer different questions and are not supposed to agree.
My page views doubled overnight. Why?
The most common cause is the same tag being loaded twice — directly and through a tag manager. Check which trackers the page loads before celebrating.
Why did my analytics drop when nothing changed?
Check whether a consent banner, a template or a tag configuration changed on that date. A measurement change looks exactly like an audience change in the chart.

Sources

Related

VeriFixScan crawls a site and applies its checks to every page it reaches, keeping the evidence behind each finding. Scanning one website is free.

Scan a website