Ingest pageview REST API
POST
/ingest
const url = 'https://hitkeep.com/ingest';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"lang":"example","page_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","path":"example","qr":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","referrer":"example","sc_h":1,"sc_w":1,"session_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","u_cmp":"example","u_cnt":"example","u_med":"example","u_src":"example","u_trm":"example","ua":"example","unique":true,"vp_h":1,"vp_w":1}'};
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://hitkeep.com/ingest \ --header 'Content-Type: application/json' \ --data '{ "lang": "example", "page_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "path": "example", "qr": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "referrer": "example", "sc_h": 1, "sc_w": 1, "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "u_cmp": "example", "u_cnt": "example", "u_med": "example", "u_src": "example", "u_trm": "example", "ua": "example", "unique": true, "vp_h": 1, "vp_w": 1 }'Ingests a pageview hit from the browser tracker. This public endpoint expects the compact hk.js payload and browser Origin request context. The tracker sends initial hk_qr attribution as qr when a visitor arrives through a dynamic QR redirect. HitKeep uses the resolved request IP transiently for exclusions, spam filtering, and country, region, city, provider, and ASN lookup, stores derived country, region, city, provider, and ASN context, and does not store the raw visitor IP. Trusted server-side pageviews should use POST /api/ingest/server/pageview instead.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
lang
string
page_id
required
string format: uuid
path
required
string
qr
Initial hk_qr attribution captured by the browser tracker.
string format: uuid
referrer
string
sc_h
integer
sc_w
integer
session_id
required
string format: uuid
u_cmp
string
u_cnt
string
u_med
string
u_src
string
u_trm
string
ua
string
unique
boolean
vp_h
integer
vp_w
integer
Examplegenerated
{ "lang": "example", "page_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "path": "example", "qr": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "referrer": "example", "sc_h": 1, "sc_w": 1, "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "u_cmp": "example", "u_cnt": "example", "u_med": "example", "u_src": "example", "u_trm": "example", "ua": "example", "unique": true, "vp_h": 1, "vp_w": 1}Responses
Section titled “Responses”Accepted
Invalid request
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}