Skip to main content

mParticle

Radar can send events and user attributes to mParticle as an input feed. You can use events and user attributes to build audiences in mParticle, and mParticle can send events and user attributes to hundreds of outputs.

The mParticle SDK can also install and initialize the Radar SDK as a kit.

Use the mParticle integration to build location-based audiences and to forward location events and user context to any outputs.

Configuration#

Feed#

To configure the feed, in mParticle, add Radar input feeds for iOS and Android and copy your API keys and secrets.

Then, on the Radar Integrations page under mParticle Feed, set Enabled to Yes and paste your API keys and secrets.

Whenever events are generated, Radar will send events and user attributes to mParticle. Events and user attributes from iOS devices will be sent to the iOS input feed, and events and user attributes from Android devices will be sent to the Android input feed. The Radar Test environment automatically maps to the Development environment in mParticle, and the Radar Live environment automatically maps to the Production environment in mParticle.

By default, Radar sends the IDFV on iOS and Android Id on Android to associate the Radar events with the correct mParticle user. Additionally, the Radar userId maps to mParticle customerid for logged in users.

You can specify a custom mapping for the mParticle customer ID by setting Radar metadata.mParticleCustomerId. For example, on iOS:

// track logged in users with custom userId mapping (not required if using default mapping)
// map by mParticleCustomerIdRadar.setMetadata(["mParticleCustomerId": customerid])

If not leveraging a customer ID in mParticle but there is a need to set the Radar userId, collect the mParticle ID and set as Radar metadata.mParticleId.

// setting the Radar userId, but not leveraging a customer ID in mParticle
// map by mParticleIdlet options = MParticleOptions(key: "mp_key_..", secret: "mp_secret_...")options.onIdentifyComplete =  {(result: MPIdentityApiResult?, error: Error?) in  if (result?.user != nil) {    if let mpId = result?.user.userId {      let radarMetadata = ["mParticleId":mpId]      Radar.setMetadata(radarMetadata)    }  } else {    // handle failure  }}
MParticle.sharedInstance().start(with: options)

Kit#

To configure the kit, on the Radar Settings page under Keys, copy your test and live publishable keys. Then, in mParticle, add and enable Radar outputs for iOS and Android, paste your keys, and choose whether to run automatically.

Install the kit using CocoaPods or Carthage on iOS and Gradle on Android. See the iOS kit code and readme, Android kit code and readme, and mParticle Kit documentation for Radar.

The kit will initialize the Radar SDK and identify the user with the mParticle customer ID. After version 8.0.2 of the iOS kit and 5.15.1 of the Android kit, Radar will also set metadata.mParticleId to the MPID. In addition, if you chose to run automatically and the user has granted permissions, the kit will automatically track the user's location in the foreground on app open and/or in the background.

User mapping#

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

Radar User FieldmParticle User AttributeTypeExample ValueContext Type
metadata.mParticleIdmpidstring"4294967296"
metadata.mParticleCustomerId or userIdcustomeridstring"1"
deviceIdios_idfv or android_uuidstring"10974a2ee035770b9"
location.coordinates[0]radar_location_longitudenumber-76.350663
location.coordinates[1]radar_location_latitudenumber39.525665
locationAuthorizationradar_location_authorizationstring"GRANTED_FOREGROUND"
locationAccuracyAuthorizationradar_location_accuracy_authorizationstring"FULL"
_idradar_idstring"5b2c0906f5874b001aecfd8d"
updatedAtradar_updated_attimestamp"2018-06-22T15:23:39.000Z"
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_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#

user.entered_geofence#

Radar Event FieldmParticle Event AttributeTypeExample 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

user.exited_geofence#

Radar Event FieldmParticle Event AttributeTypeExample 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

user.dwelled_in_geofence#

Radar Event FieldmParticle Event AttributeTypeExample 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

user.entered_place#

Radar Event FieldmParticle Event AttributeTypeExample Value
place._idplace_idstring"59302bcf8f27e8a156bd4f91"
place.nameplace_namestring"Starbucks"
place.chain.slugplace_chain_slugstring"starbucks"
place.chain.nameplace_chain_namestring"Starbucks"
place.categoriesplace_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.exited_place#

Radar Event FieldmParticle Event AttributeTypeExample Value
place._idplace_idstring"59302bcf8f27e8a156bd4f91"
place.nameplace_namestring"Target"
place.chain.slugplace_chain_slugstring"target"
place.chain.nameplace_chain_namestring"Target"
place.categoriesplace_categoriesstring (comma-separated)"food-beverage,cafe,coffee-shop"
confidenceconfidencestring"high"
durationdurationnumber (minutes)42.1
foregroundforegroundbooleantrue

user.entered_region_country#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"US"
region.nameregion_namestring"United States"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.exited_region_country#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"US"
region.nameregion_namestring"United States"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.entered_region_state#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"MD"
region.nameregion_namestring"Maryland"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.exited_region_state#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"MD"
region.nameregion_namestring"Maryland"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.entered_region_dma#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"26"
region.nameregion_namestring"Baltimore"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.exited_region_dma#

Radar Event AttributemParticle Event AttributeTypeExample Value
region.coderegion_codestring"26"
region.nameregion_namestring"Baltimore"
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.started_trip#

Radar Event AttributemParticle Event AttributeTypeExample 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

user.updated_trip#

Radar Event AttributemParticle Event AttributeTypeExample 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

user.approaching_trip_destination#

Radar Event AttributemParticle Event AttributeTypeExample 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

user.arrived_at_trip_destination#

Radar Event AttributemParticle Event AttributeTypeExample 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

user.stopped_trip#

Radar Event AttributemParticle Event AttributeTypeExample 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

user.entered_beacon#

Radar Event AttributemParticle Event AttributeTypeExample Value
beacon._idbeacon_idstring"5b2c0906f5874b001aecfd8f"
beacon.descriptionbeacon_descriptionstring"Store #123 - Drive-Thru"
beacon.tagbeacon_tagstring"drive-thru"
beacon.externalIdbeacon_external_idstring"123"
beacon.metadata[{key}]beacon_metadata_{key}{type}{value}
confidenceconfidencestring"high"
foregroundforegroundbooleantrue

user.exited_beacon#

Radar Event AttributemParticle Event AttributeTypeExample Value
beacon._idbeacon_idstring"5b2c0906f5874b001aecfd8f"
beacon.descriptionbeacon_descriptionstring"Store #123 - Drive-Thru"
beacon.tagbeacon_tagstring"drive-thru"
beacon.externalIdbeacon_external_idstring"123"
beacon.metadata[{key}]beacon_metadata_{key}{type}{value}
confidenceconfidencestring"high"
durationdurationnumber (minutes)1.42
foregroundforegroundbooleantrue