Segments give you the ability to group and target devices with more personalized and engaging messages. You can divide your total subscriber base into specific audiences based on Filter Types of data automatically tracked by the OneSignal SDK (like activity, country, language, etc.) along with custom data you send to OneSignal via Data Tags.
Segments are updated automatically once you set them. As users interact with your app or website, devices may be added-to or removed-from segments without any additional setup or tracking on your end.
For details on creating segments through our API see Create Segments POST Call.
Understanding the data used to create segments.
Mobile - The first date/time the user's device opened the app with OneSignal SDK active and valid network connection.
The most recent date/time the user's device communicated with OneSignal servers. Updated both when users arrive and leave app / website.
Mobile- The number of times the user's device has opened your app.
The total number of seconds the user's device has had your app open. Only accumulated for sessions that are longer than 60 seconds on mobile and 30 seconds on web. See How is usage duration calculated.
The amount the user has spent on In-App Purchases
Filter by code of In-App Purchase item.
Language of user's device. See Language & Localization for possible codes.
Version of your app gathered from Android Studio
Device operating system: Google Android, Huawei Android, iOS, Windows Phone, Chrome, Firefox, Safari, or Email
Requires Data - Tags you have added to the user's device. See Data & Tags for more details.
Requires Data - Radius in meters from a particular geocoordinate (lat, long).
Android - whether devices is rooted.
Deprecating - iOS, Android, Windows Phone ONLY - Whether user is not subscribed to notifications from another app you have access to.
The push notification record tied to a specific email set with our SDK
Country the user's device was in the last time it communicated with OneSignal servers.
Includes all test users that you have set up as a Test User.
Guide on creating segments through the OneSignal dashboard.
All possible Filter Types shown in your dashboard may be combined to create specific segments. Not all platforms support each Filter Type and not all filters have the same options.
For instance, the SESSION COUNT filter type requires both the operator (Greater than / less than / equal to / not equal to) and the number of sessions.
After adding your first filter, the 'ADD FILTER' button will create an "AND clause" which requires all devices to fit into all filters combined with "AND clauses".
For instance, you may have a SESSION COUNT filter of greater than 20 sessions, and a FIRST SESSION filter of after 72 hours. In this case, users must have both logged into your app more than 20 times AND started using your app more than 72 hours ago.
If you want to add filters without having them combined with other filters, you can instead click 'ADD OR' to separate groups of filters.
For instance, you may want to check engaged users by either 20+ sessions and last login less than 72 hours ago, OR 5+ sessions and last login less than 24 hours ago.
Simply click on the 'X' next to a filter to delete it from a segment. Note that any time a filter is added or deleted, the audience count is updated.
See our below Segments FAQ for more details on Counts.
If you ever need to delete a segment, just click on the segment from the segment list, and click the DELETE SEGMENT button in the bottom left corner of the Segment Editor. This does not delete the user records of the segment. To delete devices within a segment permanently, see Delete Users.
Once a segment has been created, it can be Set As Default which will be used as the first or default option when Sending Messages through the dashboard.
When you first create an app, the Subscribed Users segment will be default. If you wish to delete a segment that is "set as default", assign a different segment as default before deleting it.
Creating Segments with Tags and Location data.
Free OneSignal Apps can only contain 6 Active segments at a time if you have over 30,000 Subscribers.
If a segment is paused when trying to target it, the notification will fail.
You can "Pause" and "Set Live" segments from within the Segment Editor.
In order to set a PAUSED segment ACTIVE, you need to pause another ACTIVE segment first so you only have 6 segments active at a time.
Select the ACTIVE segment and click the "Pause" Button and confirm with the "Pause Segment" button.
Then select the PAUSED segment you wish to activate and click "Set Live"
The segment will immediately become ACTIVE and can be used for notification targeting.
Because segments are created by filters, you will need to add a tag for each user you wish to be in a segment. Then, when creating the segment, add a "User tag" filter to your segment matching the same tag.
Segments require a filter to group users. Unfortunately Player ID and External User ID are not filters, but you can add tags to select devices based on the Player ID or External User ID using our Importing User Attributes feature.
You can also target groups of devices by the User ID with our Create notification REST API.
You can view and export all users in a segment by going to the 'Audience' tab, then 'All Users', and then selecting the segment of interest from the drop-down menu on the left. Detailed instructions are here: Exporting Data.
Unfortunately we do not provide a way to detect mobile-web subscribers vs desktop-web subscribers automatically at this time. However, you can set this up with Adding Data Tags and following this example guide with code.
The OneSignal mobile SDKs will automatically track all previous in-app purchases as soon as the device opens the app with our SDK active, with the exception of 2 types:
1 - Previously bought "Consumable" in-app purchases. These are tracked with our SDK active but not previously bought without our SDK.
2 - Subscription based in-app purchases.
Once you reach over 100,000 Total Users, segment counts begin to be estimated in order to keep the dashboard running quickly and smoothly. To get the most accurate numbers, see the Delivery stats for the message sent to that segment.
For Android and iOS if a user backgrounds the app we don't call on_focus to update the usage time unless we have tracked 60+ seconds of the app being in focus. It is under 60 seconds the time caries over. For Web, usage duration is tracked after 30 seconds.
User opens the app
Uses app for 30 seconds
Backgrounds the app
We do our 60 sec check, only have 30 sec so skip network call
User reopens app
Uses app for 45 seconds
Backgrounds the app
We do our 60 sec check, have 75 sec of unreported time
Make on_focus call reporting 75 seconds of usage
Updated about a month ago