Skip to main content

Braze

Radar can send events and user attributes to Braze.

Use the Braze integration to send location-triggered and location-targeted messages to increase engagement and conversion.

Configuration#

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.

// 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)

Verify integration data delivery#

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.

Verify integration event delivery

All integration delivery can be monitored via the integration's event logs by clicking View event logs on the Integrations page.

Example use cases#

Send a personalized push notification when a user arrives at a store#

  1. 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.
  2. 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.

Radar triggered Braze campaign

Message all users nearby a store#

  1. 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.
  2. 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.

Radar targeted Braze campaign

In-app messaging#

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.

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  }}

Connected content#

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.

User mapping#

Note that Radar uses the special string "(null)" to represent null user attribute values.

Radar User FieldBraze User AttributeTypeExample ValueContext Type
metadata.brazeExternalId or userIdexternal_idstring"1"
metadata.brazeAliasradarAliasstring"10974a2ee035770b9"
locationcurrent_locationlocation(39.525665, -76.350663)
_idradar_idstring"5b2c0906f5874b001aecfd8d"
updatedAtradar_updated_attimestamp"2018-06-22T15:23:39.000Z"
locationAuthorizationradar_location_authorizationstring"GRANTED_FOREGROUND"
locationAccuracyAuthorizationradar_location_accuracy_authorizationstring"FULL"
segments[*].externalIdradar_segment_external_idsarray[string]["starbucks-visitors"]
topChains[*].slugradar_top_chain_slugsarray[string]["starbucks", "walmart"]
topChains[*].externalIdradar_top_chain_external_idsarray[string]["123", "456"]
geofences[*]._idradar_geofence_idsarray[string]["5b2c0906f5874b001aecfd8e"]Geofences
geofences[*].descriptionradar_geofence_descriptionsarray[string]["Store #123"]Geofences
geofences[*].tagradar_geofence_tagsarray[string]["store"]Geofences
geofences[*].externalIdradar_geofence_external_idsarray[string]["123"]Geofences
place._idradar_place_idstring"59302bcf8f27e8a156bd4f91"Places
place.nameradar_place_namestring"Starbucks"Places
place.categoriesradar_place_categoriesarray[string]["food-beverage", "cafe", "coffee-shop"]Places
place.chain.slugradar_place_chain_idstring"starbucks"Places
place.chain.nameradar_place_chain_namestring"Starbucks"Places
country.coderadar_region_country_codestring"US"Regions
country.nameradar_region_country_namestring"United States"Regions
state.coderadar_region_state_codestring"MD"Regions
state.nameradar_region_state_namestring"Maryland"Regions
dma.coderadar_region_dma_codestring"26"Regions
dma.nameradar_region_dma_namestring"Baltimore"Regions
postalCode.coderadar_region_postal_codestring"21014"Regions
trip.externalIdradar_trip_external_idstring"299"Trip Tracking
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"Trip Tracking
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"Trip Tracking
beacons[*]._idradar_beacon_idsarray[string]["5b2c0906f5874b001aecfd8f]"Beacons
beacons[*].descriptionradar_beacon_descriptionsarray[string]["Store #123 - Drive-Thru"]Beacons
beacons[*].tagradar_beacon_tagsarray[string]["drive-thru"]Beacons
beacons[*].externalIdradar_beacon_external_idsarray[string]["123"]Beacons

Event mapping#

Radar EventContext TypeBraze Event
user.entered_geofenceGeofencesentered_geofence
user.exited_geofenceGeofencesexited_geofence
user.dwelled_in_geofenceGeofencesdwelled_in_geofence
user.entered_placePlacesentered_place
user.exited_placePlacesexited_place
user.entered_region_countryRegionsentered_country
user.exited_region_countryRegionsexited_country
user.entered_region_stateRegionsentered_state
user.exited_region_stateRegionsexited_state
user.entered_region_dmaRegionsentered_dma
user.exited_region_dmaRegionsexited_dma
user.started_tripTrip Trackingstarted_trip
user.updated_tripTrip Trackingupdated_trip
user.approaching_trip_destinationTrip Trackingapproaching_trip_destination
user.arrived_at_trip_destinationTrip Trackingarrived_at_trip_destination
user.stopped_tripTrip Trackingstopped_trip
user.entered_beaconBeaconsentered_beacon
user.exited_beaconBeaconsexited_beacon

entered_geofence#

Radar Event FieldBraze Event PropertyTypeExample Value
geofence._idgeofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptiongeofence_descriptionstring"Store #123"
geofence.taggeofence_tagstring"store"
geofence.externalIdgeofence_external_idstring"123"
geofence.metadata[{key}]geofence_metadata_{key}{type}{value}
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

If Regions is enabled, Radar will also send the following attributes:

Radar Event FieldBraze Event PropertyTypeExample Value
country.codecountry_codestring"US"
country.namecountry_namestring"United States"
state.codestate_codestring"MD"
state.namestate_namestring"Maryland"
dma.codedma_codestring"26"
dma.namedma_namestring"Baltimore"
postalCode.codepostal_codestring"21014"

exited_geofence#

Radar Event FieldBraze Event PropertyTypeExample Value
geofence._idgeofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptiongeofence_descriptionstring"Store #123"
geofence.taggeofence_tagstring"store"
geofence.externalIdgeofence_external_idstring"123"
geofence.metadata[{key}]geofence_metadata_{key}{type}{value}
confidenceconfidencestring"high"
durationdurationnumber (minutes)42.1
foregroundforegroundbooleantrue

If Regions is enabled, Radar will also send the following attributes:

Radar Event FieldBraze Event PropertyTypeExample Value
country.codecountry_codestring"US"
country.namecountry_namestring"United States"
state.codestate_codestring"MD"
state.namestate_namestring"Maryland"
dma.codedma_codestring"26"
dma.namedma_namestring"Baltimore"
postalCode.codepostal_codestring"21014"

dwelled_in_geofence#

Radar Event FieldBraze Event PropertyTypeExample Value
geofence._idgeofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptiongeofence_descriptionstring"Store #123"
geofence.taggeofence_tagstring"store"
geofence.externalIdgeofence_external_idstring"123"
geofence.metadata[{key}]geofence_metadata_{key}{type}{value}
confidenceconfidencestring"high"
durationdurationnumber (minutes)5
foregroundforegroundbooleantrue

If Regions is enabled, Radar will also send the following attributes:

Radar Event FieldBraze Event PropertyTypeExample Value
country.codecountry_codestring"US"
country.namecountry_namestring"United States"
state.codestate_codestring"MD"
state.namestate_namestring"Maryland"
dma.codedma_codestring"26"
dma.namedma_namestring"Baltimore"
postalCode.codepostal_codestring"21014"

entered_place#

Radar Event FieldBraze Event PropertyTypeExample Value
place._idplace_idstring"59302bcf8f27e8a156bd4f91"
place.nameplace_namestring"Starbucks"
place.chain.slugplace_chain_idstring"starbucks"
place.chain.nameplace_chain_namestring"Starbucks"
place.chain.externalIdplace_chain_external_idstring"123"
place.chain.metadata[{key}]place_chain_metadata_{key}{type}{value}
place.categoriesplace_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

If Regions is enabled, Radar will also send the following attributes:

Radar Event FieldBraze Event PropertyTypeExample Value
country.codecountry_codestring"US"
country.namecountry_namestring"United States"
state.codestate_codestring"MD"
state.namestate_namestring"Maryland"
dma.codedma_codestring"26"
dma.namedma_namestring"Baltimore"
postalCode.codepostal_codestring"21014"

exited_place#

Radar Event FieldBraze Event PropertyTypeExample Value
place._idplace_idstring"59302bcf8f27e8a156bd4f91"
place.nameplace_namestring"Starbucks"
place.chain.slugplace_chain_idstring"starbucks"
place.chain.nameplace_chain_namestring"Starbucks"
place.chain.externalIdplace_chain_external_idstring"123"
place.chain.metadata[{key}]place_chain_metadata_{key}{type}{value}
place.categoriesplace_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceconfidencestring"high"
durationdurationnumber (minutes)42.1
foregroundforegroundbooleantrue

If Regions is enabled, Radar will also send the following attributes:

Radar Event FieldBraze Event PropertyTypeExample Value
country.codecountry_codestring"US"
country.namecountry_namestring"United States"
state.codestate_codestring"MD"
state.namestate_namestring"Maryland"
dma.codedma_codestring"26"
dma.namedma_namestring"Baltimore"
postalCode.codepostal_codestring"21014"

entered_country#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"US"
region.nameregion_namestring"United States"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

exited_country#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"US"
region.nameregion_namestring"United States"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

entered_state#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"MD"
region.nameregion_namestring"Maryland"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

exited_state#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"MD"
region.nameregion_namestring"Maryland"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

entered_dma#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"26"
region.nameregion_namestring"Baltimore"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

exited_dma#

Radar Event AttributeBraze Event PropertyTypeExample Value
region.coderegion_codestring"26"
region.nameregion_namestring"Baltimore"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

started_trip#

Radar Event AttributeBraze Event PropertyTypeExample Value
trip.externalIdtrip_external_idstring"299"
trip.metadata[{key}]trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagtrip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdtrip_destination_geofence_external_idstring"123"
foregroundforegroundbooleantrue

updated_trip#

Radar Event AttributeBraze Event PropertyTypeExample Value
trip.externalIdtrip_external_idstring"299"
trip.metadata[{key}]trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagtrip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdtrip_destination_geofence_external_idstring"123"
foregroundforegroundbooleantrue

approaching_trip_destination#

Radar Event AttributeBraze Event PropertyTypeExample Value
trip.externalIdtrip_external_idstring"299"
trip.metadata[{key}]trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagtrip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdtrip_destination_geofence_external_idstring"123"
foregroundforegroundbooleantrue

arrived_at_trip_destination#

Radar Event AttributeBraze Event PropertyTypeExample Value
trip.externalIdtrip_external_idstring"299"
trip.metadata[{key}]trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagtrip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdtrip_destination_geofence_external_idstring"123"
foregroundforegroundbooleantrue

stopped_trip#

Radar Event AttributeBraze Event PropertyTypeExample Value
trip.externalIdtrip_external_idstring"299"
trip.metadata[{key}]trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagtrip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdtrip_destination_geofence_external_idstring"123"
foregroundforegroundbooleantrue

entered_beacon#

Radar Event AttributeBraze Event PropertyTypeExample Value
beacon._idbeacon_idstring"5b2c0906f5874b001aecfd8f"
beacon.descriptionradar_beacon_descriptionstring"Store #123 - Drive-Thru"
beacon.tagradar_beacon_tagstring"drive-thru"
beacon.externalIdradar_beacon_external_idstring"123"
beacon.metadata[{key}]radar_beacon_metadata{key}{type}{value}
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

exited_beacon#

Radar Event AttributeBraze Event PropertyTypeExample Value
beacon._idbeacon_idstring"5b2c0906f5874b001aecfd8f"
beacon.descriptionradar_beacon_descriptionstring"Store #123 - Drive-Thru"
beacon.tagradar_beacon_tagstring"drive-thru"
beacon.externalIdradar_beacon_external_idstring"123"
beacon.metadata[{key}]radar_beacon_metadata{key}{type}{value}
confidenceconfidencestring"high"
durationradar_durationnumber (minutes)1.42
foregroundforegroundbooleantrue