Skip to main content
Watch the video tutorial in the Kameleoon Academy to learn how to set up goals. An experiment alone can only tell you which variation each visitor saw, not whether that variation improved your site’s performance. Goals close that gap: each one defines what counts as a conversion, so Kameleoon can measure whether your campaign achieves the results you’re testing for. Link one or more goals to your experiment to start measuring. 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, Kameleoon includes the Retention rate goal for all sites associated with your account. This goal records the number of visitors who click at least once after landing on the first page of their visit.

Create a new goal

If you have protected your website using an iframe, the creation of a goal in the app may not be possible.

Name and describe your goal

To name and describe your goal:
  1. Click New goal on the Goals page. The Add a new goal modal opens.
  2. Fill in the details Kameleoon needs to identify your goal:
    • Name: A name for your goal.
    • Project: The site the goal applies to, chosen from a dropdown of your site URLs.
    • Description (optional): Up to 120 characters describing the purpose of your goal. This information helps you analyze results later.
    • + Add tags: Attach one or more tags to the goal for later filtering.
  3. Click Next to continue, or Cancel to close the modal without creating the goal.

Choose a goal type

Clicking Next opens the Add a new goal modal, showing a categorized grid of goal type cards: Standard goals
  • Click tracking: Triggered when a user clicks on a specific element.
  • Time spent: Triggered when a user spends a defined time on your site.
  • Access to a page: Triggered when a user visits a specific page.
  • Retention rate: Triggered when a user clicks after landing on the first page of their visit.
  • Number of pages viewed: Triggered when a user views a defined number of pages.
  • Scroll tracking: Triggered when a user reaches a certain percentage of the page height.
Advanced
  • Custom Goal: Target highly specific visitor behaviors by defining your own events.
  • Data warehouse tracking: Sync events from Snowflake, BigQuery, or other external data sources.
Formula metrics
  • Ratio metric: Measure relative performance by dividing one metric goal by another.
To choose a type:
  1. Select a card.
  2. Click Create to continue, or Back to return to the previous modal without selecting a type.
Clicking Create opens the Define your goal page, which uses a two-step progress stepper with Step 1, Define triggering conditions and Step 2, Advanced settings. Step 1 shows a green checkmark once it’s complete, and Step 2 becomes available only after that. The fields on Step 1 depend on the goal type you selected.

Click tracking

Choose how you want to define the element that triggers a conversion:
  • With the Visual Editor: Select the interactive element you want to track with the graphical editor.
  • Using CSS selector: Specify the CSS selector of the element you want to track.
  • From an existing experiment: Track an element that was previously added in one of your variations.
  • With the Prompt-based Editor: Describe the element you want to track, and Kameleoon generates the goal.
Kameleoon greys out the Prompt-based Editor option and marks it as not yet available, matching the scroll tracking visual picker described below.

Using CSS selector

  1. In the Click targets field, enter one or more selectors, separated by commas.
  2. Clicking + Add selector opens a dropdown with the same four methods: with the Visual Editor, using a CSS selector, from an existing experiment, or with the Prompt-based Editor, which stays off. Choose one to add another target using a different method.

Manually with the Visual Editor

  1. An Open visual editor dialog asks “On which page (URL) do you want to track clicks?” and prefills the field with your site’s URL. Click Open Editor to continue, or Cancel to close the dialog.
  2. The editor opens a split view: your live site renders on the left, and a Define click tracking panel opens on the right. Click each element you want to track in the preview area. Clicking an element:
    • Adds a highlighted outline box around the element in the preview, confirming your selection.
    • Auto-fills the panel’s Selector field with the element’s CSS selector. For example, clicking a button auto-fills a selector like #pbx-btn-send.
  3. Use the field’s clear (X) control or its three-dot options menu to adjust a selection, or click + Add selector to pick more elements. Click Next to save your selections, or Cancel to close the editor without saving.

Choose where to track this goal

Regardless of which method you use to define the target element, choose where the click counts as a conversion:
  • Anywhere on the site (default): Records a conversion whenever a visitor clicks the element. If several pages share the same CSS selector, every matching click counts.
  • Only on specific pages: Records a conversion only when the click happens on a page that matches URL conditions you define. Selecting this option reveals a URL-condition builder: choose a match type (for example, URL contains) and enter a URL in the text field, such as www.kameleoon.com/products/. Click + Add target URL to add further conditions.
If several pages share the same CSS selector, use Only on specific pages to scope the goal to a single page instead of relying on a page-unique selector.
If your server settings use the X-Frame-Options header to block your website from displaying in an iframe, the visual editor doesn’t display your URL, and you can’t add click tracking this way. You must change your server settings and add an exception for the kameleoon.com domain and subdomains.

Scroll tracking

Step 1 for a Scroll tracking goal has two tabs, Manual (selected by default) and Visual picker.
Kameleoon greys out Visual picker and marks it as not yet available, so the selected-element mode described below stays manual-only for now.
Under Manual, configure:
  1. URL of the page: The URL of the page on which you want to create the scroll tracker.
  2. visitor scrolls down to: How Kameleoon measures scroll depth, chosen from a dropdown:
    • the selected element: Visualize the elements of the page by hovering over them, then click the one you want to use as the scroll target. The level appears directly below the selected element.
    • a precise percentage (default): Enter a percentage of the page height using the numeric stepper, for example 60%. The percentage measures from the top of the page: 0% places the level at the very top, 50% in the middle, and 100% at the very bottom.
    • a height in pixels: Enter a fixed height in pixels using the numeric stepper. 0 pixels corresponds to the very top of the page, and the maximum height correlates with the page size.
If your server settings use the X-Frame-Options header to block your website from displaying in an iframe, the page preview doesn’t display your URL, and you can’t add scroll tracking this way. You must change your server settings and add an exception for the kameleoon.com domain and subdomains.

Access to a page

Enter the page a visitor must reach to convert. Choose one of three match types:
  • contains: Targets all pages sharing the same URL fragment.
  • matches exactly: Targets only the page with the exact URL you entered.
  • matches the regular expression: Targets a URL and its variations, according to the regular expression you enter. 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 an 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 then applies 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* matches URLs containing either “products” or “product” at that point.

Time spent

Enter the time a visitor must spend on your website to convert. 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 dropdown menu: seconds, minutes, or hours.

Number of pages viewed

Enter the number of pages a visitor must view to convert. You can choose an exact number, a minimum, or a maximum.

Retention rate

Kameleoon includes this goal by default for every new site in your account. The retention rate records the number of visitors who clicked at least once after landing on their entry page, so its Step 1 page needs no extra fields once you name and describe it.

Custom goal

The Custom Goal setup page displays three collapsible cards in a two-column layout showing three ways to trigger a custom goal. An up-chevron marks a card as expanded.

Option 1: Using a front-end event triggered by the 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.
Kameleoon generates the goal’s ID once you create the goal.
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 the Activation API reference.

Option 2: Using a back-end event via SDK (for example, Node JS)

Choose this option if the conversion event happens on your server (backend). This method is necessary for tracking actions that don’t 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.
Kameleoon generates the goal’s ID once you create the goal.
For more information on the trackConversion() method, see the Node.js SDK reference.

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 wider code-editor panel 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 panel, which prefills a comment scaffold showing usage examples. Click the fullscreen-expand icon to edit in a larger view. 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), use the Kameleoon Command Queue, which delays the command’s execution until the Kameleoon engine finishes loading. To set this up in Google Tag Manager:
  1. Go to GTM > Tags > New > Tag Configuration > Custom HTML and insert the following code:
  2. Select the trigger that sends the goal conversion call to Kameleoon.
For more information about Kameleoon.API.Goals, see the API reference.

Data warehouse tracking

Select Data warehouse tracking from the Advanced group in the type grid to pull conversion data from an external warehouse instead of tracking events directly on your site. Step 1 shows a Datawarehouse goal header with a Datawarehouse integration dropdown—choose BigQuery, Snowflake, Redshift, or Databricks—plus a Frequency dropdown and a Query textarea. The remaining fields change based on the integration you choose, since each warehouse identifies and connects to your data differently:
  • BigQuery asks for a BigQuery project ID and a Region.
  • Snowflake asks for a Warehouse, a Database, and a Schema.
  • Databricks asks for a Catalog and a Schema.
  • Redshift asks whether your cluster runs in Provisioned or Serverless mode, a Redshift cluster ID, a Region, and a Database.
For the exact fields and query format for your integration, see:

Ratio metric

Select Ratio metric from the Formula metrics group in the type grid to create a goal that divides one existing metric by another. Step 1 shows an A/B builder where you pick both metrics and preview the resulting formula live. For the full configuration walkthrough, see Ratio Metrics.

Metadata

Most goal types’ setup flow ends with an Attach additional data to conversions (Optional) card. Before you add any, it shows “No metadata added yet” with the helper text “Enrich your conversions with custom properties to get deeper insights,” alongside a + Add metadata button. Ratio metric goals are the exception: since they combine two existing goals’ data rather than capturing their own conversions, their setup flow ends directly with the A/B formula builder and has no metadata card.

What’s metadata?

Metadata are additional properties attached to a goal conversion. They let you filter or break down 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 dropdown.
Kameleoon won’t consider custom data marked Use this data only locally for targeting purposes, because it doesn’t send that data to its servers.

Advanced settings

Step 2 of the Define your goal page, Advanced settings, becomes available once Step 1 shows a green checkmark. It has three sections, Properties (which includes outlier handling for Custom goals), Usage, and Data sharing.

Handle outliers

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

Usage

Three toggles control who can use the goal, all off by default:
  • Make this goal only available for specific experiments: By default, this goal is available for all experiments. Enable this toggle to select which ones can use it.
  • Make this goal only available for specific personalizations: By default, this goal is available for all personalizations. Enable this toggle to limit which ones can use it.
  • AI Predictive Targeting: Trains a model on this goal at the key moments you define, to target visitors by their likelihood to convert. Enabling this toggle reveals an Add prediction trigger button. Click it, then select the triggers you want to enable. More about triggers

Data sharing

Select which integrations should receive data when this goal converts. A live “N integrations selected” counter tracks your selections, and a “Can’t find it? Browse integrations” link opens the integrations catalog if none of the listed options match.
Google Analytics 4After you set up the integration in Kameleoon, Kameleoon automatically sends goal conversions to GA4. GA4 doesn’t need additional configuration to receive them.Each goal conversion appears in GA4 as an event with the same name as your Kameleoon goal. For example, if you name your goal 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.
The code below defines the available goal types:
When you finish configuring Step 1 and Step 2, save the goal to add it to your account.

The goal summary page

Saving a goal takes you to its Summary page, where you can review the configuration you just set and continue managing the goal without returning to the Goals dashboard.
Goal summary page showing the Definition and Usage cards, and a sidebar with Data sharing plus project and creation details
The page header shows the goal’s name, status (for example, Active), and Goal ID. Below the header, two tabs organize the page:
  • Insights: the goal’s performance data, including key metrics, a daily events timeline, and impacted campaigns. For details, see Goal reporting.
  • Summary: the goal’s configuration, selected by default right after you create the goal.
The Summary tab groups the goal’s configuration into cards:
  • Definition: the triggering condition you set in Step 1, plus any metadata attached to conversions. Click Edit to change these settings.
  • Usage: the toggles you set in Step 2 that control who can use the goal, plus a Set this goal as your project primary goal toggle that defines this goal as your project’s main success metric. Only one goal can be primary per project. Click Edit to change these settings.
  • Data sharing: the integrations you selected in Step 2 to receive data when the goal converts, or No data sharing tools if you didn’t select any. Click Edit to change this setting.
A sidebar next to the Definition and Usage cards lists the goal’s Project, what it’s Linked to (for example, an experiment, or Not set if it isn’t linked to any campaign), its Last modification and Created dates, and its Creator.