Create a new segment

Written by Julie Trenque

Updated on 02/13/2024

5 min

Beginner

Was this content useful?

Segmentation helps you to precisely target your visitors. You can create, modify and duplicate segments with the Segment Builder, a tool in Kameleoon App.

Access Segment Builder

From the App

To access the Segment Builder from your Kameleoon App, in the left-hand sidebar menu, go to Configure > Segments.

To create a new segment, click on New segment.

The segment creation pop-in opens.

From the Graphic editor

In the Targeting step of the Finalization panel, click on Create a new segment.

You will be redirected to the Segments Dashboard and the segment creation pop-in will open.

Select the project for which you want to create a segment and click Next.

Once you have validated the configuration of your segment, you will be automatically redirected to your campaign in the Graphic editor, with the segment associated with it.

From the personalization creation page

You can also access Segment Builder while creating or editing a personalization, by clicking Add a new segment in the EXPOSED SEGMENT section.

The segment creation pop-in opens.

Create a new segment

Types of targeting

Kameleoon offers a priori segmentation, in advance of your experiment launch. There are two options, so it’s important to understand the difference between a priori and a posteriori segmentation.

  • A posteriori segmentation takes place after the test, in your web analytics solution (Google Analytics, KISSmetrics, AT Internet, etc.). This will only show you if a variation’s performance has increased with a given segment. Kameleoon doesn’t manage this kind of segmentation, which is usually undertaken by your web analytics solution.
  • A priori targeting is different. The experiment is limited to a specific fragment of your traffic, usually because the test only makes sense for this segment. For instance, if you have an international website, it might be interesting to run an experiment only for users in France. Similarly, you could test an offer with an experiment only displayed to a specific segment (for example, first-time visitors to your website). This kind of targeting is managed by Kameleoon.

Experiments for a specific segment are very simple with Kameleoon. You can display a special offer only to a specific visitor segment (for example, visitors coming to your website for the first time, users arriving on your page via your Twitter account, etc.)

Enter your segment’s informations

The first fields to fill in are:

  • the name of your segment;
  • the site for which you are creating this segment;
  • the type of campaign for which you want to create and use this segment (Web experiment / Personalization; Feature flag / SDK experiment; All experiment types).

You can also add a description and tags.

The description isn’t mandatory but is strongly recommended so that you can quickly identify your segments 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.

Note: The targeting conditions offered in the Segment Builder depend on the chosen campaign type.

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 segments 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 segment 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 segment. 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 “New Visitors” AND “On Mobile”, only visitors who are both new to your site and accessing it via a mobile device will be included in the segment.

OR Operator: Use the OR operator when you want a visitor to meet any one of the specified conditions to be included in your segment. 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 “New Visitors” OR “On Mobile”, visitors who are either new to your site or accessing it via a mobile device will be included in the segment.

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 segment.

  • True: Visitor possesses the characteristic (e.g., “Is a New Visitor” is true).
  • False: Visitor does not possess the characteristic (e.g., “Is a New Visitor” is false).

Exclude Condition: Specifying an “exclude” condition means that visitors who meet this condition will not be part of your target segment.

  • True: Visitor does not possess the characteristic (e.g., “Is a New Visitor” is true, meaning they are not new, so they are excluded).
  • False: Visitor possesses the characteristic (e.g., “Is a New Visitor” is false, meaning they are new, so they are included).

Practical examples & common pitfalls

  • Including New Visitors on Mobile:
    • Condition 1: New Visitor (Only include, True)
    • Condition 2: On Mobile (Include, True)
    • Logical link: AND
    • Outcome: Only new visitors accessing the site via mobile devices will be included.
  • Excluding Returning Visitors on Desktop:
    • Condition 1: New Visitors (Only include, True)
    • Condition 2: On Desktop (Exclude, True)
    • Logical link: AND
    • Outcome: Visitors who are returning and accessing the site via desktop will be excluded.
  • 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 segments, consider the impact of AND/OR operators in conjunction with include/exclude conditions. Remember that “include” conditions aim to add visitors to your segment based on positive criteria matches, while “exclude” conditions remove visitors who meet specific criteria. The choice between AND/OR operators can significantly alter your segment’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 Segment 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.
  • 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.

  • Acquisition channel: includes or excludes visitors according to the provenance channel.

Visitor characteristics

  • New or returning visitors: includes only new visitors (first visit) or those returning to your website.
  • Browser language: includes or excludes visitors according to the language set in their web browser.
  • Geolocation: includes or excludes visitors according to geolocation data (country, region, town).
  • Device type: includes or excludes visitors based on their type of device (tablet, smartphone, computer). You can also find this feature on the page for personalization creation.
  • Screen resolution: includes or excludes visitors by the size of their screen (in pixels).
  • Ad blocker: includes or excludes visitors using an ad blocker.
  • Visitor IP address: includes or excludes visitors based on their IP address.

Use this option if, for example, you want to make a commercial offer only to users who visited your website more than 5 times during the day, or to new visitors.

Visiting behavior

  • Previous page: includes or excludes visitors according to the URL of the previous page.
  • Key pages: includes or excludes visitors that have visited a specific key page.
  • Number of page views: includes or excludes visitors according to the number of pages previously visited.
  • 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 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.
  • Website exit: includes visitors whose cursor has left the browser window.
  • Goal converted: includes or excludes visits during which a specific goal was converted.
  • Product pages: includes or excludes visitors based on previously visited product pages. (only available with the Product Targeting add-on) Further information

The Product pages category contains 3 targeting conditions:

1. 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).

2. 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.

3. 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

Predictive targeting

Kameleoon Conversion Score: our machine-learning algorithms predict each visitor’s purchase or engagement intention in real-time. You can use the Kameleoon Conversion Score (KCS™) to automatically trigger personalization campaigns. (You need AI Predictive Targeting to activate the KCS option.)

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.
  • 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.

External environment

  • 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.
  • 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.
  • 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).

Custom data

This set of conditions enables you to include or exclude visits based on custom data. For more information, see the article on advanced targeting tools.

If you have set values when creating your custom data, you can select these values in the segment builder. Choose the option is among the values in the dropdown and check the value(s).

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…).
  • Browser: includes or excludes visitors based on their web browser. It’s possible to specify the browser version or to target versions that are strictly superior or inferior to another version.
  • Operating system: includes or excludes visitors based on their operating system (Windows, Mac OS, etc.).
  • 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.

External tools

Kameleoon provides bridges with the main CDP (Segment, Tealium, CommandersAct, Piano…), DMP (Salesforce, Oracle…) and analytics platforms (Mixpanel, Heap, Google Analytics…) which allows to target segments or cohorts of visitors. See all our integrations

You can manage all the segments you have created on the Segments page. To learn more about segment management, read our article on this topic.

Segments

This condition enables you to include or exclude visitors according to an already created segment.

You can import into the Segment Builder a segment that you have already created. Its targeting conditions will then be associated with the new segment you are creating, and you can add new ones. This saves you time!

For example, you import the Kameleoon Segment Returning visitors on mobile that you created last month and that you often use as a base. You adapt it to a specific campaign by adding the Goal converted condition, and you create this new segment.

Please note that:

– the conditions that make up the imported Kameleoon Segment cannot be modified: the segment is considered as a whole.

– when you use the same segment as a base in several segments associated with active campaigns, any change will have an impact on all the concerned campaigns. Therefore, be careful when modifying your core segment!

– it is not possible to create more than one nesting level. You cannot add to a segment a segment that already includes a Kameleoon Segment.

 You can also use the Kameleoon Segment condition several times to combine several segments.

  • In this article :