Skip to main content
Over time, as experiments, segments, and goals accumulate, your testing environment can become cluttered, which causes inefficiencies and potential errors. Regularly reviewing and cleaning up outdated elements is essential to maintaining a streamlined, high-performing Kameleoon setup. This article outlines the key steps to identifying and removing obsolete experiments, segments, and code to reduce technical debt, improve accuracy, and ensure a smoother workflow for your optimization efforts. Debt cleanup is a time investment that pays off. Cleaning up technical debt, whether outdated experiments, unused segments, or unnecessary code, greatly improves performance in the long run. Before implementing the actions listed below, save a performance benchmark of your website so you can measure the improvements afterward.
  • 🧪 Use PageSpeed Insights (or any other performance analysis tool you’re comfortable with) to analyze your site (desktop and mobile). Once the tool generates the report, click Copy Link (top-right). Copying the link saves the report with data from the exact day of analysis (see screenshot below).
  • 🧩 Use the Kameleoon Chrome Extension to check performance and the size of experiments segments, goals, custom data and custom scripts. See screenshot below.
Once you’ve completed the cleanup actions below, run both analyses again and compare the results to see the impact of your optimizations.

1. Web experiments/personalizations

On the Experiments page:

Delete outdated draft experiments

Use the menu on the right to filter for draft experiments, then delete all experiments older than 3 months (use the key date filter), along with recent ones you no longer need. To do this:
  1. Right-click an experiment’s three-dots menu and click Select.
  2. Click Select all experiments.
  3. Choose Delete from the right menu. Alternatively, you can Archive them.

Stop paused experiments

Filter for paused experiments, then stop all experiments older than 3 months and any recent experiments you’re certain you won’t relaunch. Since bulk selection isn’t available for stopping experiments, you must manually select them one by one and click Stop in the right menu.

Divert/stop online experiments

Filter for online experiments and divert 100% of traffic to the winning variation if the data is reliable. This diversion ensures all visitors benefit from the optimized version without splitting them across variations. You can divert traffic in the experiment traffic allocation settings. If the winning variation is the original, you can stop the experiment.

Transfer and clean up diverted experiments

Filter for diverted experiments, then request your IT team to integrate the winning variation’s code into the site’s source code. Once implemented, stop and archive the experiment, which has the benefits of:
  • Eliminating unnecessary experiment scripts and improving page load speed.
  • Ensuring all users experience the optimized version without experiment conditions, since ad blockers, for example, may block tools like Kameleoon.
  • Reducing the risk of conflicts between old experiments and new optimizations.

Archive stopped experiments

Filter for stopped experiments, then archive all remaining stopped experiments. To do this:
  1. Right-click an experiment’s three-dots menu.
  2. Click Select > Select all experiments.
  3. Click Archive in the right menu. Alternatively, delete them.
For Personalizations, follow the same steps as for experiments. For Feature Flags, see Manage feature flag technical debt.

2. Segments/triggers

On the Segments and triggers pages:

Delete outdated draft segments

Use the right menu to filter for segments attached to “0 campaign”, then delete all segments older than 3 months (use the “key date” filter), along with recent ones you no longer need. To do this:
  1. Right-click a segment’s three-dots menu.
  2. Click Select > Select all experiments > Delete
When applying the filter, some segments may still appear linked to campaigns. These segments link to archived campaigns. To identify them, hover over the i icon: archived experiment names appear grayed out (see screenshot below).

Optimize segments based on JS

Filter for segments linked to at least 1 campaign. Then, follow the guidelines in Writing efficient custom code in Web Experimentation to optimize all segments based on a “JS custom condition.” To identify these segments quickly, open your website’s browser console and run the following code:
The code returns the list of segments that use a JS custom condition (see screenshot below).
Kameleoon moves the JS condition to Triggers as of Q3 2025.

Rename segments

Kameleoon runs all segments created or modified in your account within the past 90 days, even if no experiment uses them, as long as their targeting conditions don’t include “page URL” or “Custom JavaScript.” Kameleoon uses this process for opportunity detection. If you want to exclude certain segments from this process, you can rename them using one of the following prefixes: [DEV], [TEST], or [QA].

3. Goals

On the Goals page:

Disable unconverted goals

Use the menu on the right to filter for goals linked to “1 or more campaign(s)”. Then, disable any goal that hasn’t recorded a conversion in the last 24 hours, if you think it’s no longer relevant. To check the conversion count, hover over the i icon for each goal. A pop-in shows the number of conversions in the last 24 hours (see screenshot below).

Delete unused goals

Filter for goals attached to “0 campaign”, then delete any you no longer need. Even if not linked to a campaign, active goals still run online, so removing unused goals helps improve performance. To do this:
  1. Right-click a goal’s three-dots menu.
  2. Click Select > Select all experiments.
  3. Click Delete in the right menu. Alternatively, you can Disable them.

Delete inactive goals

Filter for “inactive” goals, then delete all those you no longer need.

4. Custom data

All custom data runs online, so removing unused custom data helps improve performance. On the Custom data page:

Delete unused custom data

Delete all custom data you no longer need.

Optimize custom data based on JavaScript

If a custom data uses custom JavaScript code, ensure the code doesn’t run in an infinite loop. To avoid performance issues, see Custom code written in JavaScript. To identify which custom data use JavaScript, visit your website, open the browser console, and run the following code:
The code will return the list of custom data using JavaScript (See screenshot below).

5. Global script

Once you’ve completed all the preceding steps, navigate to: Admin ⇒ Projects ⇒ Configuration ⇒ General ⇒ Global custom script, then remove any code in the script that references the deleted segments, goals, or custom data. To optimize your Global Script further, follow the guidelines outlined here. These tips will help ensure your code runs efficiently, remains maintainable, and performs well across all experiments.
To make refactoring the Global Script easier and safer, you can split it into two versions using a cookie condition. This cookie condition lets you test the new script live in your browser while keeping the original script active for all other visitors.Just add a custom cookie, like newKamGS=true, in your browser, then use the following code to conditionally load the Global Script: