Repository navigation
Description
Summary
Finalize first-class server-side tracking for historical timestamp and visitor IP context.
Problem
Users importing or forwarding server-side access logs need to record pageviews and custom events with the original visit timestamp and visitor IP context. HitKeep has the beginnings of server-side tracking through the public ingest APIs and related docs, but the current POST /ingest/event endpoint is still designed around the browser tracker: it identifies the site from the Origin header, derives the client IP from the HTTP request, and stores the event time as the current server time. That makes it unsuitable for replaying historical server logs or creating accurate no-JavaScript/server-side tracking data.
Who Benefits
Self-hosted operators, managed cloud customers, and API users who want to ingest server-side access logs, edge logs, webhook-derived activity, or no-JavaScript analytics data into HitKeep.
Proposed Solution
Finish the server-side tracking implementation by adding dedicated authenticated server-side ingest endpoints for visits/pageviews and events that can accept:
- a site identifier or token that does not depend on a browser
Originheader - an explicit event or visit timestamp
- a visitor IP address or trusted visitor IP context for geolocation, spam filtering, and exclusion rules
- the same session, pageview, event name, and property payload shape used by current browser ingest where possible
Keep the existing browser /ingest and /ingest/event behavior unchanged.
User Workflow
- Create or choose an API client/token with permission to ingest data for a site.
- Send server-side log-derived pageviews or events with the original timestamp and visitor IP context.
- Review the resulting traffic and events in the dashboard with accurate time buckets, filters, geolocation, and existing analytics views.
Success Criteria
- Server-side pageviews and custom events can be ingested without a browser
Originheader. - Accepted server-side records can use an explicit RFC3339 timestamp instead of
time.Now().UTC(). - Trusted server-side ingest can apply visitor IP context without exposing this capability to the public browser endpoint.
- Existing spam filtering, IP exclusions, privacy constraints, and tenant-aware storage continue to apply.
- Docs and OpenAPI describe the server-side tracking contract and clearly distinguish it from browser tracker ingest.
Alternatives Considered
Users can send pageviews and custom events to the current public ingest endpoints, but those endpoints use the request IP and current server time. Event properties could carry an ip or timestamp value today, but those values would not drive HitKeep's canonical timestamp, geolocation, spam filtering, exclusion rules, or dashboard time buckets.
Additional Context
- GitHub Discussion: Can IP address and timestamp be passed to custom events ? #128
Activity
[-]Add server-side event ingest with timestamp and IP context[/-][+][Feature]: Add server-side event ingest with timestamp and IP context[/+][-][Feature]: Add server-side event ingest with timestamp and IP context[/-][+]Finalize server-side tracking with timestamp and IP context[/+][-]Finalize server-side tracking with timestamp and IP context[/-][+][Feature]: Finalize server-side tracking with timestamp and IP context[/+]feat(ingest): add server-side ingestion