What is the function of the web SDK versus the Kameleoon Application script?
What is the function of the web SDK versus the Kameleoon Application script?
How long does an SDK initialization take?
How long does an SDK initialization take?
How is the SDK config synchronized with the server?
How is the SDK config synchronized with the server?
What technology does the streaming method use?
What technology does the streaming method use?
When does the Kameleoon CDN provide a new configuration to the SDK?
When does the Kameleoon CDN provide a new configuration to the SDK?
What are the Kameleoon domains that I need to whitelist?
What are the Kameleoon domains that I need to whitelist?
https://[your-site-code].kameleoon.xx may vary from one project to another. Kameleoon may host your projects on either kameleoon.eu or kameleoon.io depending on their creation date. Make sure you use the domain displayed in your project in the Kameleoon App. Replace [your-site-code] with your Kameleoon site code in each line that it appears and add this to your configuration.How do I set up the SDK if the server has several instances?
How do I set up the SDK if the server has several instances?
getRemoteVisitorData method.If the problem is in the SDK configuration difference, use the Streaming option.Does the variation attribution/traffic allocation happen locally or on a server?
Does the variation attribution/traffic allocation happen locally or on a server?
How does the SDK ensure visitors are exposed to the same variation?
How does the SDK ensure visitors are exposed to the same variation?
How do I show a specific variation first in a feature flag simulation?
How do I show a specific variation first in a feature flag simulation?
If I change the traffic distribution/exposition, will visitors still see their allocated variation?
If I change the traffic distribution/exposition, will visitors still see their allocated variation?
Why are there no visits displayed on the results page?
Why are there no visits displayed on the results page?
- If you enabled bot filtering in the project settings, the SDK might set the user-agent value incorrectly. Refer to this article for more details.
- You configured Legal Consent as Required in the project settings, but haven’t called the
setLegalConsentSDK method. Refer to this documentation for more details. - You didn’t use any of the SDK methods that send a tracking request to Kameleoon servers.
Why don't the number of visits align with my actual traffic?
Why don't the number of visits align with my actual traffic?
Why is the visitor allocation in my reports incorrect?
Why is the visitor allocation in my reports incorrect?
- Narrowing the visitor pool for specific variations: If you first call
getVariations(onlyActive: true, track: false), the SDK only returns visitors assigned to active (ON) variations. If you then only display experiment pages and callgetVariation(track: true)for these specific visitors, Kameleoon tracks only theONvariation, which results in a report that only shows one variation. - Insufficient time for tracking requests: Kameleoon sends data at a specific interval. If a visitor stays on a page with an integrated Kameleoon client for the
ONvariation, but moves to a page without it for theOFFvariation, the client might not have enough time to send the tracking request for theOFFvariation. - Missing configuration for specific variations: You might have omitted the
UserAgentorsetLegalConsentfor some variations. For example, if you only provide consent on the page for theONvariation, Kameleoon can’t track visitors in theOFFvariation. - Missing visitor data: The SDK doesn’t collect visitor data automatically; you must add it explicitly for targeting and tracking to work correctly.
Check your targeting setup
If you suspect targeting issues, follow these steps:- Create a non-targeting rule with 100% exposure and assign your desired variation.
- Add targeting and ensure the user stops receiving the variation.
- Add the required Kameleoon data.
When I use addData(), is the data available for targeting right away?
When I use addData(), is the data available for targeting right away?
Where is data stored?
Where is data stored?
sessionDuration parameter, the more data the SDK holds in memory, increasing consumption. Each time a visitor sends a request, the session extends by an additional 30 minutes. As a result, the SDK keeps data for at least 30 minutes after the last request.When is it a good time to flush data?
When is it a good time to flush data?
flush method manually: other calls to SDK methods send data along with them. However, if you need to send data to the Data API without triggering the visitor feature flag, use the flush method.How do I use previously collected data for targeting?
How do I use previously collected data for targeting?
getRemoteVisitorData method with the appropriate parameters to get data sent to the Data API. After loading, the SDK includes the data in visitor targeting.Why doesn't my targeting work when I run feature flags at the edge?
Why doesn't my targeting work when I run feature flags at the edge?
addData() before evaluating the feature flag.getRemoteVisitorData() works at the edge, but its latency (typically 100-200 ms) and the lack of durable, cross-request memory in most edge platforms make it impractical for most edge use cases.See Edge targeting constraints for the full explanation and a code example, and Serverless edge compute starter kits for the frameworks Kameleoon supports.Why isn't my experiment collecting data?
Why isn't my experiment collecting data?
-
In the Kameleoon App
- You created the rule for the correct environment (production, staging, or development).
- The rule is on.
- The rule targets traffic that Kameleoon can actually expose.
- If you enabled bot filtering on your project, add User Agent to the filter.
-
In the SDK
- You created the
KameleoonClientwith the correct configuration (siteCode, environment variable, and, if applicable, networkDomain). - You call
getVisitorCodeonly once, and reuse its value wherever you need the visitorCode. - If using hybrid mode (engine.js on the frontend), the visitorCode syncs correctly with the frontend.
- For experiment rules, you call
setLegalConsent(true)to allow data collection. - For delivery rules, you call
isFeatureActive()(orgetVariation()), and it returns true (or the expected variation). - For experiment rules, you call
getVariation(), and it returns the expected variation.
- You created the
-
Debugging Tips
- Log in the console: the consent value, the visitorCode, and the variation values, and verify they match what you see in the browser.
- Enable SDK logging and check for any errors.
What data needs consent to be sent?
What data needs consent to be sent?
When does the SDK send a tracking request for analytics?
When does the SDK send a tracking request for analytics?
- Periodically: By default, the SDK sends a request every 1000 milliseconds (1 second). You can change this interval by setting the tracking interval value.
- On demand: Instantly, if your code calls a method like
flush(instant=true).
getVariation(when you settracktotrue).getVariations(when you settracktotrue).isFeatureActive(when you settracktotrue).trackConversionflush(with or withoutinstant=true)
activityTrackingIntervalMillisecond (or activity_tracking_interval_millisecond) parameter in your SDK configuration.For server-side SDKs, event batching is particularly useful as each tracking request can consolidate multiple visitors’ data into a single request. This approach aggregates information on all affected visitors and sends it once per interval, improving efficiency, and reducing server load.Which methods trigger HTTP requests? Are they synchronous or asynchronous?
Which methods trigger HTTP requests? Are they synchronous or asynchronous?
- isFeatureActive / getFeatureVariationKey / getFeatureVariable / trackConversion / flush
- These methods make asynchronous requests to the Data API to store all information about the visitor (including variations received by the user). Kameleoon uses this information to display statistics in app.kameleoon.com
- getRemoteData / getRemoteVisitorData / getWarehouseAudience
- These methods make synchronous requests to the Data API to obtain information about the visitor
- Additionally, SDK makes asynchronous requests to obtain the configuration necessary for internal work.
When should I use isFeatureActive or getFeatureVariationKey?
When should I use isFeatureActive or getFeatureVariationKey?
isFeatureActive when you need to know whether the flag is active but don’t need to know the exact variation the visitor received. When using Experiment rules, it’s better to call getFeatureVariationKey if you have two or more variations other than off.Can I use both a client-side SDK (including the engine.js application file) and a server-side SDK on my website?
Can I use both a client-side SDK (including the engine.js application file) and a server-side SDK on my website?
engine.js application file) and a server-side SDK. In this setup, it’s essential to call the getVisitorCode method. Calling this method ensures consistent visitor recognition between the browser and the server, and provides consistent variation allocation when running both client-side code (for example, event tracking) and server-side code (such as feature execution) for a given feature flag.Do I need to call getVisitorCode?
Do I need to call getVisitorCode?
getVisitorCode in instances where you use a hybrid integration (web-site <-> server sdk, js sdk <-> server, engine <-> server sdk). When you call getVisitorCode, it obtains the visitor code and transmits it using a cookie. If you don’t use a hybrid integration, you don’t need to call getVisitorCode. However, you can still call it to generate a random visitor code.Is the domain mandatory for the SDK or getVisitorCode?
Is the domain mandatory for the SDK or getVisitorCode?
getVisitorCode requires domain installation. Otherwise, you may get different variations for one visitor, since it will have different visitor codes on different subdomains of your site.If I'm using a hybrid integration, do I need to handle consent twice?
If I'm using a hybrid integration, do I need to handle consent twice?
How do ad blockers affect Kameleoon?
How do ad blockers affect Kameleoon?
engine.js) and client-side SDKs, which rely on JavaScript code loaded on your website. Server-side SDKs, however, operate within your servers, unaffected by ad blockers.If you want to include users with ad blockers in your experiments, Kameleoon offers a premium option that allows you to use a custom domain instead of Kameleoon’s default domain. Custom domains prevent ad blockers from detecting and blocking Kameleoon. Once configured, Kameleoon uses your custom domain for all outgoing network requests to Kameleoon’s servers, whether for tracking purposes, or fetching SDK configuration updates.Using a custom domain isn’t the same as self-hosting. When you use a custom domain, Kameleoon’s infrastructure still hosts and serves all the content (for example, engine.js, SDK configuration, tracking calls). The difference is that Kameleoon routes these requests through a domain you control, like experiments.mydomain.com.To enable this option, contact your Technical Account Manager. You must provide a full domain (for example, experiments-mydomain.com), not a subdomain (for example, experiments.mydomain.com). The domain name can’t contain the substring kameleoon.- For Web Experimentation, replace references to the default Kameleoon domain (
kameleoon.) with your custom domain.- Example:
//SITE_CODE.{your-domain}/engine.js
- Example:
- For client-side SDKs, use the
networkDomainparameter in the SDK initialization.