Create and manage dynamic user segments in OneSignal to target personalized messaging based on activity, location, tags, and more.
A segment is a dynamic group of users defined by filters on Subscription attributes, behavior, and custom data. OneSignal segments update automatically as users interact with your app or site, with no extra tracking required. Use segments to target messages, exclude audiences, and trigger Journeys.
Push notifications, emails, and SMS messages are only sent to opted-in (subscribed) Subscriptions. The segment editor shows both subscribed and unsubscribed counts for transparency, but only subscribed Subscriptions receive messages when you target a segment. In-App Messages are displayed to all mobile Subscriptions, regardless of status.When used in Journeys, all Subscriptions in a segment, regardless of status, are evaluated to their respective Users and those users are entered into the Journey.
User-based segments are built using filters on user-level attributes rather than individual Subscriptions. Currently, these segments support filters on message events and Custom Events. Examples include:
When a user last opened an email, SMS, or push notification sent via OneSignal.
Specific Custom Events tracked in your app or website.
A user-based segment includes all users who meet the criteria and automatically makes all of their Subscriptions eligible to be targeted, enabling richer audience definitions that can reach any of the user’s devices.
Segments can be created in the dashboard, via the API, or by uploading a CSV. Target your audience by including and excluding segments when sending messages or building Journeys.
Dashboard
Create and manage segments from Audience > Segments.
API
Create segments programmatically using the Create Segment API.
CSV Import
Bulk-import Subscriptions and Tags via CSV, then build segments that match them.
Filters define which Subscriptions belong to a segment. You can combine multiple filters using AND or OR logic. If no filters are selected, the segment defaults to every user of your app.
Filter
Description
First session
The first time OneSignal saw this user active on any device, including email or SMS. Equivalent to the user’s created_at timestamp.
Last session
The last time OneSignal saw this user active on any SDK-tracked device.
Session count
Number of times Subscription opened the app or visited the site.
Usage duration
Total seconds the Subscription had your app/site open.
Pulled from Android versionCode or iOS CFBundleShortVersionString. Combine with Device type to filter by different app versions per platform. See Target outdated app versions.
Device type
iOS, Android, Web Push (browser), Email, etc. Select multiple device types in one filter with “is any of”, or exclude them with “is not any of”.
User tag
Custom Tags you set via the SDK or API. See Add Tags.
Location
Filter by radius from coordinates (lat/long). Requires at least 1 meter and up to 2 decimal places of precision. See location permission.
Country
Based on last IP geolocation (ISO 3166-1 alpha-2 code).
Message event filters target users based on their interaction with one of your messaging channels within a certain window. See Message events for the full event catalog and conceptual reference.
Message event filters
First select the messaging channel you want to filter on, then specify the action to track and whether the user has or has not performed that action.You can specify a minimum, maximum, or exact number of times the user must have performed the action, as well as a time window ranging from the last 24 hours to the last 90 days. Use the between option to define a custom start and end range (in days ago).
Delivered, Opened, Clicked, Bounced, Failed, Suppressed, Reported as spam
In-App
Impression, Clicked
Segments created with message event filters are user-based.They cannot be combined with subscription-based segments for inclusion or exclusion when sending messages outside of Journeys.Within Journeys, which is user-based, you can combine event-based and subscription-based segments for more flexible targeting.
The amount of time message event data is retained depends on your plan. The dashboard time window selector shows up to 90 days, but data beyond your plan’s retention period will not return results.
Retention by plan
Free, Growth, Pro, and Enterprise retention windows for message event data.
Custom Event filters let you target users based on meaningful actions they have taken in your app, website, or external systems.
Custom event filters are currently in Early Access.To request access, contact support@onesignal.com with your company name, OneSignal Organization ID, and App ID(s).
Custom event filters
Start by selecting:
The event name you want to filter on.
Whether the user has or has not performed that action.
The minimum, maximum, or exact number of times the action must be performed.
A time window during which the action must (or must not) occur. Choose a preset range or define a custom window using the between option (start and end in days ago).
After specifying the event, you can optionally filter on specific or multiple properties:
all: applies an AND condition across properties.
at least one: applies an OR condition.
Then set the properties you want to filter on using dot notation.
product_name → to target users with product name 24 Pack of Acorns.
product_price → to target users with product price 12.99.
product_quantity → to target users with product quantity 2.
Custom event filter example
Segments created with custom event filters are in Early Access and are user-based. A custom event segment can only contain custom event filters, and cannot be combined with other segments for inclusion or exclusion when sending messages.
The segment editor shows how many subscribed and unsubscribed Subscriptions are in your segment, with a breakdown by channel (push, email, and SMS).
Subscribed Subscriptions are opted in and will receive messages when you target this segment.
Unsubscribed Subscriptions match your segment filters but are opted out and will not receive messages.
The channel breakdown lets you see reachable vs. unreachable Subscriptions per channel, which helps you understand which channels will be most effective before you build a message or Journey.
OneSignal always returns a count within approximately 15 seconds. Whenever possible within that time limit, you will see an exact count. For large or complex segments where exact counts can take a long time to compute, an estimate is shown instead.Estimates are labeled to make clear they are not exact:
Segment size
Format
Example
Above 10,000
Count with margin of error
140,000 +/- 5,000
Below 10,000
Less-than value
<4,800
Both formats are rounded to signal the number is approximate. Estimates will never display as 0: if your segment has very few members, the estimate reflects a small non-zero estimate to avoid implying the segment is empty when records may exist.
Audience counts are available for subscription-based segments. User-based segment counts are not yet supported.
Your plan determines how many segments you can have at one time. Only active (non-paused) segments count toward this limit. Paused segments stay in your account but do not count, so you can pause segments you no longer use instead of deleting them.To free up capacity:
Pause segments you may want to use again later. The filter configuration is preserved and the segment can be resumed at any time.
Delete segments you no longer need.
See the pricing page for the segment limit on each plan.
Deleting a segment removes it from your list of segments. It does not delete the users inside it. To delete the users inside a segment, see Delete Users.
Dashboard
API
Go to Audience > Segments
Click the three-dot menu next to a segment
Select Delete
Segment options menu
Use the Delete Segment API. This only removes the segment definition, not the users inside it.
Yes. The segment editor shows counts for both subscribed and unsubscribed Subscriptions. Subscribed Subscriptions are opted in and will receive messages. Unsubscribed Subscriptions match your filters but are opted out and will not receive messages.Only subscribed Subscriptions are targeted when you send a message.When used in Journeys and in-app messages, segments include both subscribed and unsubscribed Subscriptions.
OneSignal always returns a count within approximately 15 seconds. For smaller or simpler segments, this is an exact count. For larger or more complex segments, an estimate is shown instead.Estimates are clearly labeled with their precision. See Audience counts for details on how estimates are formatted and what they mean.
Can I combine message event filters with subscription filters?
Outside of Journeys, no. Segments built with message event or custom event filters are user-based and cannot be combined with subscription-based segments for inclusion or exclusion. Inside Journeys, which are themselves user-based, you can combine both filter types for more flexible targeting.
No. Only active (non-paused) segments count toward your plan’s segment limit. Pause segments you no longer use to free up capacity without losing the filter configuration. See Segment limit for details.