iBeacon tracking
iBeacon tracking allows you to measure and target micro locations using iBeacon and Low Energy Bluetooth.
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 in a store -
a.beacon.prox
- The following values represent how close the user is to the beacon:0
is unknown1
is immediate2
is near3
is far
Track iBeacons
-
Add the library to your project and implement lifecycle.
For more information, see Add the SDK and Config File to your Project in Core Implementation and Lifecycle.
-
Import the library:
#import "ADBMobile.h"
-
When a device is within the proximity of a beacon, call
trackBeacon
:[ADBMobile trackBeacon:beacon data:nil];
-
When the user leaves the proximity of the beacon, clear the current beacon:
[ADBMobile trackingClearCurrentBeacon];
Send additional data
In addition to the timed action name, you can send additional context data with each track action call:
[ADBMobile trackBeacon:beacon data:@{@"myapp.ImageLiked" : imageName}];
Context data values must be mapped to custom variables:
Examples
- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {
if (beacons.count > 0) {
CLBeacon *beacon = beacons[0];
// Adobe - track when in range of a beacon
[ADBMobile trackBeacon:beacon data:@{@"sampleContextData" : @"sampleContextDataVal"}];
}
}
// When the user leaves the proximity of the beacon, clear the current beacon
[ADBMobile trackingClearCurrentBeacon];