The mParticle integration is available on the Enterprise plan.
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.
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.
Swift
Kotlin
Web
// 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)
// setting the Radar userId, but not leveraging a customer ID in mParticle// map by mParticleIdMParticle.getInstance()?.Identity()?.addIdentityStateListener { user, _ -> val mParticleId = user.id var radarMetadata = JSONObject() radarMetadata.put("mParticleId",mParticleId) Radar.setMetadata(radarMetadata)}
Follow instructions from mParticle for web initialization, then add the mParticle ID to Radar metadata on initialization.
window.mParticle={ config:{...identityCallback:function(result){if(result.getUser()){Radar.setMetadata({"mParticleId": result.getUser().getMPID()})}else{// the IDSync call failed}}}};(function(e){window.mParticle=...})("REPLACE WITH MPARTICLE API KEY");
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.
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.