Skip to main content

Target users with native segmentation criteria

Kameleoon’s targeting conditions allow you to trigger feature flags based on specific criteria. To effectively use these conditions, you’ll need to set their values using the addData() method and, in some cases, call getRemoteVisitorData() to retrieve historical data. This combination allows you to create highly targeted and personalized experiences for your users.

Targeting conditions not requiring getRemoteVisitorData()

Targeting conditions

Kameleoon offers a range of targeting conditions that allow you to trigger feature flags based on specific criteria. These conditions can be used to target specific groups of users.

To use targeting conditions, you must set the value of each criterion for a given user. You can set these values by using the addData() method available in each Kameleoon SDK. Some data, such as SDK language or previously targeted flags, will be automatically set by the SDK.

Kameleoon also allows you to preset the values of targeting criteria based on data already available about a visitor. This includes historical data collected from other devices or previous sessions which have been stored on Kameleoon servers. Calling the getRemoteVisitorData() method provides access to this past data, allowing you to create more targeted and personalized experiences.

Benefits of calling getRemoteVisitorData()

Although it is not required for the targeting conditions listed in the table below, there are several benefits to calling getRemoteVisitorData(). By fetching real-time data from the Data API, you can ensure that your targeting decisions are based on the most up-to-date information. Calling getRemoteVisitorData() allows for more precise targeting and consistent data across all devices used by a given user.

Using getRemoteVisitorData() can significantly expand the range of data available for evaluation, especially when:

  • You want to include data collected from other devices.
  • You're using Kameleoon in hybrid mode
  • You need to access a user's past history, such as previous visits to a specific URL.

For example, let’s say a user visits a page and the SDK is configured to track visited pages’ URLs. The data will be stored locally and on our servers. However, as all data collected by the SDK is stored in memory for the duration of a session, which defaults to 30 minutes (read more here), the SDK’s local state might be cleared, and the SDK will not be able to use that data for targeting purposes anymore.

To ensure accurate targeting of a given visitor, calling the getRemoteVisitorData() method will load previously visited pages from our servers. This call will help maintain a consistent view of the user’s behavior, even if the SDK’s local state has been cleared.

note

To retrieve past visit history using getRemoteVisitorData(), use the VisitorDataFiltersType parameter. This parameter allows you to specify the number of past visits to retrieve and apply filters based on specific criteria.

While the following conditions can be evaluated using data stored locally by the Kameleoon SDK, calling getRemoteVisitorData() can provide additional benefits. Calling the method allows you to access a wider range of information, including historical data that might not be available locally, enhancing the accuracy and effectiveness of your targeting.

note

Some conditions are not available on iOS or Android SDKs. These conditions include page related conditions, cookies, browser, and operating system.

Targeting conditionDescription
Exclusive Feature FlagOnly includes users who are not included in any active feature flag.
Target Feature FlagTarget visitors based on feature flags and variations they're exposed to
BrowserTarget visitors based on browser type and version. Associated with Browser data.
DeviceTarget visitors based on device type. Associated with Device data
ConversionTarget visitors based on the goal ID of a conversion. Associated with Conversion data.
Custom DataTarget visitors based on custom data. Associoated with CustomData.
Page TitleTarget visitors based on the title of the page. Associated with PageView data.
Page UrlTarget visitors based on the URL of the page. Associated with PageView data.
Operating SystemTargeet visitors based on their operating system type. Associated with OperatingSystem data.
IP GeolocationTarget visitors based on their geolocation data. Associated with Geolocation data
Previous PageTarget visitors that previously visited a page URL. Associated with PageView data
Number of Page ViewsTarget visitors based on the number of pages visited. Associated with PageView data
SDK TypeTarget visitors based on current SDK language or framework.
Visitor CodeTarget visitors based on their visitor code value.
Browser CookieTarget visitors based on a cookie key and value. Associated with cookie data and browser cookie.
SegmentTarget visitors based on whether they are targeted by another specified segment.
App VersionTarget visitors based on their application version (only available on mobile SDKs). Associated with ApplicationVersion data.

Targeting conditions requiring getRemoteVisitorData()

If your app doesn’t pre-load these data fields using the asynchronous getRemoteVisitorData() method, Kameleoon won’t have the data it requires to resolve the targeting condition correctly. Visitors that match this condition will not be evaluated by feature flag rules that contain that condition. They will see the variation in the Then, for everyone else in Production, serve dropdown (that is, the default variation).

The following conditions require a call to getRemoteVisitorData():

Targeting conditionDescription
Time since First VisitTarget visitors based on elapsed time since first visit.
Time since Last VisitTarget visitors based on time elapsed since last visit.
Number of visits todayTarget visitors based on the number of visits today.
Total number of visitsTarget visitors based on total number of visits.
New or Returning VisitorsTarget only visitors that are new or returning.
Likelihood to ConvertTarget visitors based on Kameleoon Conversion Score (KCS). Requires the AI Predictive Targeting add-on.

Hybrid Experimentation mode

Hybrid Experimentation is a comprehensive approach that combines the SDK and Kameleoon JavaScript snippet to enable advanced user targeting.

Benefits:

  • Streamlined implementation process.
  • Ability to access engine-collected client-side data directly at the SDK level.

Requirement:

  • Implementation of both the SDK and Kameleoon JavaScript tag.

The ability to access engine-collected client-side data at the SDK level provides greater flexibility and control over your targeting strategies. It is particularly useful when you want to use data that is only accessible on the client-side: datalayer variables, goals that only convert on the front-end, and exposure to web experiments and personalizations. Calling getRemoteVisitorData() allows you to access all data points that Kameleoon has automatically collected about the visitor on the current webpage.

For more information on hybrid experimentation, read our dedicated documentation.