Skip to main content
Visit our academy for a video tutorial on setting up goals. Without goals, an experiment can only tell you which variation each visitor saw—not whether any variation actually improved your site’s performance. A goal defines what counts as a conversion, so Kameleoon can measure whether your campaign is achieving the outcome you care about. To start measuring, link your experiment to one or more goals. All goals you create in Kameleoon are available on the Goals page in the Settings menu.

Access the Goals page

To access your goals, click Settings > Goals. By default, the Retention rate goal is included for all sites associated with your Kameleoon account. This goal records the number of visitors who open at least one other page after the landing page.

Create a new goal

To create a new goal, go to Configure > Goals in the left-hand menu. Click New goal. In the pop-in, enter a name for your goal, select the associated site, and choose a type. You can choose from seven types of goals:
  • Click tracking
  • Scroll tracking
  • Access to a page
  • Custom goal
  • Time spent
  • Number of pages viewed
  • Retention rate
If you have protected your website using an iframe, the creation of a goal in the app may not be possible.

Click tracking

Visitors achieve the Click tracking goal by clicking a specific element on your website. To set up this goal, select Click tracking from the drop-down menu and click Next. The window expands to display the setup options.
Enter the URL you want to use to select your target element. Then, click the element you want to track or enter its CSS selector.
Kameleoon tracks clicks on the selected element across your entire website. The page you use to configure the tracker does not limit where the goal can convert. If multiple pages feature elements with the same CSS selector, Kameleoon records a conversion whenever a visitor clicks any of those elements. To track clicks on an element on a specific page only, you must use a CSS selector unique to that page.
Once you choose an element, an orange pointer appears, confirming that click tracking is active. You can apply click tracking to multiple elements. The number of selected click trackings is indicated above the window.
You can also switch to navigation mode to browse your pages.
If your website is protected from being shown in an iframe (the X-Frame-Options header is used in the server settings), your URL won’t be displayed in this pop-in, and you can’t add click tracking. You must change your server settings and add an exception for the kameleoon.com domain and subdomains.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.
Click Create to create your goal.

Scroll tracking

Scroll tracking lets you determine the percentage of visitors who scroll to a specified section of your page. To set up this goal, choose Scroll tracking in the drop-down menu of the pop-in and click Next. The pop-in now shows the setup options for the goal. Enter the URL of the page where you want to apply scroll tracking.
If your website is protected from being shown in an iframe (the X-Frame-Options header is used in the server settings), your URL won’t be displayed in this pop-in, and you can’t add click tracking. You must change your server settings and add an exception for the kameleoon.com domain and subdomains.
The limit between the shaded and non-shaded area determines the scroll tracking level. To meet the goal, the visitor must scroll down to the shaded part of the page. There are three different ways to define scroll tracking depth:
  • A precise percentage: The percentage is applied to the entire website. The percentage is defined relative to the top of the page: 0% places the level at the very top, 50% in the middle, and 100% at the very bottom of the page.
  • A height in pixels: Zero pixels corresponds to the very top of the page. The lower you set the level on your page, the higher the pixel count. The maximum height in pixels correlates with the page size.
  • The selected element: Visualize the elements of your page by hovering over them and clicking on the element of your choice. The level will be positioned directly below the selected element.
If you choose a percentage or a height in pixels to determine the scroll tracking level, you can move it by dragging it to the position of your choice.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Access to a page

The Access to a page goal is met when the visitor accesses the page you defined. To set up this goal, choose Access to a page in the drop-down menu of the pop-in and click Next. The pop-in shows the setup options for the goal.
Enter the page the visitor must visit to reach the goal. There are three options:
  • Choose contains to target all the pages sharing the same URL fragment.
  • Choose matches exactly to target only the page with the exact URL you entered.
  • Choose matches the regular expression to target a URL and its variations according to the regular expressions you are using. For help creating regular expressions, see Regular expressions.
URL fragments and regular expressions are case-sensitive.
Example: Your product page URLs are typically structured like this: https://www.mysite.com/products/product-1 Here’s how to apply your Access to a page goal for different scenarios:
  • To a specific product page:
    • Select matches exactly and enter the full, precise URL. For example: https://www.mysite.com/products/product-1
  • To all product pages:
    • Select contains and type in /products/. Your goal will then apply to all pages that include the /products/ fragment in their URL.
  • For URLs with common variations (for example, “product” vs. “products”):
    • If your product page URLs sometimes contain “product” instead of “products”, use a regular expression. For instance, https://www.mysite.com/products* will match URLs containing either “products” or “product” at that point.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Ratio Metrics

For more information on creating a Ratio Metrics goal, refer to the Ratio Metrics article.

Custom goal

To set up a custom goal, select Custom goal in the Type drop-down and click Next. The pop-in shows the available setup options.

Option 1: Using a front-end event triggered by our JS Activation API

Choose this option if the conversion event happens in the user’s browser (client-side).
  • How it works: Kameleoon provides a specific function (Kameleoon.API.Goals.processConversion(ID), where ID is your goal’s unique identifier) that you insert into your JavaScript code. When the user performs the action you are tracking, your code executes this function to send the conversion signal directly to the Kameleoon platform.
The goal’s ID will be generated once the goal is created.
Click the Copy icon to copy the event code and implement it in your JavaScript (or pass it along to your development team for implementation). For more information on the processConversion() method, see this article.

Option 2: Using a back-end event via SDK (e.g., Node JS)

Choose this option if the conversion event happens on your server (backend). This method is necessary for tracking actions that do not rely on the user’s browser session (for example, successful payment processing). How it works: The Kameleoon server-side SDK uses a specific method (trackConversion()) to communicate the conversion event directly from your server to the Kameleoon platform. Click the Copy icon to copy the SDK event code and pass it to your backend development team for implementation. Code example:
  • visitorCode is the visitor’s unique identifier you want to target.
  • goalId is the goal’s unique identifier.
The goal’s ID will be generated once the goal is created.
For more information on the trackConversion() method, see this article.

Option 3: Using custom JavaScript code

Choose this option if you need to run specific JavaScript logic to determine when to trigger the goal. Custom JavaScript is the most flexible option and is useful if you need to dynamically calculate revenue or capture additional metadata before sending the conversion signal.
  • How it works: The code you enter in the text field runs automatically once your site is ready. Within that code, use the triggerGoal() method to fire a conversion. You can also optionally pass revenue and metadata parameters.
Enter your custom JavaScript code directly into the provided text field. For more information on using custom JavaScript code for custom goals, see Kameleoon’s developer documentation.
Alternatively, if you are initiating a conversion from a tag management system (for example, Google Tag Manager), you should use the Kameleoon Command Queue, which allows you to delay the command’s execution until the Kameleoon engine finishes loading. In Google Tag Manager, go to GTM > Tags > New > Tag Configuration > Custom HTML > insert the following code:
Then, select the trigger that will send the goal conversion call to Kameleoon. For more information about Kameleoon.API.Goals, see the API reference.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Time spent

This goal is met when the visitor spends a certain amount of time on your site. To set up this goal, choose Time spent in the drop-down menu of the pop-in and click Next. The pop-in shows the setup options for the goal.
Enter the time the visitor must spend on your website to meet the goal. Choose a limit:
  • more than: The visitor must spend at least a given time on the page
  • exactly: The time spent must match exactly
  • less than: The time spent must not exceed a given duration
Enter a value and select a unit from the drop-down menu: seconds, minutes, or hours.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Number of pages viewed

This goal is met if the visitor has viewed a certain number of pages. To set up this goal, choose Number of pages viewed in the drop-down menu of the pop-in and click Next. The pop-in shows the setup options for the goal.
Enter the number of pages the visitor must view to reach the goal. You can choose from an exact number, a minimum, or a maximum.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Retention rate

This goal is one of the default settings for all new websites in your account. The retention rate records the number of visitors who clicked at least once on their landing page. To set up this goal, choose Retention rate in the drop-down menu of the pop-in and click Next. The pop-in shows the setup options for the goal.
The goal is already configured. Enter a name and, optionally, a description.
To access advanced setup options, click Advanced settings in the bottom left-hand corner of the pop-in.

Advanced settings

Click Advanced settings in the bottom left corner of the pop-in to access advanced setup options.
The pop-in contains several sections.

Use this goal with AI Predictive Targeting

Enable this option to use predictive targeting for your goal. In real time, machine learning identifies patterns that affect the goal and estimates each visitor’s conversion probability, so you can target visitors based on their likelihood to convert. Select which triggers you wish to make predictions at for this goal. More about triggers

Send to external tools

This section lets you send a conversion event to selected external tools when Kameleoon triggers this goal. This option is only available for Google Analytics 4, Universal Analytics, Mixpanel, and Segment. You can send the following types of goals to external tools:
  • Click tracking
  • Scroll tracking
  • Access to a page
  • Custom goal
  • Time spent
  • Number of pages viewed
  • Retention rate
The code below defines the available goal types:
Google Analytics 4Once the integration is set up in Kameleoon, goal conversions are sent to GA4 automatically. No additional GA4 configuration is required to receive them.Each goal conversion appears in GA4 as an event with the same name as your Kameleoon goal. For example, if your goal is called Purchase complete, it appears in GA4 as a Purchase complete event. Each event includes the following parameters:
  • type — the goal type (for example, CLICK or CUSTOM)
  • id — the Kameleoon goal ID
  • source — always Kameleoon
  • revenue — only included when you pass a revenue value with the conversion
You don’t need to manually create these as Custom Events in GA4 for Kameleoon to send them. However, if you want to mark them as GA4 conversions or create audiences from them, you must configure those manually in GA4 after the data starts arriving.Google Tag Manager: If your site uses GTM, Kameleoon pushes goal events into the dataLayer rather than sending them directly to GA4. You must configure a GTM tag and trigger to forward those events to GA4. The dataLayer is also a useful place to verify that goal events are firing correctly before checking GA4 reports. For setup instructions, see Google Tag Manager.

Display this goal only for specific campaigns

This section lets you control which campaigns track a goal. By default, all your goals are active in every experiment. To exclude a goal from specific campaigns, specify which campaigns should not track the goal. The drop-down menu includes three criteria to limit the application range of this goal:
  • Name of the campaign: check the boxes next to the experiments you want to apply this goal to;
  • Type of campaign: select the type of experiment you want to apply the goal to (clicking on Experiment makes the goal available for all experiments on the website the goal applies to; same thing for Personalization);
  • Tags: by selecting a tag, the goal is applied only to the campaigns linked to this tag.

Handle outliers

This option is only available for Custom goals. More about Winsorization at Kameleoon

Metadata

What is metadata?

Metadata are additional properties attached to a goal conversion. They let you filter or breakdown your results by specific values (for example, payment method, delivery type). For example, if you want to track how many “Purchase” conversions happened with each payment type, you can use metadata to capture that value.

Using metadata

To use metadata:
  1. Define a custom data. For more information, see Create custom data.
  2. Link the custom data as metadata when creating or editing a goal by selecting it from the drop-down.
Custom data with the option Use this data only locally for targeting purposes will not be considered, as it is not sent to our servers.