Skip to main content

Receive user data in Kameleoon with any third-party solution

Send user data to Kameleoon

The Map endpoints allow you to store additional data for a given key (usually a visitor code or an internal user ID), which can then be retrieved and used for targeting and segmentation purposes, by using the retrieveDataFromRemoteSource method available in our Activation API and all our SDKs. You can also use the map endpoint to retrieve stored data for a given key.

Example of payload:

{
"U67891": {
"userSegment": ["Tech Enthusiast", "Gamer"],
"categoryAffinities": [
{
"id": "0567012",
"name": "Gaming Keyboards"
},
{
"id": "0456789",
"name": "Mechanical Keyboards"
}
]
},
"U23456": {
"userSegment": ["Fitness & Outdoors", "Health Conscious"],
"categoryAffinities": [
{
"id": "0321009",
"name": "Smartwatches"
},
{
"id": "0789456",
"name": "Wireless Earbuds"
}
]
},
"U98765": {
"userSegment": ["Music Lover", "Audiophile"],
"categoryAffinities": [
{
"id": "0984321",
"name": "Bluetooth Speakers"
},
{
"id": "0678901",
"name": "Noise-Canceling Headphones"
}
]
}
}

Example of request:

curl -L 'https://data.kameleoon.io/map/maps' \\
-H 'Content-Type: application/json' \\
-d '{"U67891":{"userSegment":["Tech Enthusiast","Gamer"],"categoryAffinities":[{"id":"0567012","name":"Gaming Keyboards"},{"id":"0456789","name":"Mechanical Keyboards"}]},"U23456":{"userSegment":["Fitness & Outdoors","Health Conscious"],"categoryAffinities":[{"id":"0321009","name":"Smartwatches"},{"id":"0789456","name":"Wireless Earbuds"}]},"U98765":{"userSegment":["Music Lover","Audiophile"],"categoryAffinities":[{"id":"0984321","name":"Bluetooth Speakers"},{"id":"0678901","name":"Noise-Canceling Headphones"}]}}'

Retrieve user data in Kameleoon

Create a custom data

You must create and set up a Kameleoon custom data

You will need to create and set up a Kameleoon custom data. To do so:

  1. Click Settings > Custom data.
  2. Name your custom data.
  3. Select your project.
  4. Select Custom JavaScript code retrieval method.

Use the code below.

Replace NAME_OF_YOUR_CUSTOMDATA with your custom data's name, and NAME_OF_YOUR_USER_ID with your user ID.

Kameleoon.API.Data.retrieveDataFromRemoteSource(NAME_OF_YOUR_USER_ID, function(data) {
for (const [key, value] of Object.entries(data)) {
Kameleoon.API.Data.setCustomData('NAME_OF_YOUR_CUSTOMDATA',key)
}
});
return { "value": null}
  1. Choose the type List and format String.
  2. Choose the scope Page.

Save the values for targeting condition associated with the custom data point

More information here: Create and push a custom data

Create your segments

Create a new segment for your project

Follow these steps to set up a segment:

  1. Click Settings > Custom data.
  2. Name your segment.
  3. Select your project.
  4. Select campaign type for segment.

Use the custom data created previously to create your segment

After you've set up the custom data, you can build segments in the Kameleoon Segment Builder. Choose the custom data and select is among the values, which will then display a list of every user data from your third-party tool. Select a user data to enable targeting in personalizations and experiments.

Use this segment for your experiments

More information here