Skip to main content
A custom analytics integration sends Kameleoon bucketing data to an analytics platform that has no built-in integration. You define a JavaScript script once in Admin > Integrations, then install it on the projects that need it. Kameleoon has code samples for more than 20 analytics platforms, such as Hotjar, Amplitude, and Google Analytics 4.

New custom analytics integration

To create a new custom analytics integration:
  1. Log in to your Kameleoon app.
  2. Click Admin > Integrations.
    Integrations page under Admin, with the Custom integration button in the top right
  3. Click Custom integration in the top right of the page. The New custom integration page opens on the Integration details step.
    New custom integration page on the Integration details step, with the Integration name, Custom icon, and Description fields
  4. Enter a name in the Integration name field. Optionally, upload a JPG, PNG, or SVG file in Custom icon (recommended size: 256 × 256 px) and add a Description. Kameleoon shows the icon in integration lists and on detail pages, and uses a default icon when you upload none. Click Next.
  5. On the Define your integration script step, choose your third-party tool from the Use a pre-built template dropdown list and click Import. The corresponding script automatically populates the JavaScript code insert.
    Define your integration script step, with the pre-built template dropdown and the JavaScript code editor
  6. Optionally, edit the script in the insert.
  7. Click Create.
Kameleoon adds your analytics solution to the list of your integrations.

How the JavaScript code insert works

The JavaScript code insert runs every time Kameleoon makes a bucketing decision for a given campaign. You write the logic that sends additional properties to your analytics platform. The Variables panel next to the insert lists the available variables:
  • experimentID
  • experimentName
  • personalizationID
  • personalizationName
  • variationID
  • variationName
The script you define in the JavaScript code insert serves as the default template when you or your team members install the integration on specific projects.
Kameleoon includes the code from this section in the kameleoon.js file, which visitors’ browsers load. Anyone can read that code in the browser, so don’t add API keys, passwords, or other private credentials to it.

Manage a custom analytics integration

To manage a custom analytics integration, open it from Admin > Integrations. The integration page has three sets of controls:
  • Click Install in the header to install the integration on projects.
  • Click the three dots menu at the top right of the header to find Edit and Delete. Edit opens the integration details, where you change its name, description, and code.
  • On the Projects tab, click the three dots menu at the end of a project’s row to find Set as default, Disable, and Select multiple projects.
The following sections explain how to install the integration, set it as the default, disable it for a project, and delete it.

Install the integration on projects

To enable the integration on one or more projects:
  1. Click Admin > Integrations, then open your custom integration.
  2. Click Install in the header. The Install [integration name] to your projects page opens.
  3. Select the projects where you want to enable the integration. Use the search field to find a project by name or site code.
  4. Click Install.

Set the integration as default for a project

Setting an integration as the default pre-selects it in every new A/B test, personalization campaign, and feature flag in the project.
  1. Open your custom integration and click the Projects tab.
  2. Click the three dots menu at the end of the project’s row.
    Projects tab with the three dots menu open for a project, showing Set as default, Disable, and Select multiple projects
  3. Click Set as default.
Kameleoon confirms with an Integration selected by default notification. The integration is pre-selected for all future campaigns in this project. This action has no confirmation popup.

Disable the integration for a project

Disabling an integration for a project stops the campaigns in that project from sending data through it.
  1. Open your custom integration and click the Projects tab.
  2. Click the three dots menu at the end of the project’s row.
  3. Click Disable. The Disable integration popup opens.
    Disable integration popup listing the active A/B tests and personalizations with their live count, and the name confirmation field
  4. Review the active items, grouped by type, with a live count for each. The popup states that these items stop sending data through the integration.
  5. Under Confirm to continue, type the integration name in the field. The Disable integration button stays inactive until the text matches the name.
  6. Click Disable integration. To keep the integration enabled, click Cancel or close the popup instead.
If campaigns in the project are currently live, the popup opens with an Ongoing experiences detected warning. Disabling the integration affects those live campaigns. To disable the integration for several projects at once, click Select multiple projects in the same menu. The popup then lists each selected project with its live campaign count and campaign types, and the confirmation works the same way.

Delete the integration

Deleting an integration stops all campaigns from sending data to your tool through it.
  1. Open your custom integration from Admin > Integrations.
  2. Click the three dots menu at the top right of the header.
    Custom integration header with the three dots menu open, showing Edit and Delete
  3. Click Delete. The Delete integration popup opens.
  4. Review the active items, grouped by type, with a live count for each. The popup states that deleting the integration stops sending data from these campaigns to your tool whenever a Kameleoon campaign is exposed.
    Delete integration popup listing the affected A/B tests with their live count and the name confirmation field
  5. Under Confirm to continue, type the custom integration name in the field. The Delete integration button stays inactive until the text matches the name.
  6. Click Delete integration. To keep the integration, click Cancel or close the popup instead.
If campaigns are currently live, the popup opens with an Ongoing experiences detected warning. Deleting the integration affects those live campaigns.

Associate your custom analytics integration with a campaign

In the Graphic/Code editor

When finalizing your experiment, click Integrations to configure your custom analytics as a tracking tool. The summary pop-in mentions your analytics tool before going live. Kameleoon automatically transmits the data, and you can view your results in the analytics tool.

On the personalization creation page

You can select your custom analytics among the reporting tools for a personalization.

On the Results page

Once you define your custom analytics integration as a reporting tool for a campaign, you can select or clear it via the Results page. To do this:
  1. Click the three dots menu in the top right of the screen.
  2. Select Experiment configuration (Open configuration for personalization). A side menu appears.
  1. Scroll to the Reporting tools section, then click Edit. The Finalization page appears.
  2. Click Integrations.
  3. Click Activate on the tool.
  4. To save this step, click Next.

On a feature flag

To add your custom analytics tool to a feature flag:
  1. Click Edit on the feature flag you want to track.
  2. Click Integrations in the Reporting section. All the integrations you’ve enabled appear.
  3. Toggle your custom analytics tool on for Delivery rules, Feature experiments, or both.
Learn how to manage third-party analytics integrations