Last modified November 8, 2018 by Shelly Wolfe

Segment and audience filters

Create highly customized segments and audiences for use in your analytics, resource A/B tests and campaigns with the segment and audience filter options available in Swrve. This article provides detailed information on filter modes and data types, the default or custom properties they are derived from, and how to use multiple filters to create customized, targeted segments and campaign audiences.

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:

segment filter elements

Element Description
1 filter mode Segments only. Use Simple or Advanced mode to create basic or advanced combinations of filters using AND/OR logic.
2 data type The type of user profile data you want to use to filter your segment or audience.
3 available filters Depending on the type of data, the filters available to use to create your segment or audience.
4 operators Depending on the type of filter, the operators that are available for filtering your segment or audience.
5 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.
6 additional conditions Use the filter modes and AND/OR conditions to includes additional filter values and create basic or advanced combinations of filters.

The following sections describe the filter modes, data types, filters available, and the 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.

Click the filter descriptions link to view detailed descriptions for that tab.


Filter mode

For segment filters, create basic or advanced combinations of filters using AND/OR logic with the Simple or Advanced modes.

For campaign audiences, simply enter additional values if you want to use an OR condition within a filter, or select the Select Operator button to add another filter with AND/OR conditions.

AND OR operator

Simple mode

Use simple mode to create basic filters where users must match all or any of the selected criteria to qualify for the segment.

  • Users must match all criteria – targeted users must match all of the selected filters (for example, language is French AND location is France).
  • Users can match any criteria – targeted users can match any of the selected filters (for example, language is French OR location is France).

Advanced mode

Use advanced mode to combine groups of AND/OR filters in different configurations to create more complex filters.

  • 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

Select the Segments tab to create 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
Users who Displays a list enabling you to either include all users in a selected segment or all users not in a selected segment. match the filter for, don’t match the filter for
Segment Displays a list of all segments that you have created or that Swrve automatically creates as part of an in-app message, conversation or push notification 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

Select the Campaigns tab to filter on audience exposure and interaction (past or present) to specific in-app message campaigns or resource A/B tests. Note: For campaign audiences, the Campaigns tab only includes in-app message campaigns. To target resource A/B tests, use the Resource Tests tab.

Filter name Description Possible values
Campaign Type Select a campaign type to target users exposed to or not exposed to a certain campaign or resource A/B test. For more information about the options available with each campaign type, see below. In-App Messages, Resource A/B Testing

In-App Messages

Filter name Description Possible values
Campaign Name Displays a list of active, paused or archived in-app message campaigns created for your app. (You cannot target campaigns that are in Draft status.) Depends on the available in-app message campaigns. Select a campaign to display further targeting options.
Users who 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
Variant 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, use the OR operator or select the additional variants.
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. anytime, in the last X days

Resource A/B Testing

Filter name Description Possible values
Campaign 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
Variant Displays a list of variants included in the selected resource A/B test. Depends on the available variants in the selected test. Select an option from the list to target users that have or haven’t been exposed to the selected variant. To include multiple variants, use the OR operator or select the additional variants.

Purchases

Select the Purchases tab to filter 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.

Demographic

Select the Demographic tab to filter on user demographics such as language, location or age. Note: For campaign audiences, any of the filters below that are custom properties are available on the Properties tab. Other filters (language, timezone name) are available on the Device tab.

Filter name Description Possible values
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 select more than one language, use the OR function or enter additional values.
Location The device location, configured as a custom property called location.
Note: The Swrve SDK does not collect this information by default—you must configure it as a custom property. For information on creating custom properties, see the platform-specific Integration guide.
Enter any text value describing the location name (for example, city, state, country). You can use the operator selections to include locations that contain certain words, or that begin or end with certain words.
Gender The user’s gender, configured as a custom property called gender.
Note: The Swrve SDK does not collect this information by default—you must configure it as a custom property. For information on creating custom properties, see the platform-specific Integration guide.
Enter a text value describing the the gender you wish to target (male, female).
Age The user’s age, configured as a custom property called age.
Note: The Swrve SDK does not collect this information by default—you must configure it as a custom property. For information on creating custom properties, see the platform-specific Integration guide.
Enter any numeric value. Depending on the operator you select, you can enter a single value (for example, is greater than, 18) or a range of values (for example, is between, 18 to 30).
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.
ADVANCED
Referrer ID The referrer channel and name as provided by the swrve.referrer_id user property. This property may not be automatically sent and is usually set up to use via an attribution provider. For information on setting up your app to track user acquisition, see the User acquisition tracking guide. Any text value representing the referrer name. The recommended format is [CHANNEL_NAME].[CAMPAIGN_NAME] (for example, Facebook.ChristmasPromo).
Referrer Cost (USD $) The total cost of the referrer channel, as provided by the swrve.referrer_cost user property. This property may not be automatically sent and is usually set up to use via an attribution provider. For information on setting up your app to track user acquisition, see the User acquisition tracking guide. Any numeric value representing the cost, in USD, of the referrer. Depending on the operator you select, you can enter a single value (for example, is greater than, 10) or a range of values (for example, is between, 10 to 20).

Engagement

Select the Engagement tab to filter 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 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

Select the Properties tab to filter on custom user properties. Your development team must create any custom properties during initial integration of Swrve into your app, and then the property is available in the Select Filter Type list for targeting and segmenting of your users. 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

Select the Events tab to filter 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.

Event name Description Possible values
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). 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 betweenmore 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.
Swrve.session.start Sent when the user starts an app session. Same as above.
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.) Same as above.
Swrve.Messages.campaigns_downloaded Sent when the device downloads campaigns (in-app messages). Same as above.
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. Same as above.
Swrve.Messages.Message-*.impression Sent every time a user sees an in-app message. Same as above.
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. Same as above.
Swrve.Messages.message_returned Sent when an in-app message is triggered from within an app. Same as above.
Swrve.Messages.Push-*.engaged Sent when a user engages with a push notification. Same as above.
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). Same as above.
Swrve.push_notification_permission (iOS only) Used to trigger the dialog that prompts a user to give push notification permission. Same as above.
Swrve.session.end Sent when the users ends an app session. Same as above.
Swrve.signature_invalid Sent when someone has attempted to externally alter the information stored by the SDK (for example, campaigns, resources). Same as above.
Swrve.user_properties_changed Sent by the server when a user property changes. Same as above.
Swrve.user_purchase Sent when a customer completes a purchase. Same as above.

Device

Select the Device tab to filter on device-related criteria such as device name, 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. Note: For campaign audience filters, the Language and Timezone Name properties are included on the Device tab.

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, iPhone5,1, samsung SCH-I535.
Note: iOS device names are predictable and take the form <DeviceName><MajorVersion>,<MinorVersion>. For example:

  • iPhone7,2 (iPhone 6)
  • iPhone10,3 (iPhone X)
  • iPhone11,2 (iPhone XS)
  • iPad5,1 (iPad mini 4)
  • iPad7,5 (iPad 6th generation)

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.
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, iPhone OS 11.4.1 or 4.2.2 (for Android).
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 5.3, Android 5.3.2, Unity 5.1.3.
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, 4.6.3. 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.
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.
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.

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)
is The date is X days ago or away. Any numeric value.
is not The date is not X days ago or away. Any numeric value.
is between The date falls within the range of the specified values. Any two numeric values.
is not between The date falls outside the range of the specified values. Any two numeric values.
is date 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.
is date 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.