Storing and using data about your users
In Embeddables, User Data refers to the current data stored on a given user.
User Data exists as a JSON object of properties. These properties could be:
User Data is stored in three places, or ‘contexts’, and each one usually stored a different amount of data.
Contexts are cascading, so if a property is stored in #2, it will also be stored in #1 as well, and so on.
This feature is coming soon to the New Builder.
In the meantime, ask Embeddables support to show you how to set this in the component JSON.
Type | Example | Typical Use-Case |
---|---|---|
Automatic Data | current_page_key | Sending the user’s current page to an API |
Answers | weight | Asking the user for their details |
Computed Fields | bmi | Calculating a value to decide if the user is eligible |
Experiment Data | split_title_length | Using the user’s current variant to show or hide a page |
URL Params | utm_source | Setting a condition based on the user’s traffic source |
Registered Keys | access_token | Storing the result of an API request |
You can read our full guide to best practices for naming keys in Embeddables here:
Learn how to choose good names for component keys, Computed Fields and more.
Input components, i.e. components that collect data from the user, are special in that they store their data in the User Data.
This means that the key name you choose for an input component will also be the property key name for that field in the User Data.
For example, if you have an input component with the key name
, the User Data will look like this:
For this reason, it’s especially important to choose good key names for input components.
snake_case
, meaning:
split_
.full_name
).full_name
not full_name_input
).All keys, whether component keys or other User Data keys, must be unique within the Embeddable.
The only exception to this rule is if you’re handling multiple input components that will be ‘swapped out’ - i.e. shown/hidden such that only one of them is visible at a time.
The most common use-case of this is a Split Test, e.g. testing between two different email capture pages, both containing an input component with the key email
.
Storing and using data about your users
In Embeddables, User Data refers to the current data stored on a given user.
User Data exists as a JSON object of properties. These properties could be:
User Data is stored in three places, or ‘contexts’, and each one usually stored a different amount of data.
Contexts are cascading, so if a property is stored in #2, it will also be stored in #1 as well, and so on.
This feature is coming soon to the New Builder.
In the meantime, ask Embeddables support to show you how to set this in the component JSON.
Type | Example | Typical Use-Case |
---|---|---|
Automatic Data | current_page_key | Sending the user’s current page to an API |
Answers | weight | Asking the user for their details |
Computed Fields | bmi | Calculating a value to decide if the user is eligible |
Experiment Data | split_title_length | Using the user’s current variant to show or hide a page |
URL Params | utm_source | Setting a condition based on the user’s traffic source |
Registered Keys | access_token | Storing the result of an API request |
You can read our full guide to best practices for naming keys in Embeddables here:
Learn how to choose good names for component keys, Computed Fields and more.
Input components, i.e. components that collect data from the user, are special in that they store their data in the User Data.
This means that the key name you choose for an input component will also be the property key name for that field in the User Data.
For example, if you have an input component with the key name
, the User Data will look like this:
For this reason, it’s especially important to choose good key names for input components.
snake_case
, meaning:
split_
.full_name
).full_name
not full_name_input
).All keys, whether component keys or other User Data keys, must be unique within the Embeddable.
The only exception to this rule is if you’re handling multiple input components that will be ‘swapped out’ - i.e. shown/hidden such that only one of them is visible at a time.
The most common use-case of this is a Split Test, e.g. testing between two different email capture pages, both containing an input component with the key email
.