Introduction
Bluedot is a location platform that provides an accurate and straightforward geofencing platform for your apps. Use Bluedot to message smarter, automate mobile order check-ins, optimize workflows, and create frictionless experiences.
MoEngage <> Bluedot
The MoEngage and Bluedot integration allows you to use Bluedot geofence location services to create user events that can be used to build flows, campaigns and analyze customers’ behaviors and interests. Events (entry/exit) generated by the user on their device are sent immediately to MoEngage with all relevant information.
Use-Case
Target users when they are near your physical store with a promotional campaign to drive them in-store. Some common use cases include:
- QSR (Quick Service Restaurant)
- Click and Collect
- Drive-Thru
Integration
library_add_check |
Prerequisites
|
SDK setup
Step 1: Create a Bluedot project
Set up your Bluedot account and log into your Bluedot Canvas dashboard. Refer to the Bluedot documentation to learn how to create a new project.
Step 2: Integrate the SDKs
The application needs to be configured to send custom events to MoEngage when a Bluedot entry or exit trigger occurs. Follow these steps to integrate the Bluedot Point SDK and the MoEngage SDK in your app:
Android
override fun onZoneEntryEvent(geoTriggerEvent: GeoTriggerEvent, context: Context)
val properties = Properties()
properties.addAttribute("zone_id", geoTriggerEvent.zoneInfo.id")
.addAttribute("zone_name", geoTriggerEvent.zoneInfo.name)
.addAttribute("latitude", geoTriggerEvent.entryEvent()?.locations?.get(0)?.latitude)
.addAttribute("longitude", geoTriggerEvent.entryEvent()?.locations?.get(0)?.longitude)
.addAttribute("fence_id", geoTriggerEvent.entryEvent()?.fenceId)
.addAttribute("fence_name", geoTriggerEvent.entryEvent()?.fenceName)
.setNonInteractive()
MoEAnalyticsHelper.trackEvent(context, "customEventEntry", properties)
override fun onZoneExitEvent(geoTriggerEvent: GeoTriggerEvent, context: Context)
val properties = Properties()
properties.addAttribute("zone_id", geoTriggerEvent.zoneInfo.id")
.addAttribute("zone_name", geoTriggerEvent.zoneInfo.name)
.addAttribute("latitude", geoTriggerEvent.exitEvent()?.locations?.get(0)?.latitude)
.addAttribute("longitude", geoTriggerEvent.exitEvent()?.locations?.get(0)?.longitude)
.addAttribute("fence_id", geoTriggerEvent.exitEvent()?.fenceId)
.addAttribute("fence_name", geoTriggerEvent.entryEvent()?.fenceName)
.setNonInteractive()
MoEAnalyticsHelper.trackEvent(context, "customEventExit", properties)
iOS
func didEnterZone(_ triggerEvent: GeoTriggerEvent) {
var eventAttrDict : Dictionary<String,Any> = Dictionary()
let eventProperties = MoEngageProperties(withAttributes: eventAttrDict)
eventProperties.addAttribute(triggerEvent.zoneInfo.id, withName: "zone_id")
eventProperties.addAttribute(triggerEvent.zoneInfo.name, withName: "zone_name")
eventProperties.addAttribute(triggerEvent.entryEvent?.locations[0].coordinate.latitude ?? 0.0), withName: "latitude")
eventProperties.addAttribute(triggerEvent.entryEvent?.locations[0].speed ?? 0.0, withName: "speed")
eventProperties.addAttribute(triggerEvent.entryEvent?.eventTime.timeIntervalSince1970 ?? 0.0, withName: "timestamp")
let customData = triggerEvent.zoneInfo.customData
if !customData.isEmpty {
customData.forEach { data in properties["\(data.key)"] = "\(data.value)"}
}
MoEngageSDKAnalytics.sharedInstance.trackEvent("customEventEntry", withProperties: eventProperties)
To pass up Bluedot exit triggers, a similar code should be added for the didExitZone callback.