Skip to content

Location tracking

Location collection captures a user’s most recent location when the app was opened using GPS location data. You can use this information to segment data based on users who were in a defined location.

Enabling location tracking

To enable location collection on your app, refer to the developer guide for the platform you’re using:

In general, mobile apps will use the device’s GPS chip and other systems (such as Wi-Fi scanning) to track a user’s location. Web apps will use WPS (Wi-Fi Positioning System) to track a user’s location. All of these platforms will require users to opt-in to location tracking. The accuracy of your location tracking data may be affected by whether or not your users have Wi-Fi enabled on their devices. Android users can also choose different location modes—users that are on “Battery saving” or “Device only” mode may have inaccurate data.

SDK user location by IP address

As of November 26, 2024, Braze will detect user locations from the geolocated country using the IP address from the start of the first SDK session.

Before this, Braze used the country code from the device locale during SDK user creation and for the duration of the first session. Only after processing the first session start would the IP address be used for setting the more reliable country on the user. This meant that user country was set with greater accuracy only from the second session onwards, only after the first session start was processed.

Now, Braze will use the IP address to set the country value on user profiles created via the SDK, and that IP-based country setting will be available during and after the first session.

Location targeting

Using location tracking data and segments, you can set up location-based campaigns and strategies. For example, you may want to run a promotional campaign for users who live in a particular region or exclude users in a region that has stricter regulations.

Refer to Location targeting for more information on creating a location segment.

Hard setting the default location attribute

You can also use the users/track endpoint in our API to update the current_location standard attribute. An example is:

1
2
3
4
5
6
7
8
9
10
11
https://[your_braze_rest_endpoint]/users/track
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
  "attributes": [ 
 	{
 	  "external_id" : "XXX",
 	  "current_location" : {"longitude":-0.118092, "latitude": 51.509865}
      }
   ]
}

Partnership support for beacon and geofence

Combining existing beacon or geofence support with our targeting and messaging features gives you more information about your users’ physical actions so you can message them accordingly. You can leverage location tracking with some of our partners:

Frequently asked questions

Check out our Locations FAQ for answers to frequently asked questions about locations.

HOW HELPFUL WAS THIS PAGE?
New Stuff!