On the Braze API Keys page under Rest API Keys, create and copy a new workspace API key with users.track permissions. Under Identification, copy your iOS and Android app identifiers.
Then, on the Radar Integrations page under Braze, set Enabled to Yes and paste your API key and app identifiers. Note that you can set separate API keys and app identifiers for the Test and Live environments. Finally, if your account is not on https://rest.iad-01.braze.com, select the appropriate API Endpoint.
Whenever events are generated, Radar will send custom events and user attributes to Braze. Events and user attributes from iOS devices will be sent using your iOS app identifiers, and events and user attributes from Android devices will be sent using your Android app identifiers.
By default, Radar userId maps to Braze external_id for logged in users. However, you can track logged out users or specify custom mappings by setting Radar metadata.brazeAlias or metadata.brazeExternalId. If you set metadata.brazeAlias, you must also add a matching alias in Braze with label radarAlias.
Swift
Kotlin
// track logged out users with alias (deviceId recommended, not required if not tracking logged out users)Radar.setMetadata(["brazeAlias": deviceId])AppDelegate.braze?.user.addAlias(deviceId, withLabel: "radarAlias")// track logged in users with custom external_id mapping (not required if using default mapping)Radar.setMetadata(["brazeExternalId": userId])AppDelegate.braze?.changeUser(userId: userId)
// track logged out users with alias (deviceId recommended, not required if not tracking logged out users)Radar.setMetadata(JSONObject().put("brazeAlias",deviceId))Braze.getInstance(context).currentUser?.addAlias(deviceId,"radarAlias")// track logged in users with custom external_id mapping (not required if using default mapping)Radar.setMetadata(JSONObject().put("brazeExternalId",userId))Braze.getInstance(context).changeUser(userId)
To test that the integration is configured correctly and can deliver data, use the Simulator to generate events. Click View on an event row and scroll down to the Logs section on the details page to verify delivery. Perform a similar process via a test app build with Radar location tracking enabled by spoofing location or moving into the relevant boundary.
All integration delivery can be monitored via the integration's event logs by clicking View event logs on the Integrations page.
Send a personalized push notification when a user arrives at a store#
Create Geofences in Radar with the geofence tag set to store. The geofence tag will be used to trigger messages for the subset of geofence entries where this tag is present.
Set up a Braze campaign triggered from the Radar geofence entry event, the entered_geofence custom event in Braze, and add property filtering where geofence_tag is store. These same events can be used as part of a Braze Canvas and the event properties can be used in message personalization with Liquid.
Create Geofences in Radar to represent nearby store boundaries with geofence tag set to nearby-store. The geofence tag will be used to target messages for the subset of geofences where this tag is present.
Set up a Braze campaign targeted with the radar_geofence_tags user attribute that Radar sends. This will be an array of all geofences the user is currently in, so set the attribute to include the value of nearby-store. Additional attribute filtering can be performed for more complex targeting, including how recently the location was updated via the radar_updated_at user attribute.
To trigger in-app messaging from the user state detected on app open, custom events need to deliver through Braze's SDK rather than via Radar's server to server integration with Braze. To support this, implement custom logic in the SDK leveraging Radar's location update listener, on iOS or Android, to send foreground detections to Braze. The example code below assumes you are calling Radar.trackOnce() on application launch. See the iOS and Android tracking references if needed.
Swift
Kotlin
import RadarSDKimport Appboy_iOS_SDK@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate, RadarDelegate { func didUpdateLocation(_ location: CLLocation, user: RadarUser) { if (user.foreground && user.source == RadarLocationSource.foregroundLocation) { if let geofences = user.geofences { var customEventProperties = [String:Array<String>]() customEventProperties["radar_geofence_descriptions"] = geofences.compactMap({ $0.__description }) customEventProperties["radar_geofence_tags"] = geofences.compactMap({ $0.tag }) customEventProperties["radar_geofence_external_ids"] = geofences.compactMap({ $0.externalId }) Appboy.sharedInstance()?.logCustomEvent("radar_fg_geofences_entered", withProperties: customEventProperties) } if let place = user.place { var customEventProperties = [String:Any]() customEventProperties["radar_place_name"] = place.name customEventProperties["radar_place_categories"] = place.categories customEventProperties["radar_place_chain_slug"] = place.chain?.slug ?? "" Appboy.sharedInstance()?.logCustomEvent("radar_fg_place_entered", withProperties: customEventProperties) } } return }}
class MyRadarReceiver: RadarReceiver() { override fun onLocationUpdated(context: Context, location: Location, user: RadarUser) { var userGeofences = user.geofences var userPlace = user.place if (userGeofences != null && userGeofences.isNotEmpty()) { var eventPropertiesJson = JSONObject() eventPropertiesJson.put("geofenceTags", userGeofences.map { it.tag }) eventPropertiesJson.put("geofenceDescriptions", userGeofences.map { it.description }) eventPropertiesJson.put("geofenceExternalIds", userGeofences.map { it.externalId }) var eventProperties = BrazeProperties (eventPropertiesJson) Braze.getInstance(context).logCustomEvent("radar_fg_geofences_entered", eventProperties) } if (userPlace != null) { var eventPropertiesJson = JSONObject() eventPropertiesJson.put("placeChainSlug", userPlace.chain?.slug ?: "") eventPropertiesJson.put("placeName", userPlace.name) eventPropertiesJson.put("placeCategories",userPlace.categories.toList()) var eventProperties = BrazeProperties (eventPropertiesJson) Braze.getInstance(context).logCustomEvent("radar_fg_place_entered", eventProperties) } }}
Radar APIs can be used in Braze connected content. See Braze's documentation for a connected content example. Use the API explorer in the dashboard to test relevant APIs.