Ingest server-side pageview REST API
const url = 'https://app.hitkeep.com/api/ingest/server/pageview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dnt":true,"language":"example","page_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","referrer":"example","screen_height":1,"screen_width":1,"session_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","timestamp":"2026-04-15T12:00:00Z","url":"https://example.com","user_agent":"example","viewport_height":1,"viewport_width":1,"visitor_ip":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.hitkeep.com/api/ingest/server/pageview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dnt": true, "language": "example", "page_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "referrer": "example", "screen_height": 1, "screen_width": 1, "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "timestamp": "2026-04-15T12:00:00Z", "url": "https://example.com", "user_agent": "example", "viewport_height": 1, "viewport_width": 1, "visitor_ip": "example" }'Accepts one trusted server-side pageview from an API client. Use this endpoint for backend forwarding, CMS plugins, reverse proxy forwarding, edge workers, and historical pageview replay. It does not require browser Origin or Referer headers. HitKeep resolves the site from the submitted URL hostname, requires site.manage_data for that resolved site, and uses visitor_ip for ingest-time exclusions, spam filtering, and country, region, city, provider, and ASN lookup. UTM values and hk_qr QR attribution are read from the query string in url, for example utm_source, utm_campaign, and hk_qr on the visitor-facing URL, not from top-level JSON fields. Stored analytics records contain derived country, region, city, provider, and ASN context. HitKeep does not store the raw visitor IP. This endpoint uses the ingest rate limiter.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
When true, HitKeep drops the record consistently with browser tracker privacy behavior.
Optional page identifier. Generated when omitted.
Optional visitor grouping key. If omitted, this record gets its own standalone session.
Canonical analytics time in RFC3339 format.
Absolute page URL. The hostname resolves the configured HitKeep site. UTM values and hk_qr QR attribution are read from this URL query string.
User agent from the original visitor request context.
Trusted transient visitor IP context. Used to derive country, region, city, provider, and ASN metadata. HitKeep does not store the raw visitor IP.
Examplegenerated
{ "dnt": true, "language": "example", "page_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "referrer": "example", "screen_height": 1, "screen_width": 1, "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "timestamp": "2026-04-15T12:00:00Z", "url": "https://example.com", "user_agent": "example", "viewport_height": 1, "viewport_width": 1, "visitor_ip": "example"}Responses
Section titled “Responses”Accepted. Empty response body.
Invalid request
object
Examplegenerated
{ "message": "example"}Unauthorized
object
Examplegenerated
{ "message": "example"}Access denied
object
Examplegenerated
{ "message": "example"}Site not found
object
Examplegenerated
{ "message": "example"}Too many requests
object
Examplegenerated
{ "message": "example"}Service not available
object
Examplegenerated
{ "message": "example"}