Skip to main content

Airship

Radar can send events and tags to Airship.

Use the Airship integration to send location-triggered and location-targeted messages to increase engagement and conversion, measure the ROI of location-based messaging, and build location-based user segments.

Configuration#

On the Airship Tokens page in Settings, create a token with the All Access role and copy the app key and access token. Under Partner Integrations, enable Radar to enable auto-population of custom event names and properties in the Airship Automation Composer.

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

Whenever events are generated, Radar will send custom events and tags to Airship. Note that for tags to populate, you must manually create tag groups in Airship first.

If you are using Airship SDK 13.x or earlier with Radar iOS SDK 3.0.4 or earlier or Radar Android SDK 3.0.6 or earlier, the Radar SDK will automatically collect Airship channel ID and Airship session ID. However, if you are using Airship SDK 14.0 or later with Radar iOS SDK 3.0.5 or later or Radar Android SDK 3.0.7 or later, you must set Radar metadata.airshipChannelId and metadata.airshipSessionId manually to collect Airship channel ID and Airship session ID.

Radar.setMetadata([  "airshipChannelId": Airship.channel.identifier,  "airshipSessionId": Airship.analytics.sessionID])

It is recommended to set the Radar user metadata once the Airship channel ID becomes available. This can be performed via the addChannelListener Airship methods.

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 an Airship campaign triggered from the Radar geofence entry event, the radar_geofence_entered custom event in Airship, and add property filtering where radar_geofence_tag is store. These same events can be used as part of an Airship campaign and the event properties can be used in message personalization with handlebars.

Radar triggered Airship 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 an Airship campaign targeted with the radar_geofence_tags tag group that Radar sends. This will be an array of all geofences the user is currently in, so set the tag to match the value of nearby-store for the radar_geofence_tag group. Additional attribute filtering can be performed for more complex targeting, including regional targeting.

Radar targeted Airship campaign

In-app messaging#

To trigger in-app messaging from detected user state on app open, custom events need to deliver through Airship's SDK rather than via Radar's server to server integration with Airship. To support this, implement custom logic in the SDK leveraging Radar's location update listener, on iOS or Android, to send foreground detections to Airship. The example code below assumes you are calling Radar.trackOnce() on application launch. See the iOS and Android tracking references if needed.

import RadarSDKimport AirshipKit
@mainclass AppDelegate: UIResponder, UIApplicationDelegate, RadarDelegate {
  func didUpdateLocation(_ location: CLLocation, user: RadarUser) {    if (user.foreground  && user.source == RadarLocationSource.foregroundLocation) {      if let place = user.place {        let event = CustomEvent(name: "radar_fg_place_detected");        event.interactionType = "location"        event.properties = [          "radar_place_name": place.name,          "radar_place_categories": place.categories.joined(separator: ","),          "radar_place_chain_slug": place.chain?.slug ?? ""        ]        event.track()      }      if let geofences = user.geofences {        let event = CustomEvent(name: "radar_fg_geofences_detected");        event.interactionType = "location"        event.properties = [          "radar_geofence_descriptions": geofences.compactMap({ $0.description }),          "radar_geofence_tags": geofences.compactMap({ $0.tag }),          "radar_geofence_external_ids": geofences.compactMap({ $0.externalId })        ]        event.track()      }    }  }}

User mapping#

Radar User FieldAirship Tag Group NameTypeExample TagContext Type
locationAuthorizationradar_location_authorizationstring"GRANTED_FOREGROUND"
locationAccuracyAuthorizationradar_location_accuracy_authorizationstring"FULL"
updatedAtradar_updated_attimestamp"2018-06-22T15:23:39.000Z"
segments[*].externalIdradar_segment_external_idsarray[string]["starbucks-visitors"]
topChains[*].slugradar_top_chain_slugsarray[string]["starbucks"]
topChains[*].externalIdradar_top_chain_external_idsarray[string]["123"]
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_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"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 TypeAirship Event
user.entered_geofenceGeofencesradar_geofence_entered
user.exited_geofenceGeofencesradar_geofence_exited
user.dwelled_in_geofenceGeofencesradar_dwelled_in_geofence
user.entered_placePlacesradar_place_entered
user.exited_placePlacesradar_place_exited
user.entered_region_countryRegionsradar_country_entered
user.exited_region_countryRegionsradar_country_exited
user.entered_region_stateRegionsradar_state_entered
user.exited_region_stateRegionsradar_state_exited
user.entered_region_dmaRegionsradar_dma_entered
user.exited_region_dmaRegionsradar_dma_exited
user.started_tripTrip Trackingradar_started_trip
user.updated_tripTrip Trackingradar_updated_trip
user.approaching_trip_destinationTrip Trackingradar_approaching_trip_destination
user.arrived_at_trip_destinationTrip Trackingradar_arrived_at_trip_destination
user.stopped_tripTrip Trackingradar_stopped_trip
user.entered_beaconBeaconsradar_beacon_entered
user.exited_beaconBeaconsradar_beacon_exited

radar_geofence_entered#

Radar Event FieldAirship Event PropertyTypeExample Value
geofence._idradar_geofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptionradar_geofence_descriptionstring"Store #123"
geofence.tagradar_geofence_tagstring"store"
geofence.externalIdradar_geofence_external_idstring"123"
geofence.metadata[{key}]radar_geofence_metadata_{key}{type}{value}
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_geofence_exited#

Radar Event FieldAirship Event PropertyTypeExample Value
geofence._idradar_geofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptionradar_geofence_descriptionstring"Store #123"
geofence.tagradar_geofence_tagstring"store"
geofence.externalIdradar_geofence_external_idstring"123"
geofence.metadata[{key}]radar_geofence_metadata_{key}{type}{value}
confidenceradar_confidencestring"high"
durationradar_durationnumber (minutes)42.1
foregroundradar_foregroundbooleantrue

radar_dwelled_in_geofence#

Radar Event FieldAirship Event PropertyTypeExample Value
geofence._idradar_geofence_idstring"5b2c0906f5874b001aecfd8e"
geofence.descriptionradar_geofence_descriptionstring"Store #123"
geofence.tagradar_geofence_tagstring"store"
geofence.externalIdradar_geofence_external_idstring"123"
geofence.metadata[{key}]radar_geofence_metadata_{key}{type}{value}
confidenceradar_confidencestring"high"
durationradar_durationnumber (minutes)5
foregroundradar_foregroundbooleantrue

radar_place_entered#

Radar Event FieldAirship Event PropertyTypeExample Value
place._idradar_place_idstring"59302bcf8f27e8a156bd4f91"
place.nameradar_place_namestring"Starbucks"
place.chain.slugradar_place_chain_slugstring"starbucks"
place.chain.nameradar_place_chain_namestring"Starbucks"
place.chain.metadata[{key}]radar_place_chain_metadata_{key}{type}{value}
place.categoriesradar_place_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_place_exited#

Radar Event FieldAirship Event PropertyTypeExample Value
place._idradar_place_idstring"59302bcf8f27e8a156bd4f91"
place.nameradar_place_namestring"Starbucks"
place.chain.slugradar_place_chain_idstring"starbucks"
place.chain.nameradar_place_chain_namestring"Starbucks"
place.chain.metadata[{key}]radar_place_chain_metadata_{key}{type}{value}
place.categoriesradar_place_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceradar_confidencestring"high"
durationradar_durationnumber (minutes)42.1
foregroundradar_foregroundbooleantrue

radar_country_entered#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"US"
region.nameradar_region_namestring"United States"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_country_exited#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"US"
region.nameradar_region_namestring"United States"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_state_entered#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"MD"
region.nameradar_region_namestring"Maryland"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_state_exited#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"MD"
region.nameradar_region_namestring"Maryland"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_dma_entered#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"26"
region.nameradar_region_namestring"Baltimore"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_dma_exited#

Radar Event AttributeAirship Event PropertyTypeExample Value
region.coderadar_region_codestring"26"
region.nameradar_region_namestring"Baltimore"
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_started_trip#

Radar Event AttributeAirship Event PropertyTypeExample Value
trip.externalIdradar_trip_external_idstring"299"
trip.metadata[{key}]radar_trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"
foregroundradar_foregroundbooleantrue

radar_updated_trip#

Radar Event AttributeAirship Event PropertyTypeExample Value
trip.externalIdradar_trip_external_idstring"299"
trip.metadata[{key}]radar_trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"
foregroundradar_foregroundbooleantrue

radar_approaching_trip_destination#

Radar Event AttributeAirship Event PropertyTypeExample Value
trip.externalIdradar_trip_external_idstring"299"
trip.metadata[{key}]radar_trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"
foregroundradar_foregroundbooleantrue

radar_arrived_at_trip_destination#

Radar Event AttributeAirship Event PropertyTypeExample Value
trip.externalIdradar_trip_external_idstring"299"
trip.metadata[{key}]radar_trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"
foregroundradar_foregroundbooleantrue

radar_stopped_trip#

Radar Event AttributeAirship Event PropertyTypeExample Value
trip.externalIdradar_trip_external_idstring"299"
trip.metadata[{key}]radar_trip_metadata_{key}{type}{value}
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"
foregroundradar_foregroundbooleantrue

radar_beacon_entered#

Radar Event AttributeAirship Event PropertyTypeExample Value
beacon._idradar_beacon_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_trip_metadata_{key}{type}{value}
confidenceradar_confidencestring"high"
foregroundradar_foregroundbooleantrue

radar_beacon_exited#

Radar Event AttributeAirship Event PropertyTypeExample Value
beacon._idradar_beacon_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_trip_metadata_{key}{type}{value}
confidenceradar_confidencestring"high"
durationradar_durationnumber (minutes)1.42
foregroundradar_foregroundbooleantrue