Consent management
Depending on the country you are operating your website in, you may need to manage consent before collecting any data about your visitors. For more details, see the consent management documentation.Cross-device history reconciliation
Kameleoon’s cross-device history reconciliation feature merges a user’s history and actions across different devices. When a user visits a website multiple times via different devices, Kameleoon identifies them as a returning visitor and accurately reports the number of visits. This feature is straightforward to enable as long as you can identify users, usually through a customer login. By using cross-device history reconciliation, you gain three significant benefits:- A coherent targeting system that takes into account all visits and actions across devices.
- Ensuring that a visitor sees the same variation for a given A/B experiment, regardless of the device they’re using.
- A precise and accurate reporting system that correctly counts unique visitors.
ITP management
If a significant portion of your website’s traffic comes from mobile devices, implement a cookie synchronization method to prevent issues with Intelligent Tracking Prevention (ITP) on Safari. For more technical details about ITP management, refer to the documentation. There are several options available for synchronizing the visitorCode identifier (via the kameleoonVisitorCode cookie) between the frontend and backend to avoid ITP issues on Safari. These options include:- Modifying your front-facing web server or Content Delivery Network (CDN) configuration to generate and add the kameleoonVisitorCode cookie. Kameleoon can provide instructions for Akamai.
- Implementing a specific code snippet on your backend server (Java, NodeJS, or another language).
Nginx code snippet
For integration with Nginx, use the following code snippet:Backend code snippets
You can host one of the backend code snippets either on a single URL belonging to your main top-level domain or on every page. If you opt for a single endpoint, Kameleoon makes one call per session to the specified endpoint to ensure that your server sets the kameleoonVisitorCode cookie. This call is asynchronous and occurs after the page has finished loading. Contact your Technical Account Manager to activate this option. Kameleoon will need your chosen URL.The synchronization endpoint you create shouldn’t return any data. A
204 No Content response code is sufficient. This endpoint is solely used to set a server-side cookie and should accept a GET request sent to the sync URL you define, using the following code:You can provide your own visitor code, typically a unique identifier from your database, instead of relying on automatic generation. Ensure the visitorCode you provide is unique for each visitor to help ensure accurate data for your experiments.
getVisitorCode() method. This helper method automatically retrieves the Kameleoon visitor code for the current visitor and creates the cookie on the back end.
Java
NodeJS
PHP
C#
- .NET Core
- .NET Framework
Go
Python
Ruby
Using a custom domain
If you want to use your own domain instead of Kameleoon’s default domain, or if ad blockers stop some users from entering experiments, Kameleoon offers a premium option to set up a custom domain and bypass detection. Learn more about how to enable a custom domain.Using your own CDN or hosting server (self-hosting)
The Kameleoon application fileengine.js (previously named kameleoon.js), which you can host either on the Kameleoon CDN or on your own CDN or servers. Hosting it on your own servers can offer a slight performance improvement by avoiding an additional DNS query and SSL handshake that the Kameleoon CDN requires. Additionally, you may choose self-hosting for security reasons, as you can ensure compliance with your internal security policies and take responsibility for the security of your hosting servers.
If you want to self-host the Kameleoon application file, see the self hosting documentation.
FAQ
Can I use my server to act as a proxy for Kameleoon's tracking calls?
Can I use my server to act as a proxy for Kameleoon's tracking calls?
Yes, Kameleoon offers this advanced option. Forward all HTTP requests received on your server to
(eu|na)-data.kameleoon.(eu|io). For example, if you choose tracking.yourdomain.com as your tracking domain, a tracking request would be a POST to tracking.yourdomain.com. Your server should then forward the request, along with all necessary data and parameters, to the (eu|na)-data.kameleoon.(eu|io) host. To enable this option, contact your Technical Account Manager.How do ad blockers affect Kameleoon?
How do ad blockers affect Kameleoon?
Certain ad blockers can block Kameleoon, like many experience optimization solutions. These primarily affect the Web Experimentation application file (
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 dedicated domain that you provide, such as experiments-mydomain.com.To enable this option, contact your Technical Account Manager. You must provide a dedicated full domain, such as 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.experiments-mydomain.com/engine.js
- Example:
- For client-side SDKs, use the
networkDomainparameter in the SDK initialization.