trackkit / index / PageContext
Interface: PageContext
Defined in: types.ts:43
Page-level context computed by the facade at send-time.
Properties
url
url:
string
Defined in: types.ts:45
Normalized, masked URL to report (pathname+search+hash).
title?
optionaltitle:string
Defined in: types.ts:48
Current document title (optional).
hostname?
optionalhostname:string
Defined in: types.ts:51
Hostname of the page (e.g., 'example.com').
referrer?
optionalreferrer:string
Defined in: types.ts:58
Referrer to report:
- first pageview: document.referrer (external only, after your policy)
- SPA navigations: previous same-origin URL, or '' if none/app policy strips
userId?
optionaluserId:string
Defined in: types.ts:65
User identifier to report. This is optional; many providers don’t support it. If provided, it should be a stable, anonymized user ID.
viewportSize?
optionalviewportSize:object
Defined in: types.ts:68
Viewport size in CSS pixels at send-time.
width
width:
number
height
height:
number
screenSize?
optionalscreenSize:object
Defined in: types.ts:71
Screen size in CSS pixels at send-time.
width
width:
number
height
height:
number
language?
optionallanguage:string
Defined in: types.ts:77
Language of the browser at send-time. Useful for providers that support localization.
timestamp?
optionaltimestamp:number
Defined in: types.ts:83
When the facade created this context (ms since epoch). Helps providers that batch or order events.
meta?
optionalmeta:Readonly<Record<string,unknown>>
Defined in: types.ts:89
Optional bag for future, strictly provider-agnostic additions (e.g., language). Avoid PII; keep this small to preserve a stable ABI.