Create new custom data
To create new custom data:- Click Settings > Custom data.
- Click New custom data in the top right of the page.
Structure of the creation pop-in

- Name the new custom data.
- Select a project.
- Tell Kameleoon how to retrieve custom data.
Custom data name
Give your custom data an easily identifiable name. If you select several websites, make sure you pull custom data from all of them. You can have a maximum of 255 active custom data points.Value retrieval
Retrieval method
Choose the custom data’s value retrieval method from the dropdown menu. The main tag management tools are:- GTM data layer (
dataLayer) - Commanders Act data layer (
tc_vars) - Tealium (
utag.data&utag_data) - Adobe Tags (data elements)
dataLayer, proceed as follows to retrieve values:
- If the key is in level 1 of the
dataLayer, enternamein the Variable Name field. - If the key is in level 2 of the
dataLayer, enterproperties.countryCodein the Variable Name field.
- Confirm that the data element returns a value on your page. Open the browser console and run
_satellite.getVar("dataElementName"), replacingdataElementNamewith your data element’s name. - In the Retrieval method dropdown menu, select Adobe Tags. Enter the same data element name in the Variable Name field.
- Check the value in the browser console. Use
Kameleoon.API.CurrentVisit.customDatafor Page and Visit scopes, andKameleoon.API.Visitor.customDatafor Visitor scope. You can also check the value with the Kameleoon Debug Assistant Chrome extension.
General - Marketing Event - ID, enter General - Marketing Event - ID in the Variable Name field. Kameleoon then reads the value by calling _satellite.getVar("General - Marketing Event - ID"), which can return a value such as 154862.
If you choose Kameleoon Activation API, set the value yourself from your website’s JavaScript, typically your global script, using the Activation API’s setCustomData() method.
If you choose Kameleoon SDK method, set the value using a Kameleoon SDK’s addData() method. Use this retrieval method when you target visitors with Kameleoon Feature Experimentation.
If you choose Custom JavaScript code, write the code directly into this field. To set a value, your code must return an object with two keys: value, with the value you want to provide for this custom data, and (optionally) overwrite, with a boolean value (false by default). Kameleoon runs the code again every 100 ms for the first 3 seconds after the first invocation, then every 3 seconds after that.
Here is an example:
retrieveDataFromRemoteSource(), in the code you write in this field. To set the value from a script in Tag Manager, an external script file, or inline in the HTML instead, use the Kameleoon Activation API retrieval method.
Type
Select the structure of the data you want to retrieve from the dropdown menu. The data type can be:- single (example:
127) - list (example:
126, 127, 128;shoes, dress, coat) - count list of (example:
shoes: 3, dress: 1, coat: 1)
Format
Select the format of the data you want to retrieve from the dropdown menu. The data format can be:- string (example:
woman dress) - boolean (example:
female = "true/false") - number (example:
cart amount = "127")
Scope
Select your custom data’s scope in the dropdown menu:- Page: For each new page, Kameleoon resets the data’s value. For example, cart amount.
- Visit: Kameleoon resets the data’s value at each new visit. For example, geolocation.
- Visitor: The unit of data relates to the visitor and not to the visit. For example, female = true.
Options
Click Next to access available options for your custom data.Use this data only locally for targeting purposes
If you use your custom data solely for targeting, you don’t need to store it on the server. In this scenario, use theLocalData API, which helps conserve server space because it doesn’t count towards the limit of 255 active custom data points. However, you can’t use custom data managed through the LocalData API for reporting on the Results page.
If you choose to store custom data on the server, be cautious not to save sensitive information. Also, the value of any custom data you send to the server can’t exceed 1,000 characters.
Use this custom data as input for AI Targeting
If your project has AI Targeting enabled, you can choose whether to include this custom data as an input for the predictive model. You can’t use custom data that has Use this data only locally for targeting purposes enabled as model input, because Kameleoon doesn’t send local data to the server. Don’t activate this option if the custom data is highly targeted (for example, specific to individual visitors or very small segments). The model only accepts Number and Boolean custom data types. Avoid adding sensitive data such as dates, timestamps, or unique visitor identifiers (like email addresses or customer account numbers), as these elements are unsuitable for predictive models. To use a category such as device type, create one Boolean custom data point for each value (for example,is_mobile, is_tablet, and is_desktop) and set exactly one of them to 1 (true) and the others to 0 (false) for each visitor. Mapping text values to numbers invents an order between them. For the reasoning and a worked example, see Encode text values as Boolean custom data.
Use this custom data as a unique identifier for cross-device history reconciliation
When you activate this option, Kameleoon treats this custom data as a unique identifier for your visitors and uses it to map several Kameleoon visits to a unique user. For more information, see cross-device experimentation. Only custom data with the single type and a string or number format can be a unique identifier. Kameleoon doesn’t accept list, count list, or boolean custom data for this option. A unique identifier must have the Visitor scope. Kameleoon rejects the option for custom data with the Page or Visit scope.Save the values for the targeting condition associated with the custom data point
This option allows you to define a specific list of values that are then available for this custom data in the segment builder. In the New custom data pop-in (first page of the creation flow), click Paste a sample code to get a code example. Your code must synchronously return a JavaScript array of objects. Each object in this array should represent a possible value for the custom data and must include:- A
valuekey, containing the actual data (its type must match the custom data’s defined type). - A
labelkey, providing a string description for that value.
Define custom data as a targeting condition
To add a custom data to a new segment:- Select your desired data in the Custom data tab of the Conditions column.
- In the dropdown menu, set the custom data value required to target a user.
- Include or exclude visitors meeting the custom data condition.

Filter or break down by custom data on the Results page
On an experiment’s Results page, you can filter or break down the results according to custom data associated with the experiment. More about custom data in the Kameleoon developer documentationFAQ
How do I activate cross-device history reconciliation?
How do I activate cross-device history reconciliation?
- Click Settings > Custom data > New custom data.
- Follow the setup steps and click Next.
- Toggle Use this custom data as a unique identifier for cross-device history reconciliation to ON.
- Click Create.