New New: Meridian, the company website and growth platform, and Feilun, the AI growth platform View products →

Seeing your visitors without a third-party analytics script: Meridian's server-side analytics

Engineering By SREYUN 2 views

Many company websites rely on a third-party analytics script for visitor data: the data lives on someone else's platform, the definitions are opaque, an ad blocker loses data, and the privacy policy has to explain one more data processor. Meridian takes a different path: visits are recorded by the website's own server and stored in your own database.

Collection: the server records, the browser adds detail

The server records a page view while rendering the page, without waiting for a script to load, and crawlers are recognized and counted separately. A small script on the page only sends back time on page, screen size and conversion events with sendBeacon. Writes go to an in-memory buffer and are copied to the database in batches, so visitors' requests never wait for the database. Browser prefetch and prerender requests are not counted.

Definitions: numbers you can explain

  • Visitors are counted by a first-party cookie (two years), and sessions expire after 30 minutes of inactivity; crawlers are counted separately and never as page views or visitors;
  • visitors and IP addresses in the overview are exactly de-duplicated for the chosen period;
  • data from two days ago and earlier comes from daily rollups, while yesterday and today are calculated live; visit details are kept 180 days by default and rollups forever;
  • signed-in admins can be excluded, and browser DNT and GPC settings can be respected, in which case those visitors are neither recorded nor given an analytics cookie.

Sources: search engines, AI search and AI crawlers

Sources are classed as direct, search, social, external and internal, with search engines, keywords and UTM parameters recognized. As more visitors arrive from AI assistants' answers, Meridian recognizes visits from ChatGPT, Perplexity, Doubao, Kimi, Yuanbao and others as AI search traffic; meanwhile AI crawlers such as GPTBot, ClaudeBot and PerplexityBot are identified and counted separately, never mixed into visitor data.

Regions: a built-in database that works offline

The ip2region IPv4 and IPv6 databases are built in, so country or region, province, city and network operator are recognized out of the box with no outside API calls; visits recorded before an upgrade get their location filled in automatically. To update the database, replace the xdb file.

Explore: any combination, level by level

Analytics, Explore summarizes page views by more than 20 dimensions: date, hour, weekday, country or region, province, city, operator, page, entry page, language, source, search term, UTM, device, operating system, browser, screen, new or returning, status code and crawler. Clicking a value adds it as a filter and drills into the next dimension, filters show as removable tags, and any result opens the matching visit details or exports to CSV.

The donut, bar, stacked bar and weekday by hour heatmap charts on the dashboard and in analytics drill down the same way: source type, source site, page; country, province, city, operator; device, operating system, browser; and the last level opens the filtered visit details.

Real time, pages and details

Besides Explore, the everyday reports are ready: hourly and daily trends compared with the previous period; viewed, entry and exit pages; not-found statistics (which missing addresses external links or old bookmarks point to); devices, browsers, operating systems and screen sizes; and how search engines and AI crawlers fetch the site. The real-time page shows who is browsing and on which page, and visit details follow one visitor's whole path from arrival to exit, session by session. All of it depends only on the website's own database, so it works on private networks too.

Conversions without code

Button clicks, form starts, lead submissions, phone calls, email clicks, file downloads and outbound clicks are collected automatically; for anything custom, add a data-track attribute to an element or call one JavaScript function. Conversions and leads are tied to the visitor, so a lead shows the full trail before submission.

Visitors' choice

The "my visit data" page linked in the footer shows visitors their anonymous visitor ID and lets them delete their own visit records or opt out of being recorded; the choice is kept in the browser and always applies, whether or not DNT is on. When admins handle a personal data request, the same visitor ID finds the matching visits and conversions.

Performance

In a local test with 500,000 visit records, the first 30-day overview takes about 2 to 4 seconds (exact de-duplication, cached afterwards), and page, source and device reports 0.3 to 1 second; chart reports are also cached for a minute. At a million page views a day, raise the database connection limit and memory settings and shorten the detail retention.

Learn more on the Meridian product page or book a demo.

Related articles