Documentation Index
Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
Use this file to discover all available pages before exploring further.
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. Your projects may be hosted 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?
- Wait 30-60 minutes for the Kameleoon server to confirm a visit. Every time the same visitor lands on the website, Kameleoon creates a new visit. The visit ends as soon as Kameleoon doesn’t receive new activity events (for example, exposure to a campaign, page view, scroll, clicks) in the last 30 minutes. Kameleoon creates a new visit after 30 minutes of inactivity.
- If you have enabled bot filtering in the project settings, there might be an error with the user-agent value being set on the SDK. Refer to this article for more details.
- Legal Consent is set to Required in the project settings, but the setLegalConsent SDK method has not been called. Refer to this documentation for more details.
- None of the SDK methods that send a tracking request to Kameleoon servers were used.
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 cannot track visitors in theOFFvariation. - Missing visitor data: The SDK does not 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?
When is it a good time to flush data?
When is it a good time to flush data?
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 data is included in visitor targeting.Why isn't my experiment collecting data?
Why isn't my experiment collecting data?
-
In The Kameleoon App
- The rule is created for the correct environment (production, staging, or development).
- The rule is enabled (turned on).
- The rule targets traffic that can actually be exposed.
- If bot filtering is enabled on your project, add User Agent to the filter.
-
In the SDK
- The KameleoonClient is created with the correct configuration (siteCode, environment variable, and, if applicable, networkDomain).
- getVisitorCode is called only once, and its value is reused wherever the visitorCode is needed
- If using hybrid mode (engine.js on the front), the visitorCode is correctly synced with the front end.
- For experiment rules, setLegalConsent(true) is called to ensure data collection is allowed.
- For delivery rules, isFeatureActive() (or getVariation()) is called, and it returns true (or the expected variation).
- For experiment rules, getVariation() is called, and it returns the expected variation.
-
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, a request is sent every 1000 milliseconds (1 second). You can change this interval by setting the tracking interval value.
- On demand: Instantly, if a method like
flush(instant=true)is called in your code.
getVariation(whentrackis set totrue).getVariations(whentrackis set totrue).isFeatureActive(whentrackis set totrue).trackConversionflush(with or withoutinstant=true)
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), which are used to display statistics in the 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 can be called when you need to know whether the flag is active, but do not need to know the exact variation received for the visitor. When using Experiment rules, it is 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 is essential to call the getVisitorCode method. This ensures consistent visitor recognition between the browser and the server, and guarantees 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 are using a hybrid integration (web-site <-> server sdk, js sdk <-> server, engine <-> server sdk). When calling getVisitorCode, the visitor code will be obtained, and transmitted using a cookie. If you do not 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. 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 and are unaffected by ad blockers.If you want users with ad blockers to be included 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 will use your custom domain for all outgoing network requests to our servers, whether for tracking purposes or fetching SDK configuration updates.Using a custom domain is not 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 these requests are routed 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 cannot 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.