This feature is in open beta and is in active development. Contact the Kameleoon support team for support with this integration.
Amplitude is a product analytics tool that helps businesses track user behavior, analyze data, and improve their digital products to boost engagement and growth.
The Kameleoon Amplitude Cohorts integration lets you seamlessly sync cohorts from Amplitude to Kameleoon. Leverage real-time behavioral data to deliver personalized experiences and run highly targeted experiments, driving more impactful and data-driven optimizations.

Key benefits
- Seamless cohort sync: Import user segments from Amplitude into Kameleoon effortlessly.
- Personalized targeting: Deliver tailored experiences based on user behavior.
- Enhanced experimentation: Run precise A/B tests on specific audience groups.
- Real-time updates: Keep user segments up-to-date automatically.
Use cases
Optimize experiments with behavioral targeting
Sync Amplitude cohorts with Kameleoon to test variations on users based on their real-time behavior.
For example, run an A/B test on users who have viewed a product page multiple times but haven’t added anything to their cart. Test different incentives (e.g., a limited-time offer vs. social proof messaging) to determine which strategy drives the most conversions.
Analyze results with behavioral segmentation
Break down Kameleoon campaigns using Amplitude cohorts for deeper insights.
For example, if a test or personalization campaign shows a drop in conversions, analyze key Amplitude segments (e.g., high-value customers, churn-prone users) to identify patterns. This helps you understand which experiences resonate best with different user groups and refine your strategy accordingly.
Personalize experiences using Amplitude’s rich user insights
Leverage Amplitude’s deep user data—such as behavior, lifecycle stage, or purchase history—to create highly relevant experiences in Kameleoon.
For example, identify frequent buyers, users who recently downgraded their subscription, or those who engage with specific content. Then, tailor messaging, promotions, or feature recommendations in Kameleoon to maximize engagement and conversions.
Get started
Store Kameleoon Visitor Code as an Amplitude User Property
Add this code to your Amplitude SDK immediately after the amplitude.init()
function:
// Ensure the SDK is loaded before setting user properties const identifyEvent = new amplitude.Identify(); identifyEvent.set('kameleoon_visitorcode', Kameleoon.API.Visitor.code); amplitude.identify(identifyEvent);
You can then view the kameleoon_visitorcode
property in Amplitude.

Generate your Kameleoon API-Key
Please note that you will need a Kameleoon Client-Secret, ask your Kameleoon Customer Success Manager for it.
Open this URL in your browser and replace the placeholders with your Kameleoon Client ID and Client Secret to generate your Kameleoon API Key.
https://customers.kameleoon.com/kameleoon/amplitude/getapikey?id=CLIENT ID&secret=CLIENT SECRET
Activate the Kameleoon integration in Amplitude
Locate the Kameleoon Cohorts integration in your Amplitude account under Data > Catalog > Destinations.

Connect to Kameleoon
- Create a new Destination: Click on Kameleoon Cohorts.
- Set up the integration:
- Name: Provide a name for the connection (e.g., Kameleoon Cohorts).
- Kameleoon API Key: Enter the Kameleoon API Key you generated earlier.
- Kameleoon Sitecode: Input your project sitecode here.
- Kameleoon Visitor Code: Select the
kameleoon_visitorcode
user property. If you can’t find it, please refer to the “Store Kameleoon Visitor Code as an Amplitude User Property” section for guidance.
- Save the integration: Click Save.
Activate Cohort Sync in Amplitude
Navigate to your Cohorts and begin creating the cohort sync.

Select Kameleoon Cohorts, choose the API target for syncing, and set the sync frequency.

Leverage Amplitude cohorts in your Kameleoon campaigns
Create custom data to target Amplitude cohorts in your experiments
To create a segment based on Amplitude cohorts, set up a custom data in Kameleoon > Configure > Custom data.
Retrieve Amplitude cohorts for client-side experiments
- Create a New Custom data: Click on New custom data.
- Set up the Custom data:
- Name: Amplitude Cohorts.
- Select your project.
- Choose the retrieval method: Custom JavaScript code.

Insert this snippet into the dedicated field.
Kameleoon.API.Data.retrieveDataFromRemoteSource("AMPLITUDE_COHORTS_" + Kameleoon.API.Visitor.code, function (data) { if (data?.cohorts) { data.amplitude_cohorts.map(function (segment) { Kameleoon.API.Data.setCustomData("Amplitude Cohorts", segment); }); } }); return { "value": null}
- Select Type: List.
- Select Format: String.
- Select Scope: the scope may be set to Page, depending on the scope; when being set to Page, it is re-evaluated on every page load, if the user is within a certain cohort being identified by Amplitude.

Retrieve Amplitude cohorts for server-side experiments
- Create a new custom data: Click on New custom data.
- Set up the custom data:
- Name: Amplitude Cohorts.
- Select your project.
- Retrieval method: Kameleoon SDK method.
- Type: List.
- Format: String.
- Scope: the scope may be set to Page, depending on the scope; when being set to Page, it is re-evaluated on every page load, if the user is within a certain cohort being identified by Amplitude.

To use Amplitude cohorts in server-side experiments or feature flags, you can consult the guidelines outlined in the documentation for each respective SDK. For instance, if you’re using the GO SDK, you can refer to its documentation for detailed instructions.
The GO SDK, like our other SDKs, employs the GetRemoteData method, which is accessible across all our SDKs. This method enables you to fetch data stored by Amplitude on our servers and make it accessible within your backend code.
Fetch Amplitude cohort names in Kameleoon
In the last step of custom data creation, activate the Save the values for the targeting condition associated with the custom data point option.

Insert this snippet into the dedicated field and replace the value “ADD_YOUR_SITECODE” by your project Sitecode.
var xhr = new XMLHttpRequest(); xhr.open("GET", 'https://data.kameleoon.io/map/map?siteCode=ADD_YOUR_SITECODE&key=common', false); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); var amplitudeSegments = []; xhr.onreadystatechange = function() { // Call a function when the state changes. if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { var amplitude = JSON.parse(xhr.response); amplitude["cohorts"].forEach(function (segment) { amplitudeSegments.push({value: segment, label: segment}); }); } } xhr.send(); return amplitudeSegments;
Use Amplitude cohort IDs in a Kameleoon segment
After the custom data for the Amplitude cohort names has been set up, you can build segments within the Kameleoon segment builder, by choosing the custom data and selecting is among the values, which will then show a list of every cohort ID from Amplitude. Selecting one or multiple Amplitude cohort(s) will enable targeting in personalizations and experiments.
