A trigger represents a specific event that may occur during a visit. Triggers will help you target visitors depending on where, when and how he interacts with your website.
Note: The idea behind this is, at the end, to clearly separate Segments (Who) from Triggers (Where, When and How) to precisely target and define your visitors. Conditions will indeed be different for both builders, allowing you to define precisely your targeting when publishing your experiments.
You can create, modify and duplicate triggers with the Trigger Builder, a tool in Kameleoon App.
Access Trigger Builder
From the App
To access the Trigger Builder from your Kameleoon App, in the left-hand sidebar menu, go to Configure > Triggers.
To create a new Trigger, click on New Trigger.
The Trigger creation pop-in opens.
Create a new Trigger
Information block :
Info: Later this year, segments and triggers will have distinct sets of conditions. Some conditions currently found in the segment builder, those that define not who the visitor is, but how, where, and when they interact with the website, will be moved to the trigger builder. Existing segments will remain unchanged and continue to function in experiments, but all newly created segments and triggers will follow this new separation. To facilitate the transition, options will be available to help migrate from the old system to the new one.
First step : Enter your Trigger’s informations
The first fields to fill in are:
- the name of your trigger;
- the site for which you are creating this trigger;
- You can also add a description and tags.
The description isn’t mandatory but is strongly recommended so that you can quickly identify your triggers in the list.
Select and set a condition
To add a condition, simply drag and drop a condition from the left-hand list into the field on the right.
Once you have dragged and dropped a condition, its specific settings will be displayed.
Configure the condition you added as you wish. The different available conditions will be detailed below.
Determine the weight
For each condition, a weight icon enables you to prioritize them: the higher the number, the more important the condition. This setting is for advanced use only and not mandatory.
By default, all conditions have a weight of 1.
You can learn more about weight and how works in our articles on Exposure settings and How to use the weight of conditions?
Delete the condition
To delete a condition, click on the cross next to the weight icon.
Narrow or add a new condition
To add a new condition when a condition is already selected, two options are available:
- Narrow an existing condition: further specifies a condition. This corresponds to the addition of mathematical parentheses: (Condition A and Condition B) and Condition C
- Add a new condition: adds a condition at the same level: Condition A and Condition B and Condition C
For more information, please refer to our article Narrow a condition or add a new one?.
Use logical links between conditions
Creating effective targeting triggers in Kameleoon involves combining various conditions to precisely define your audience. The use of logical operators AND/OR is crucial in this process, allowing for the combination of multiple criteria to refine your targeting strategy. Additionally, understanding the distinction between “include” and “exclude” conditions is essential for accurate trigger configuration.
Logical Operators: AND vs. OR
AND Operator: Use the AND operator when you want all specified conditions to be met for a visitor to be included in your trigger. This operator is ideal for narrowing down your target audience to those who meet all of your defined criteria.
- Example: If you set an AND condition for visitors who are on a specific “Page URL” AND coming from a “Referring website URL”, only visitors who are both arriving on the page URL and coming from the referring website URL will be included in the trigger.
OR Operator: Use the OR operator when you want a visitor to meet any one of the specified conditions to be included in your trigger. This operator broadens your target audience to include visitors who meet any one of your criteria.
- Example: If you set an OR condition for visitors who are on a specific “Page URL” OR coming from a “Referring website URL”, visitors who are either on this page URL or accessing it via a referring website URL will be included in the trigger.
Rule: AND is prioritized before OR.
Include vs. Exclude Conditions
Include Condition: Specifying an “include” condition means that you want visitors who meet this condition to be part of your target trigger.
- True: Visitor possesses the characteristic (e.g., “lands on a page that corresponds exactly to the URL” is true).
- False: Visitor does not possess the characteristic (e.g., “lands on a page that corresponds exactly to the URL” is false).
Exclude Condition: Specifying an “exclude” condition means that visitors who meet this condition will not be part of your target trigger.
- True: Visitor does not possess the characteristic (e.g., “lands on a page that corresponds exactly to the URL” is true, meaning they are on it, so they are excluded).
- False: Visitor possesses the characteristic (e.g., “lands on a page that corresponds exactly to the URL” is false, meaning they are not on it, so they are included).
Practical examples & common pitfalls
- Including Visitors from Specific Acquisition Channels:
- Condition 1: Acquisition Channel is SEO (Exclude, True)
- Condition 2: Acquisition Channel is SEA (Include, True)
- Logical Link: AND
- Outcome: Only visitors arriving via SEA campaigns and not from SEO will be included in the experiment.
- Excluding Checkout Process Pages:
- Condition 1: URL contains /cart (Exclude, True)
- Condition 2: URL contains /login (Exclude, True)
- Condition 3: URL contains /payment (Exclude, True)
- Logical Link: OR
- Outcome: Pages related to the checkout process will be excluded from the experiment.
Tip: When configuring your targeting trigger, consider the impact of AND/OR operators in conjunction with include/exclude conditions. Remember that “include” conditions aim to add visitors to your trigger based on positive criteria matches, while “exclude” conditions remove visitors who meet specific criteria. The choice between AND/OR operators can significantly alter your trigger’s scope, either narrowing or broadening the range of included visitors.
If you’re not sure you’ve set everything up correctly, you can use our simulation panel.
Targeting conditions
Kameleoon offers a large number of conditions that enable you to include or exclude all types of visitors.
Note: The targeting conditions offered in the Trigger Builder depend on the chosen campaign type.
Visited pages
- Page URL: includes or excludes pages based on their URL or URL fragment.
- Page Title: includes or excludes pages by title.
With these two options, you can target one or several specific page(s). This can be useful if you want to change HTML elements shared by several pages. If you target the URL or the title of the page, Kameleoon displays the variation for users of these pages only.
With Kameleoon, you can target any kind of URL thanks to regular expressions. For examples of regular expressions, please read our article about them.
Note: For URL targeting using the Contains option: If your expression does not start with http or https, Kameleoon will only check the presence of the expression in the path (i.e. everything after the domain name).
Be careful: URL fragments and regular expressions are case sensitive.
Acquisition
Thanks to these options, you will be able to make commercial offers to users who looked for a specific keyword in a search engine such as Google, or to users who clicked on one of the emails sent by your marketing team, etc.
Note: You need to be careful with the Visitor data and Traffic acquisition targeting options. These options are mostly useful for personalization (for example, displaying a commercial offer only to non-buying regular visitors) and need to be combined with another condition such as URL targeting.
- Landing page URL: includes or excludes visitors based on the URL of their landing page.
- Referring URL: includes or excludes visitors based on the referring URL.
- Acquisition channel: includes or excludes visitors according to the provenance channel.
- Traffic type: includes or excludes visitors from a type of website (search engine, emailing, website tributary, etc.).
The Traffic Type condition depends on either the Landing page URL or the Referrer URL.
Emailing if the Landing page URL contains the pattern utm_medium=email or utm_medium=newsletter
.
Search Engine (Advertising, SEM) if the Landing page URL is from a google domain and has aclk
as path, OR has the parameter aclk
in the query.
Search Engine (Organic, SEO) if the Referrer URL contains google
or bing
or yahoo
or yandex
or baidu
.
Direct if the Referrer URL is empty (null
).
Referrer sites (Affiliation) if you have a Landing page URL and a Referrer URL that does not contain google or bing or yahoo or yandex or baidu.
Visiting behavior
- Website exit: includes visitors whose cursor has left the browser window.
- Goal converted: includes or excludes visits during which a specific goal was converted.
- Pages viewed
- Previous page: includes or excludes visitors according to the URL of the previous page.
- Number of page views: includes or excludes visitors according to the number of pages previously visited.
- Product pages
- Price of the product page displayed: includes or excludes product pages where price is higher than / lower than / equals a certain amount (a fixed price / the price of a specific product / the average price of a selection of products).
- Number of visited product pages: includes or excludes visitors based on the number of product pages they visited, the category to which these pages belong and their price.
- Visited product pages: includes or excludes visitors based on the product pages they visited.
If you are using Shopify Plus, the Product Pages conditions are automatically available without any additional configuration. Read our documentation
- Elapsed time
- Time elapsed since first visit: includes or excludes visitors according to the time elapsed since their first visit.
- Time elapsed since last visit: includes or excludes visitors according to the time elapsed since their last visit.
- Time elapsed since session became active: includes or excludes visitors according to the time elapsed since the beginning of the session.
- Time elapsed since page load: includes or excludes visitors according to the page loaded.
- Number of visits
- Number of visits today: includes or excludes visitors according to the amount of their visits today.
- Total number of visits: includes or excludes visitors according to the total amount of their visits.
- Number of visits by page: includes or excludes visitors according to the total amount of their visits on the specific page.
Campaign
This set of conditions enables you to include or exclude visitors who have seen or not a campaign (experiment/personalization) or variation.
- Experiment: includes or excludes visitors who have previously been exposed to a specific experiment and have seen a specific variation OR any of the variations (including the original). The condition considers the current visit or the previous ones. The selected experiment can be Online, Paused or Stopped.
- Feature Flag: includes or excludes visitors who have previously 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.
- Personalization: includes or excludes visitors who have previously been exposed to a specific personalization. The condition considers the current visit or the previous ones. The selected personalization can be Online, Paused or Stopped.
- Exclusive campaign: excludes visitors already taking part in an experiment, a personalization, or both. This means that:
- If a visitor has already been exposed to another campaign (in the current or a previous visit), this visitor won’t be eligible for your 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 allows visitors to participate in experiments that don’t have the same exclusivity requirement.
Note: If one of your campaigns or variations is used as a targeting condition in a segment, it cannot be deleted.
- Exclusive Feature Flag: excludes visitors already included to an ongoing Rollout or a Feature/Web experiment. This means that:
- If a visitor is already exposed to another Flag (in the current or a previous visit), this visitor won’t be eligible.
- A visitor can be targeted by other experiments/rollout/flags that do not have the Exclusive Feature Flag condition, even if they are currently part of an exclusive Feature flag. In other words, this condition does not prevent participation in other Flag experiments. It allows visitors to participate in experiments that don’t have the same exclusivity requirement.
AI Predictive targeting
Kameleoon Conversion Score: our machine-learning algorithms predict each visitor’s purchase or engagement intention in real-time. You can use the Likelihood to convert to automatically trigger personalization campaigns. (You need AI Predictive Targeting to activate the likelihood to convert option.)
External environment
- Weekday: includes or excluded visitors to the website on a specific day of the week
- Date range: includes or excludes visitors to the website during a given time period (in days).
- Timeslot: includes or excludes visitors to the website within a given time period (during the day).
- Weather
- Current weather
- Sky condition: includes or excludes visitors according to the weather in their location.
- Temperature: includes or excludes visitors exposed to average temperatures.
- Day / Night: includes or excludes visits during day or night.
- Weather forecast
- Sky condition forecast: includes or excludes visitors who will be exposed to the following sky conditions.
- Temperature forecast: includes or excludes visitors who will be exposed to the following temperatures.
- Current weather
Technical
- Custom JavaScript condition: 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 you return undefined, then your code will be executed again (every 75 ms for the first 3 seconds after the first attempt, then every 250 ms).
- Run the condition asynchronously: your JavaScript is evaluated for each experiment. For example, you want to run an experiment and you’re waiting for a response from a web service.
- If you want to return true or false depending on the value of a variable in your data layer, you can use that 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)
- Browser cookie: includes or excludes visitors based on the presence of a cookie in their browser and, if possible, its value.
- 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: if you only want to trigger the associated campaign explicitely via our Activation API, and not via any other built-in conditions. This will usually be the case for campaigns implemented on your side with a modern JS framework (React, Vue, Angular…).
- Element on the page: includes or excludes visits based on the presence of an element on the page. The condition performs a querySelectorAll loop until the DOM ready event. After that, the condition returns false.
Associate goals to your trigger (optional step)
On the last step before creating your experiment, you can associate goals to your trigger for each site. On the list displayed, you can see all the goals enabled for machine learning.
Once a goal is associated with your trigger it will enable the training of the Algorithm able to target your users according to their likelihood to convert a certain goal.
Note: To add more goals on your available training list, enable the option on the advanced settings of your goal on the goals dashboard.