Should I count visitors from server logs or server-side events instead of a browser script?

Use a browser script to count people, sources and goals, and keep server logs for traffic to files, APIs and bots. Logs see every request but also record IP addresses and need heavy filtering. PostDeploy counts only through its browser script and does not store IP addresses or user agents. It has no server-side event API.

Last updated 26 November 2026. By Paul Badarau.

A fictional photography portfolio checks one day of traffic. The server log has 9,400 lines. About 6,100 are images, stylesheets and fonts, and about 1,900 come from crawlers, link previews and health checks. That leaves roughly 1,400 requests for pages. The analytics script reports 1,050 pageviews for the same day, and the two tools are measuring different things.

A server log has one line for every request the server answered. It sees visitors whose browsers block scripts or run no JavaScript. It also sees every bot that did not identify itself, and it usually stores each visitor's IP address and user agent. It cannot see route changes inside a single-page app, how long a page stayed visible, or pages that a cache in front of the server answered.

A browser script runs only where a page actually loaded in a browser. The PostDeploy script sends a pageview on each load and each single-page navigation, sends activity signals while the page is visible, and records goals and revenue with postdeploy.track(name, { revenue }). Known bots are excluded by default, and the server does not store IP addresses or user agents.

Choose by the question you need answered:

  • How many times was this file or endpoint requested? Use logs. A PDF fetched straight from a search result never runs a script.
  • Where did visitors come from, and did they sign up? Use the script. It sees the referrer and campaign of the visit and ties goals to them.
  • Do I want to store IP addresses? If not, keep log retention short and count people with the script.
  • Do I need both answers? Then run both. Keep the two sets of numbers apart, and expect the log to read higher.

Server-side events sit between the two. Your backend sends an event when something happens, such as a paid order. That event is reliable about the outcome but knows nothing about the visit that led to it unless you pass the referrer and campaign along. PostDeploy has no server-side event API, and its collector accepts events only from pages on the Project's own hosts. To count an outcome your server confirmed, fire the goal from the confirmation page the browser loads afterwards, or add a page goal for that page. The goal then counts only completed orders and keeps the source of the visit.

The product page for this is Analytics.

Start your 14-day free trial