Beacon tracking allows you to measure and target micro locations using iBeacon and Bluetooth Low Energy.
The following beacon data is sent to Analytics and Target when trackBeacon is called:
- a.beacon.uuid - ProximityUUID of the beacon
- a.beacon.major - Major number of the beacon (such as store number)
- a.beacon.minor - Minor number of the beacon (such as a unique number within a store)
- a.beacon.prox - Number 0-3 representing how close the user is to the beacon. 0 unknown, 1 immediate, 2 near, 3 far.
This beacon data is captured in mobile solution variables.
How to Track
Prerequisites: Add the library to your project and implement lifecycle.
- Import the library:
- Gather beacon location. Multiple 3rd party libraries are available for scanning bluetooth LE beacons, depending on the manufacturer of the beacon. After beacon information has been obtained it can be tracked with the following call:
// assumed that the following variables will have been retrieved by the 3rd party beacon library String beaconUUID; String major; String minor; Analytics.BEACON_PROXIMITY proximity; // BEACON_PROXIMITY is an enum available in the SDK. Number 0-3 representing how close the // user is to the beacon. 0 unknown, 1 immediate, 2 near, 3 far. Analytics.trackBeacon(beaconUUID, major, minor, proximity, null);
- When the user leaves the proximity of the beacon, clear the current beacon:
Sending Additional Data
In addition to the beacon data, you can send additional context data with each trackBeacon call:
HashMap cdata = new HashMap
(); cdata.put("myapp.ImageLiked", imageName); Analytics.trackBeacon(beaconUUID, major, minor, proximity, cdata);
Context data values must be mapped to custom variables in Adobe Mobile services:
Parent topic: Location