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.
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.
Some conditions are not available on iOS or Android SDKs. These conditions include page related conditions, cookies, browser, and operating system.
Targeting condition | Description |
---|---|
Exclusive Feature Flag | Only includes users who are not included in any active feature flag. |
Target Feature Flag | Target visitors based on feature flags and variations they're exposed to |
Browser | Target visitors based on browser type and version. Associated with Browser data. |
Device | Target visitors based on device type. Associated with Device data |
Conversion | Target visitors based on the goal ID of a conversion. Associated with Conversion data. |
Custom Data | Target visitors based on custom data. Associoated with CustomData . |
Page Title | Target visitors based on the title of the page. Associated with PageView data. |
Page Url | Target visitors based on the URL of the page. Associated with PageView data. |
Operating System | Targeet visitors based on their operating system type. Associated with OperatingSystem data. |
IP Geolocation | Target visitors based on their geolocation data. Associated with Geolocation data |
Previous Page | Target visitors that previously visited a page URL. Associated with PageView data |
Number of Page Views | Target visitors based on the number of pages visited. Associated with PageView data |
SDK Type | Target visitors based on current SDK language or framework. |
Visitor Code | Target visitors based on their visitor code value. |
Browser Cookie | Target visitors based on a cookie key and value. Associated with cookie data and browser cookie. |
Segment | Target visitors based on whether they are targeted by another specified segment. |
App Version | Target 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 condition | Description |
---|---|
Time since First Visit | Target visitors based on elapsed time since first visit. |
Time since Last Visit | Target visitors based on time elapsed since last visit. |
Number of visits today | Target visitors based on the number of visits today. |
Total number of visits | Target visitors based on total number of visits. |
New or Returning Visitors | Target only visitors that are new or returning. |
Likelihood to Convert | Target 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.