Segment and audience filters
Segments vs. audiences
The filters options available for creating segments are slightly different from those available for targeting your campaign audiences. In addition to User Profile filters (criteria that is based on user, device, or event profiles) that are available for segmenting your users, campaign audiences include a section for User Behavior filters (filters based on historical user behavior). For more information, see Targeting campaign audiences.
Understanding segment and audience filters
When you create a new segment or audience, it’s important to understand how the filters and options available work together to make a segment or audience.
Segment and user profile filters include the following elements:
Element | Description | |
---|---|---|
1 | data type | The type of user profile data you want to use to filter your segment or audience. |
2 | available filters | Depending on the type of data, the filters available to use to create your segment or audience. |
3 | operators | Depending on the type of filter, the operators that are available for filtering your segment or audience. |
4 | filter values | The value you want to use to filter your segment or audience. Depending on the type of operator or filter value (for example, string, integer, date), either enter the value directly in the box or select it from a list. |
5 | Add a new filter | Use the AND/OR conditions to add additional primary filters and create basic or advanced combinations of filters. |
6 | filter summary | After you apply a filter definition, use the options on the summary to add (+) a secondary filter within the same group, edit the filter, or delete the filter. |
The following sections explain basic versus advanced filters, and the data types, filters available, and values you can enter for certain fields. The values provided are not an exhaustive list. If necessary, you can look up examples of user property values in the user database downloads available for your app. For more information, see Manually downloading user databases.
Select the descriptions link to view detailed descriptions for that tab.
Basic vs. advanced filters
Depending on your comfort level with AND/OR logic, use the primary and secondary filter operators to create segments or audiences that are as basic or advanced as needed.
To use an OR condition within a filter, simply enter additional values in the value box. To add another filter with AND/OR conditions, select Add a new filter and then select your primary or secondary operator.
Basic filters
To create basic filters where users must match all or any of the selected criteria to qualify for the segment, add a primary operator to your filter definition. If your primary operator is:
- AND – targeted users must match all of the selected filters (for example, language is French AND location is France).
- OR – targeted users can match any of the selected filters (for example, language is French OR location is France).
Advanced filters
To create more complex filters, use a secondary filter to combine groups of AND/OR filters in different configurations.
The primary operator determines the AND/OR logic you can use within the group. If your primary operator is:
- AND – targeted users must match all of the selected filter groups. Within each group, you can specify additional OR filters.
- OR – targeted users can match any of the selected filter groups. Within each group, you can specify additional AND filters.
Segments
Creates a new segment or audience based on the filter definition of an existing user segment. If you include a segment filter, then this filter targets active users who qualify for membership of the selected segment. For example, if you wanted to track French-speaking, Engaged users, you could create a new segment based on an existing Engaged segment, with an additional filter for the French language demographic.
Filter name | Description | Possible values |
---|---|---|
Segment match | Displays a list enabling you to either include all users in a selected segment or all users not in a selected segment. | who match the filter for, who don’t match the filter for |
Segment box | Displays a list of all segments that you have created or that Swrve automatically creates as part of a campaign. | Depends on segments available to your app. Select an option from the list to either target all users in that segment or all users not in that segment. |
Campaigns
Filters on audience exposure and interaction (past or present) to specific in-app message campaigns.
Filter name | Description | Possible values |
---|---|---|
Campaign name | Displays a list of draft, active, paused, or archived in-app message campaigns for your app. | Depends on the available in-app message campaigns. Select a campaign to display further targeting options. |
Visibility | Displays a list of options related to a user’s exposure to and interaction with the in-app message. | saw the message, didn’t see the message, clicked the message, saw but didn’t click the message |
Recency | Displays a list of options that enable you to target users who interacted with the message at anytime or within the last X number of days or hours. | anytime, in the last X days or hours |
Variants | Displays only if the selected campaign includes A/B test variants. | Depends on the available variants for the selected campaign. Select an option from the list to target users that have or haven’t interacted with any variant, or a selected message variant. To include multiple variants, select the additional variants. |
Purchases
Filters based on purchase-related behavior such as the total amount spent or the total number or recency of in-app purchases. For more information about purchase recency options, see Event recency operators. You can also target users who have or have not purchased a specific item or items. To target specific items, they must first be available in the app. For information on adding items to your app, see Managing resources and the Swrve Items API guide.
Filter name | Description | Possible values |
---|---|---|
have spent | The total amount, in USD, that a user has spent in your app, as derived from iap events. | Any numeric value. Depending on the operator you select, you can enter a single value (for example, more than, 10) or a range of values (for example, between, 10 and 20). |
have purchased | The total number of validated in-app purchases a user has made in your app. For a purchase to be validated, you need to also send the Apple or Google receipt. | Same as above. |
made their first purchase | The recency of the user’s first valid in-app purchase, based on a set number or range of days, or in relation to another event. | If you select between, more than or in the last, enter any numeric value or range of values indicating the number of days relevant to the user’s first purchase. If you select before they triggered event, select the event from the list. |
made their most recent purchase | The recency of the user’s most recent valid in-app purchase, based on a set number or range of days, or in relation to another event. | If you select between, more than or in the last, enter any numeric value or range of values indicating the number of days relevant to the user’s most recent purchase. If you select before they triggered event, select the event from the list. |
have made invalid purchases | The total number of invalid in-app purchases a user has made in your app. For this number to be validated, you also need to send verification from Apple or Google. | Any numeric value. Depending on the operator you select, you can enter a single value (for example, more than, 10) or a range of values (for example, between, 10 and 20). |
haven’t made any purchases | Targets users who have never made a valid in-app purchase in the app. | N/A |
have purchased particular item(s) | Targets users who have purchased a specific item, counting both purchases with real-world and virtual currency. | Depends on the available items for your app. Start typing to filter the available items and select an option from the list to target users that have purchased that item. To include multiple items, use the OR operator or select the additional items. |
haven’t purchased particular item(s) | Targets users who haven’t purchased a specific item, counting both purchases with real-world and virtual currency. | Depends on the available items for your app. Start typing to filter the available items and select an option from the list to target users that haven’t purchased that item. To include multiple items, use the OR operator or select the additional items. |
Resource Tests
Filters on audience exposure and interaction (past or present) to specific treatments of a resource A/B test.
Filter name | Description | Possible values |
---|---|---|
Test name | Displays a list of resource A/B tests that have been created for your app. | Depends on the available resource A/B tests. Select a test to display further targeting options. |
Users who | Displays a list of options related to a user’s exposure to the selected resource A/B test. | have been exposed to, have not been exposed to |
Control / Treatments | Displays the control and a list of treatments included in the selected resource A/B test. | Depends on the number of treatments in the selected test. Select an option from the list to target users that have or haven’t been exposed to the selected control or treatment. To include multiple treatments, select the additional treatments. |
Engagement
Filters on engagement-related criteria such as the number of app sessions and the lifetime minutes spent in the app.
Filter name | Description | Possible values |
---|---|---|
were last active (push notification audiences only) | The number of days since the user was active, based on the last_active property. | Any numeric value representing the number of days ago the user was active. Depending on the operator you select, you can enter a single value (for example, in the last, 7) or a range of values (for example, between, 30 and 60). |
installed the app | The number of days since the user first installed the app, based on the date_joined property. | Any numeric value representing the number of days since the user installed the app. Depending on the operator you select, you can enter a single value (for example, in the last, 7) or a range of values (for example, between, 30 and 60). |
have spent a total time in-app of | The total number of minutes that the user has spent in the app, based on the start and end of a session (session.start, session.end). | Any numeric value representing the minutes the user has spent in-app. Depending on the operator you select, you can enter a single value (for example, more than, 320) or a range of values (for example, between, 160 and 320). |
have used the app | The total number of times the user has used the app. | Any numeric value representing the number of times. Depending on the operator you select, you can enter a single value (for example, more than, 3) or a range of values (for example, between, 3 and 10). |
Properties
Filters on custom user properties. Your development team must create any custom properties when first integrating Swrve into your app, and then the property is available in the Select Filter Type list for targeting and segmenting of your users. The Swrve SDK automatically tracks specific default properties, you can also configure custom properties to track any user profile information required. For example, you might create a custom property called premium, and then target non-premium users and premium users.
The value you enter for custom properties depends on the app platform and how the property was configured. For example, the Swrve Android SDK only supports string properties, while iOS property values can be an integer or string. For more information on creating custom properties, see the platform-specific Integration guide.
Date user properties
Swrve now supports using DateTime properties to target customers (for example, the date and time of an event, such as a flight departure, concert, or conference talk). For information on the operators used for DateTime properties, see below. When matching on a given property for any of the operators, if the property isn’t set yet by a given user, they will not match the filter. This is also true for the is not operator—a user without a property won’t match unless they actually have a valid DateTime set.
For more information, see How do I target my audience using Date user properties?
DateTime format
Swrve recommends using the typed property function introduced in SDK version 4.7 (for more information, see the relevant SDK release notes). Otherwise, you must send DateTime properties in the following ISO8601 format: YYYY-MM-DDTHH:MM:SS.000Z. For example, 2016-03-11T09:29:33.915Z. You should convert the DateTime to UTC, otherwise it will not work as expected.
Events
Filters on custom events. Events can be any action you want users to perform, and must be configured when integrating Swrve into your app. The Swrve SDK automatically sends certain default events, while you can also configure custom events to track any user action you require. For more information, see the platform-specific Integration guide.
The operators available on the Events tab allow you to filter either based on the total count of the event or the recency of the event. For more information, see Event recency operators.
Possible values include:
- If you select triggered event, enter any numeric value or range of values relevant to the selected event.
- If you select first triggered event or last triggered event and then select between, more than, or in the last, enter any numeric value or range of values indicating the number of days relevant to the selected recency.
- If you select first triggered event or last triggered event and then before they triggered event, select the event from the list, and then select first instance or last instance from the subsequent list.
Event name | Description |
---|---|
Swrve.first_session | Sent when the SDK initializes for the very first time for an app on a given device. This event is not sent again unless the user uninstalls and then reinstalls the app again (or the app data is deleted). |
Swrve.session.start | Sent when the user starts an app session. |
Swrve.Messages.app_launch | This event has been deprecated, but refers to a cross-promotion install, for example, promoting other titles within your app portfolio. (That is, when a user installed the app from a cross-promotional message.) |
Swrve.Messages.campaigns_downloaded | Sent when the device downloads campaigns (in-app messages). |
Swrve.Messages.Message-*.click | Used for reporting purposes, when a user clicks a button in an in-app message, that does not have a dismiss action. |
Swrve.Messages.Message-*.impression | Sent every time a user sees an in-app message. |
Swrve.Messages.click_thru | This event has been deprecated, but with app_launch, was sent when a customer clicked ‘install’ in a cross-promotional message. |
Swrve.Messages.message_returned | Sent when an in-app message is triggered from within an app. |
Swrve.Messages.Push-*.engaged | Sent when a user engages with a push notification. |
Swrve.permission.ios.[permission_name].off or .on | (iOS only) Sent when the status changes for a permission (from active to inactive and vice versa). |
Swrve.push_notification_permission | (iOS only) Used to trigger the dialog that prompts a user to give push notification permission. |
Swrve.permission.android.notification.granted or denied | (Android only) Sent when the status changes for the notification permission (from denied to granted and vice versa). |
Swrve.session.end | Sent when the users ends an app session. |
Swrve.signature_invalid | Sent when someone has attempted to externally alter the information stored by the SDK (for example, campaigns, resources). |
Swrve.user_properties_changed | Sent by the server when a user property changes. |
Swrve.user_purchase | Sent when a customer completes a purchase. |
Device
Filters on device-related criteria such as device name, language, operating system, or version. Certain device properties are automatically sent to Swrve by default at initialization. For more information on default user properties, see Swrve user properties.
Filter name | Description | Possible values |
---|---|---|
Device Name | The device name taken directly from the device, as captured by the swrve.device_name property. | Enter a text value describing the device name; for example, iPhone 16, Samsung 13. Note: iOS device names are predictable and take the form <DeviceName><MajorVersion>,<MinorVersion>. For example:
Android devices are less predictable and depend heavily on the OS to report a coherent name. For more information on device name syntax, see How do I capture device type and location? |
App Version | The app version on the device, as captured by the app_version property. This property is taken from the app itself. | Select an available value from the Select App Version list. |
Language | The device language, as set in the swrve.language property. | Depending on the operator you select (is, is not), select a language from the Select Language list to target users in or not in that language category. To include more than one language, select additional values. |
OS | The operating system of the device, as captured by the swrve.os property. | Enter a text value of the device operating system; for example, iOS, Android. |
OS Version | The operating system version, as captured by the swrve.os_version property. | Enter a text/numeric value of the operating system version; for example, iOS 16.0.3 or 13 (for Android). |
Timezone Name | The device timezone, as set by the swrve.timezone_name property. | Enter a text value for the timezone you wish to target. The format depends on how the timezone is set in the device platform; for example America/Los_Angeles, GMT-08:00 or UTC. For a list of timezones, see Time Zone Database. |
SDK Version | The version of the Swrve SDK being used, as captured by the app. swrve.sdk_version property. | Text/numeric value of the Swrve SDK version; for example, iOS 8.2.0, Android 10.4.0, Unity 8.4.2. |
Unity Version | The version of Unity used to build the app (if applicable), as captured by the swrve.unity_version property. | Enter the numeric value of the Unity version; for example, 7.3.2. To target all users within a main release, you could use the starts with operator, and then enter only the first or second digit (for example, starts with, 5.0). |
App Store | The app store the app was downloaded from, as captured by the swrve.app_store property. | Enter a text value of the app store name; for example, Apple, Google, Amazon. |
Device DPI | The dots per inch (DPI) in pixels of the device screen, as captured by the swrve.device_dpi property. | Enter any numeric value representing the DPI in pixels. Depending on the operator you select, you can enter a single value (for example, is greater than, 320) or a range of values (for example, is between, 160 to 320). |
Device Width | The width of the device screen in pixels, as captured by the swrve.device_width property. | Enter any numeric value representing the device screen width in pixels. Depending on the operator you select, you can enter a single value (for example, is greater than, 320) or a range of values (for example, is between, 160 to 320). |
Device Height | The height of the device screen in pixels, as captured by the swrve.device_height property. | Enter any numeric value representing the device height in pixels. Depending on the operator you select, you can enter a single value (for example, is greater than, 640) or a range of values (for example, is between, 640 to 1280). |
SIM Operator Name | The mobile operator of the registered SIM card, as captured by the swrve.sim_operator.name property. | Enter a text value of the SIM operator’s name. A list of SIM operators and their associated code is available at IMEI Carriers Database.
Deprecated in iOS 16+. |
SIM Operator Country ISO Code | The two-letter ISO country code of the mobile operator, as captured by the swrve.sim_operator.iso_country_code property. | Enter a text value of the two-letter ISO country code; for example, GB (Great Britain), US (United States). A list of country codes is available at https://www.iso.org/obp/ui.
Deprecated in iOS 16+. |
SIM Operator Mobile Code | The unique number assigned to every mobile operator in all countries of the world, as captured by the swrve.sim_operator.code property. | Enter the numeric value of the SIM Operator Mobile code. The operator code consists of two parts: the Mobile Network Code (MNC) and Mobile Country Code (MCC). A list of operator codes is available at IMEI Carriers Database.
Deprecated in iOS 16+. |
Operators
The operators available when you create a new filter depend on the data type and filter selected. The value may be fixed (for example, Select Segment list), numeric only (for example, equals 1), or a combination of text and numbers (that is, a string). For numeric values, if the user property is absent or cannot be recognized as a number, it is treated as 0 for comparisons. For string values, if a user property is absent, it is treated as an empty string for comparisons.
Operator | Description | Possible values |
---|---|---|
String | ||
is | The result is equal to the specified filter. | Any string value. |
is not | The result is not equal to the specified filter. | Any string value. |
contains | The result contains the specified filter. | Any string value. |
does not contain | The result does not contain the specified filter. | Any string value. |
starts with | The result starts with with specified filter. | Any string value. |
ends with | The result ends with with specified filter. | Any string value. |
Number | ||
equals, exactly | The result is equal to the specified filter. | Any numeric value. |
is less than, less than | The result is less than the specified filter. | Any numeric value. |
is at most, at most | The result is equal to or less than the specified filter. | Any numeric value. |
is greater than, more than | The result is greater than the specified filter. | Any numeric value. |
is at least, at least | The result is equal to or greater than the specified filter. | Any numeric value. |
is between, between |
The result falls within the range of the specified filter. | Any two numeric values. |
is not between | The result falls outside the range of the specified filter. | Any two numeric values. |
Date (for DateTime user properties) | ||
date is | The date is X days ago or away. | Any numeric value. |
date is not | The date is not X days ago or away. | Any numeric value. |
date is between | The date falls within the range of the specified values. | Any two numeric values. |
date is not between | The date falls outside the range of the specified values. | Any two numeric values. |
specific date is | The date matches the set date from 00:00 to 23:59:59:59 in the selected time zone. | Pick a date from the calendar and select the relevant time zone. |
date range is between | The date falls within the set Start and End dates and times, in the selected time zone. | Pick the dates from the calendar, set the time if needed, and select the relevant time zone. |
Event recency operators
For filter types based on certain events (for example, purchase events, custom events), the options enable you to filter based on either the total count of the event or on the recency of the event.
If you select… | Then… | Possible values |
---|---|---|
have purchased, have made invalid purchases, triggered event |
Select an operator to specify the number of times the purchase or custom event has been triggered. | Any numeric value. Depending on the operator you select, you can enter a single value (for example, more than, 10) or a range of values (for example, between, 10 and 20). |
made their first purchase, first triggered event |
Select an operator to specify if the first purchase or instance of the event occurred between, more than, or in the last number of days ago, or if it occurred before the user triggered another event. | If selecting an n days ago operator, any numeric value. Depending on the operator you select, you can enter a single value (for example, more than, 10) or a range of values (for example, between, 10 to 20). If selecting an event, select the event from the list of available events, and then select first instance or last instance from the subsequent list, if applicable. |
made their most recent purchase, last triggered event |
Select an operator to specify if the most recent purchase or last instance of the event occurred between, more than, or in the last number of days ago, or if it occurred before the user triggered another event. | Same as above. |
For more information on how to use event recency filters to target your audience, see How do I target my audience using event recency?
Next steps
- Create a new segment to use in your resource A/B tests or for reporting purposes. For more information, see Creating segments.
- Create a custom audience for targeting your campaigns. For more information, see Targeting campaign audiences.