Skip to main content

OneSignal

Radar can send tags to and trigger notifications in OneSignal. You can create notifications triggered by tag changes.

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

Configuration#

On the OneSignal Settings page under Keys & IDs, copy your REST API key.

Then, on the Radar Integrations page under OneSignal, set Enabled to Yes and paste your API key. Note that you can set separate API keys for the Test and Live environments.

Whenever events are generated, Radar will call the edit device API and set tags in OneSignal. You can create notifications triggered by tag changes.

By default, Radar userId and deviceId do not map to OneSignal. To map users in Radar to devices in OneSignal, you must send the OneSignal player ID to Radar by setting metadata.oneSignalPlayerId. For example, on iOS:

let playerId = OneSignal.getPermissionSubscriptionState().subscriptionStatus.userIdRadar.setMetadata(["oneSignalPlayerId": playerId])

On Android:

String playerId = OneSignal.getPermissionSubscriptionState().getSubscriptionStatus().getUserId();JSONObject metadata = new JSONObject();metadata.put("oneSignalPlayerId", playerId);Radar.setMetadata(metadata);

User mapping#

Radar User FieldOneSignal Tag NameTypeExample TagContext Type
location.coordinates[1]latnumber39.525665
location.coordinates[0]longnumber-76.350663
segments[*].externalIdradar_segment_external_idsstring (comma-separated)"starbucks-visitors"
topChains[*].slugradar_top_chain_slugsstring (comma-separated)"starbucks"
topChains[*].externalIdradar_top_chain_external_idsstring (comma-separated)"123"
geofences[*]._idradar_geofence_idsstring (comma-separated)"5b2c0906f5874b001aecfd8e"Geofences
geofences[*].descriptionradar_geofence_descriptionsstring (comma-separated)"Store #123"Geofences
geofences[*].tagradar_geofence_tagsstring (comma-separated)"store"Geofences
geofences[*].externalIdradar_geofence_external_idsstring (comma-separated)"123"Geofences
place._idradar_place_idstring"59302bcf8f27e8a156bd4f91"Places
place.nameradar_place_namestring"Starbucks"Places
place.categoriesradar_place_categoriesstring"coffee-shop"Places
place.chain.slugradar_place_chain_slugstring"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"123"Trip tracking
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"Trip tracking
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"Trip tracking
trip.approachedradar_trip_approachedbooleantrueTrip tracking
trip.arrivedradar_trip_arrivedbooleanfalseTrip tracking
beacons[*]._idradar_beacon_idsstring (comma-separated)"5b2c0906f5874b001aecfd8f"Beacons
beacons[*].descriptionradar_beacon_descriptionsstring (comma-separated)"Store #123 - Drive-Thru"Beacons
beacons[*].tagradar_beacon_tagsstring (comma-separated)"drive-thru"Beacons
beacons[*].externalIdradar_beacon_external_idsstring (comma-separated)"123"Beacons