Why do the stats shown by the opartstat module not match Google Analytics stats?
The two tools do not define every metric in the same way. A difference alone does not demonstrate a collection problem.
In the module:
- visitors are distinct IP addresses over the period;
- visits are grouped by IP address and day;
- page views count the collected page records.
These values do not directly correspond to Google Analytics 4 users or sessions. For example, GA4 ends a session after 30 minutes of inactivity by default.
Both tools filter bots. GA4 automatically excludes known bots; the module uses its own list of bot names. Their lists and methods can differ.
To investigate a difference, compare the same period and store, then check filters, excluded IP addresses and the collection scripts. The module sends a request from the browser when pages load; a visit is recorded only if collection succeeds.
Also check the traffic history still available and the Maximum number of visits stored in the database setting. Old records that have been deleted can no longer be included in the comparison.
Google references: known bot exclusion and session definitions.