Context Variables
Context Variables
Overview
Derived Context Variables are computed server-side from the normalized context generated by the Cloudflareadctv Worker.backend. Unlike raw context variables, derived variables represent higher-level contextual insights that creatives can consume directly without implementing business logic in the client runtime.
Benefits
Zero client-side computationConsistent evaluation across all creativesEdge-cacheable responsesSmaller runtime bundleSimple variable bindingFaster creative rendering
Processing Flow
Cloudflare Request
│
▼
Geo + Network + Bot
│
▼
Weather API
│
▼
Normalize Context
│
▼
Evaluate Derived Variables
│
▼
Cache Final Response
│
▼
Return ContextVariable Categories
Category | Description |
|---|---|
Weather | Temperature, comfort, daylight and weather classifications |
Time | Daypart, work hours and behavioural context |
Network | Network capability and media suitability |
Traffic | Traffic quality and trust signals |
Audience | Behavioural context for personalization |
Device | Device capability and rendering suitability |
Media | Recommended media quality |
Weather Variables
Variable |
|
|
| |
|---|---|---|---|---|
|
| String |
,
,
|
|
|
| String |
,
,
,
,
,
|
|
|
| String |
,
,
,
| |
|
,
| |||
| String |
,
,
,
|
| |
|
| String |
,
,
,
|
|
|
| Boolean |
,
|
|
|
| String |
,
,
,
|
|
|
| String |
,
,
|
|
|
,
,
,
| String |
,
,
|
|
Time Variables
Variable |
|
|
| |
|---|---|---|---|---|
|
| String |
,
,
,
,
| |
|
| Boolean |
,
| |
|
,
| |||
| Boolean |
,
|
| |
|
| Boolean |
,
|
|
|
| String |
,
,
,
,
|
|
|
,
| String |
,
,
|
|
Network Variables
Variable |
|
|
| |
|---|---|---|---|---|
|
,
| String |
,
,
|
|
|
|
,
|
| |
|
|
|
| |
| Boolean |
,
|
| |
|
|
|
| |
| String |
,
,
|
|
Traffic Variables
Variable |
|
|
| |
|---|---|---|---|---|
|
,
,
| String |
,
,
|
|
|
,
,
| Boolean |
,
|
|
|
,
,
| Number |
|
|
Audience Variables
Variable |
|
|
| |
|---|---|---|---|---|
|
,
,
,
,
| Number |
|
|
|
| String |
,
,
|
|
|
,
,
,
,
,
,
| String |
,
,
|
|
|
,
,
,
| String |
,
,
|
|
|
,
,
,
,
| String |
,
,
,
,
|
|
|
,
,
,
,
| String |
,
,
,
|
|
|
,
,
,
,
| String |
,
,
|
|
Device Variables
Media
Variable |
|
|
|
|---|---|---|---|
|
|
,
|
|
|
|
|
|
Media Variables
|
|
|
|
|---|---|---|---|
| String |
,
,
,
|
Device
Variable | Parameters | Type | Possible Values |
|---|---|---|---|
|
,
| String |
,
,
,
|
|
| Boolean |
,
|
|
| Boolean |
,
|
|
| Boolean |
,
|
|
| Boolean |
,
|
|
| String |
,
,
,
,
,
|
|
| String |
,
,
,
,
,
|
|
,
| String |
,
|
|
| String |
,
,
,
|
|
,
| Boolean |
,
|
Notes
Viewport
Variable
Parameters
Type
Possible Values
All derived variables are evaluatedviewport.size_tierviewport.widthString
xs,
server-sidesm,
inmd,
thelg,
Cloudflarexlviewport.orientationviewport.width,
Worker.Derivedviewport.heightString
portrait,
variables are returned alongside raw context variables in the API response.Creatives consume derived variables exactly like normal context variables.No client-side expression evaluation is required.The final response, including derived variables, can be cached at the Cloudflare edge for optimal performance.landscape