Skip to main content

Create a trigger

A trigger defines the specific conditions that must be met for an experiment or personalization to activate. You use triggers to target visitors based on their real-time behavior or visit characteristics.

note

The new Trigger Builder is in active beta, and is restricted to Beta Program users. To join, refer to the Kameleoon Beta Program article

Access the Trigger Builder

To start creating a new trigger:

  1. In the left sidebar, click Settings > Triggers.
  2. Click New trigger.
  3. In the New Trigger window, enter a name for your trigger.
  4. Select the Project you want to associate with this trigger.
  5. (Optional) Add a description and tags to help organize your triggers.
  6. Click Next.

Define conditions

The Trigger Builder is where you define your trigger's logic. You select conditions from the sidebar and configure how they relate to one another.

  1. Select a condition: In the left sidebar, scroll through the list or use the search bar to find a condition (for example Number of visits). Click the condition to add it to the builder.
  2. Configure the condition: Enter the relevant values for the condition (for example 3 visits).
  3. Add more conditions: To add another layer of targeting, click Refine on an existing condition or select a new condition from the sidebar.

Manage logic (AND/OR)

When you use multiple conditions, you must define how they work together using the dropdown menu at the top of the Trigger Builder or condition group:

  • If all (AND): The trigger fires only if every condition in the group is met.
  • If any (OR): The trigger fires if at least one of the conditions in the group is met.

Create complex groups

You can group conditions together to create advanced logic (nested conditions).

  • Reorder: Click and drag a condition to move it up or down in the list.
  • Nest (Group): Click and drag one condition on top of another to combine them into a subgroup with its own independent logic (If any/If all).
    • For example, you can create a condition that targets visitors who have visited the site three times today AND viewed a certain product page at least once.

Copy or delete conditions

  • Copy: Click the Copy icon to clone a condition.
  • Delete: Click the X icon to remove a condition.

When you are satisfied with your conditions, click Next.

Review and save

After you click Next after defining your trigger, a summary panel opens on the right. Here, you can see its settings and definition. You can expand either section to see more information.

  • Settings: Displays the trigger name, project, campaign type, description, and tags. Click the pencil icon to edit any of these settings, then click Save changes.
  • Definition: Displays your trigger's definition. You can view a visual summary under the Block Summary tab or a text-based summary under the Written Summary tab.

Click Create trigger to finish.


Your trigger is now saved and available for use in your experiments and personalizations.

Conditions

This section provides a comprehensive list of available conditions and their functions.

External environment

  • Sky condition: Includes or excludes visitors based on the weather in their location.
  • Sky condition forecast: Includes or excludes visitors whose location has the following forecasted sky conditions.
  • Temperature: Includes or excludes visitors based on their location's temperature.
  • Temperature forecast: Includes or excludes visitors whose location has the following forecasted temperatures.
  • Day / Night: Includes or excludes visits during the day or night.
  • Weekday: Includes or excludes visitors on a specific day of the week.
  • Date range: Includes or excludes visitors to the website during a given date range.
  • Time slot: Includes or excludes visitors within a given time period.

Experiments

  • Web Experiment: Includes or excludes visitors who have been exposed to a specific experiment and have seen a specific variation OR any of the variations (original included). The condition considers the current or previous visits. The selected experiment can be Online, Paused, or Stopped.
  • Personalization: Includes or excludes visitors who have been exposed to a specific personalization. The condition considers the current or previous visits. The selected personalization can be Online, Paused, or Stopped.
  • Feature Flag: Includes or excludes visitors who have been exposed to a specific Feature flag and have seen any of the variations, OR the On OR the Off flag, and have been assigned to any of the variations OR a specific variation.
  • Exclusive campaign: Excludes visitors already partaking in an experiment, a personalization, or both, meaning that:
    • If a visitor has already been exposed to another campaign (in a current or previous visit), this visitor won’t be targeted in the current experiment.
    • A visitor can be targeted by other experiments that do not have the Exclusive campaign condition, even if they are currently part of an exclusive campaign. In other words, this condition doesn’t prevent participation in other experiments. It lets visitors participate in experiments that don’t have the same exclusivity requirement.
note

Campaigns or variations can't be deleted if you're using them as a targeting condition in a segment.

Technical environment

  • Browser cookie: Includes or excludes visitors based on a cookie's presence in their browser and, if possible, its value.
  • Custom data: Include or excludes visitors based on a certain custom data. To use this condition, you must first create a custom data.
  • Custom JS: You can write a custom JavaScript function that will return true or false. If the result is true, the visitor is included in the experiment. This function can be evaluated each time the page is displayed, or asynchronously.
    • Check condition immediately or when the page has loaded: If undefined is returned, the code will retry execution every 75 ms for the first 3 seconds, then every 250 ms.
    • Run the condition asynchronously: Your JavaScript is evaluated for each experiment.
    • If you want to return true or false depending on a variable's value in your data layer, you can use this code (which you need to adapt depending on your data layer name):
if (typeof utag_data != "undefined" && typeof utag_data.is_logged_in != "undefined" && utag_data.is_logged_in != ""){
if (utag_data.is_logged_in == "false")
return false;
else
return true;
}
return undefined; // will loop until utag_data and utag_data.is_logged_in is defined
  • If you are using the asynchronous condition, the callback function is setTargeting. You need to replace it in the code: setTargeting(true)/setTargeting(false).
  • Custom event: Starts a personalization only when a specific event has been triggered. To trigger an event, use the Kameleoon.API.Events.trigger(eventName) method.
  • Explicit trigger: Explicitly triggers a campaign using our Activation API. Use explicit triggers for campaigns you implement with a modern JS framework (for example, React, Vue, Angular).

Visit characteristics

  • Elapsed time:
    • Elapsed time since first visit: Includes or excludes visitors based on the time elapsed since their first visit.
    • Elapsed time since last visit: Includes or excludes visitors based on the time elapsed since their last visit.
    • Elapsed time since session became active: Includes or excludes visitors based on the time elapsed since the beginning of the session.
    • Elapsed time since page loaded: Includes or excludes visitors based on the page loaded.
  • Visit numbers:
    • Number of visits today: Includes or excludes visitors based on their number of visits today.
    • Total number of visits: Includes or excludes visitors based on the total number of their visits.
    • Number of visits by page: Includes or excludes visitors based on their number of visits to a specific page.
    • Number of page views: Includes or excludes visitors who have seen a certain number of pages.
    • Number of visited product pages: Includes or excludes visitors based on how many product pages they have visited.
  • Acquisition:
    • Traffic type: Includes or excludes visitors from specific sources (for example, search engine, emailing, website tributary).
    • Referring Website URL: Includes or excludes visitors based on the referring URL.
    • Acquisition channel: Includes or excludes visitors based on their acquisition channel.

Conversions

  • Kameleoon trigger: Includes or excludes visitors based on whether another trigger has (or has not) fired.
  • Converted goal: Includes or excludes visitors based on whether they converted on a certain goal.
  • Website exit: Includes or excludes visitors whose cursor has left the browser window.

Page

  • Page URL: Includes or excludes visitors based on their current page's URL.
  • Landing Page URL: Includes or excludes visitors based on the URL of the page their visit started on.
  • Element on the page: Includes or excludes visitors based on the presence of an element on the page.
  • Page Title: Includes or excludes visitors based on their current page's title.
  • Previous page: Includes or excludes visitors based on the URL of their previous page.
  • Price of the product page displayed: Includes or excludes visitors based on the price of the product they're currently viewing.
  • Visited product pages: Includes or excludes visitors based on which/how many product pages they visited.