Overview
Location-based segmentation allows you to send messages based on where your users are. OneSignal can segment users by Country, GPS coordinates, or custom tags which can be used to create timely, relevant outreach based on physical location. This guide explains how to configure segments by the available location options. As users interact with your app, their location data is updated in near real time and can be used to send messages via Journeys or any of our message creation tools.Target by country
Country is tracked based on the IP Address. This will automatically update each time the user opens your app. Use thecountry
Data Filter in Segments or API filters
.
Target by location (latitude, longitude, & radius)
If your mobile app collects GPS location and shares it with OneSignal, our SDK updates the user’s coordinates approximately every 5 minutes (based on permission and system rules). Note that if the app becomes force stopped, the location can not be tracked until the user opens it again.Your app must be setup to both:
- Share location updates with OneSignal
- Request and receive user permission to access location data
- Create segments using the
location
filter (radius targeting). - Trigger messages using the Create message API.

Location filter in Segments
Web push latitude and longitude tracking
OneSignal does not collect latitude/longitude for web-only users or users that do not have location tracking enabled for your mobile app. However, you can use data tags to set the location from your web app or use the Update User API to set the location points from your server. Tagging example:- Ask for location access in your web app. Here is a great Medium Post about this.
- Use JavaScript to detect the user’s coordinates.
- Send those coordinates to OneSignal using Data Tags.
sendTags
SDK method:
"long" > 37 AND "long" < 38 AND "lat" > -118 AND "lat" < -117
Target by city or custom location
OneSignal does not natively detect city or area codes. To target by city or custom location:- Let users input a city/region in a form.
- Or use JavaScript + reverse geocoding (e.g., Google Maps API) to infer city from coordinates.
- Send the city name as a Data Tag.
Target based on a Geofence (Radar Integration)
OneSignal supports advanced geofencing through Radar, a leading geolocation platform. With Radar’s SDKs and APIs, you can:- Trigger notifications when users enter/exit defined areas.
- Track delivery/pickup activity.
- Verify presence at a location.
- Power store locators, location-based offers, and more.
- Visit the Radar integration docs.
- Or contact Radar for onboarding support.
You can now send location-based messages. Automate with Journeys or create one-off messages.