Understand the differences between server-side and client-side trackers
mainThe @counterscale/tracker/server module behaves differently than the browser-based client-side version:
- No DOM dependency: It does not include auto-tracking or browser instrumentation.
- Fetch API: Uses native
fetchinstead ofXMLHttpRequest(requires Node.js 18+). - No Cache Checks: Does not perform cache status checks.
- Explicit Parameters: Requires explicit
urlandhostnameparameters. - Hit Type: Always reports hit type as
"1"(new visit) because server-side tracking cannot maintain browser session state. - Fire-and-forget: Tracking is designed to be non-blocking; errors will not throw exceptions that crash the process.