Cloudflare Docs
Zaraz
Visit Zaraz on GitHub
Set theme to dark (⇧+D)

Zaraz Context

The Zaraz Context is a versatile object that provides a set of configurable properties for Zaraz, a web analytics tool for tracking user behavior on websites. These properties can be accessed and utilized across various components, including Worker Variables and JSONata expressions.

System properties, which are automatically collected by Zaraz, provide insights into the user’s environment and device, while Client properties, obtained through Zaraz Web API calls like zaraz.track(), offer additional information on user behavior and actions.

​​ System properties

PropertyTypeDescription
system.page.queryObjectKey-Value object containing all query parameters in the current URL.
system.page.titleStringCurrent page title.
system.page.urlURLURL Object containing information about the current URL
system.page.referrerStringCurrent page referrer from document.referrer.
system.page.encodingStringCurrent page character encoding from document.characterSet.
system.cookiesObjectKey-Value object containg all present cookies.
system.device.ipStringVisitor incoming IP address.
system.device.resolutionStringScreen resolution for device.
system.device.viewportStringVisible web page area in user’s device.
system.device.languageStringLanguage used in user’s device.
system.device.user-agent.uaObjectBrowser user agent.
system.device.user-agent.browser.nameStringBrowser name.
system.device.user-agent.browser.versionStringBrowser version.
system.device.user-agent.engine.nameStringType of browser engine (for example, WebKit).
system.device.user-agent.engine.versionStringVersion of the browser engine.
system.device.user-agent.os.nameStringOperating system.
system.device.user-agent.os.versionStringVersion of the operating system.
system.device.user-agent.deviceStringType of device used (for example, iPhone).
system.device.user-agent.cpuStringDevice’s CPU.
system.misc.randomNumberRandom number unique to each request.
system.misc.timestampNumberUnix time in seconds.
system.misc.timestampMillisecondsNumberUnix time in milliseconds.

​​ Event properties

PropertyTypeDescription
client.__zarazTrackStringReturns the name of the event sent using the Track method of the Web API. Refer to Zaraz Track for more information.
client.<KEY_NAME>StringReturns the value of a zaraz.track() eventProperties key. The key can either be directly used in zaraz.track() or set using zaraz.set(). Replace <KEY_NAME> with the name of your key. Refer to Zaraz Track for more information.