Context
Find out all the variables you can use in your queries.
In CQL, the term context refers to the data your queries can use to gain insight into the user's environment. This includes information like the user's geographic location or the page they are currently viewing.
The data available for your queries depends on the channel through which your users interact with your application. For example, websites have pages, while mobile applications have screens.
To access the information available in the context, you use variables. For example, the page variable gives you information about the current page, while the location variable tells you the current geographic location.
The table below lists the currently available variables and what they provide:
Variable | Type | Description |
---|---|---|
now | Date-time | The current date and time. |
yesterday | Date | Yesterday's date. |
today | Date | Today's date. |
tomorrow | Date | Tomorrow's date. |
user | User | The user currently using the application. |
session | Session | The user's current session or visit. |
device | Device | The user's device. |
location | Location | The user's geographic location. |
cart | Cart | The contents of the user's shopping cart. |
campaign | Campaign | The last campaign the user interacted with. |
context | Context | The evaluation's context. |
page | Page | The webpage currently viewed by the user. |
browser | Browser | The user's web browser. |
Variables
The following sections present a categorized list of variables you can use in your queries, sometimes accompanied by informative icons.
These icons indicate the availability and usage restrictions of the information. For example, it may be available only to identified users or during web sessions.
Here is what each indicator means:
- Integration required: Information that is not automatically collected by our SDKs and must be sent by your application to be available for your queries.
- Available for web sessions only: Channel-specific information that is only available for web sessions, such as the current page or browser.
- Available for identified users only: As part of our commitment to privacy, we prevent access to personally identifiable information of unidentified users to promote respect for the right to erasure.
Evaluation
Evaluation variables are specific values associated with each evaluation, including the date, time, and context in which the evaluation occurs.
For example, the context variable might provide information about an upgrade opportunity, such as the name of the feature and the number of members in the user's organization. These details can give you insight into the user's environment and help you decide the best offer to present.
This is a list of the evaluation variables you can use in your queries:
User
User variables provide information about the person currently using the application, such as their name, email address, and age.
The following table lists the variables and properties you can use to access information about the user:
Session
Session variables provide information about the current visitor session, such as how long the user has been active or custom attributes that your application may have set.
The following table lists the variables and properties that you can use to access information about the current session:
Navigation
Navigation variables provide information about the journey that the user has taken through your application, such as the current page or screen that the user is viewing.
The following table lists the variables and properties that you can use to access information about the user's navigation:
Technology
Technology variables provide information about the technologies the user is using to access your application, such as their browser or device.
The following table lists the variables and properties that you can use to access information about the user's technology:
Location
Location variables provide information about the geographic location from which the user is accessing your application, such as the user's country or city.
The following table lists the variables and properties that you can use to access information about the user's location:
Marketing
Marketing variables provide information about the marketing campaigns that the user has engaged with, such as the name of the campaign or where the user came from.
The following table lists the variables and properties that you can use to access information about marketing campaigns:
Shopping
Shopping variables provide information about the buying behavior of the user, such as the stage of the purchase process or the items in the user's cart.
The following table lists the variables and properties that you can use to access information about shopping behavior: