What you will learn

This tutorial will teach you how to tag your application with our mobile SDK, in order to retrieve and leverage all the beacon interaction analytics related to alerts from the Adtag platform.

Prerequisites - What you need to get started

  • A Gitlab Account: The SDK is available through a private Gitlab. You must have received an email with an user account including a link to create a password.
  • Your SDK user information: To initialize the SDK, your should have received a Login, a Password and a Company name.
  • A beacon: A beacon configured on your account is mandatory to test the application.
  • An iOS Device: You need a compatible Bluetooth Low Energy iOS device that is able to detect beacons.
  • The Xcode application: Xcode should be downloaded from the App store

Overview of Analytics

The Adtag platform generates many types of analytics around the beacon usage and interactions, based on the logs created by the mobile SDK.

For instance, the Adtag platform manages the following alert-related metrics:

  • Number of alerts displayed for each beacon
  • Number & percentage of 'clicked-through' alerts

While the mobile SDK automatically generates some logs, others need to be tagged manually in the application by developers.

How does the SDK send logs to the Adtag platform ?

The SDK uses AdtagLogsManager to send logs to the Adtag platform.

AdtagLogsManager saves the logs in a specific database, and sends them in a dedicated thread when a maximum number of logs or a maximum waiting time is reached.

It exists as well a method called pushLogsNow that permits to send the logs saved in database immediatly to the Adtag platform. This method is called each time a notification is displayed.

AdtagLogsManager allows you to configure:

  • the maximum number of logs mentionned above
  • the maximum waiting time mentionned above
  • the network that your application can use to send the logs to the Adtag platform: it can be WIFI_ONLY or ALL (for all types of networks)

Default settings are:

  • Maximum number of logs: 5
  • Maximum waiting time: 20 seconds
  • Network type: ALL

Alert display logs

Each time a beacon alert is displayed, the SDK generates an analytics log automatically.

As a reminder, a beacon alert is the display of:

  • partial information of one chosen BeaconContent object
  • or the list of partial informations from the nearby BeaconContent objects (as illustrated in the Quickstart tutorial)

'Click-through' logs

Every 'click-through' action from an alert opens a new Activity. Developers must 'tag' their application using the SDK to generate a corresponding log.

This is what Connecthings calls a redirect log.

Redirect logs

Redirect logs can be generated using the ``` [ATBeaconManager sendRedictLog:beaconContent redirectType:redirectType from:from] `` method, which contains three parameters:

  1. BeaconContent: the beaconContent object for which the log is generated. It must be identifical to the object used to create the notification
  2. ATBeaconRedirectType: indicates the origin of the viewController. In this case, viewController was launched from an alert: ATBeaconRedirectTypeAlert
  3. From: use it to provide additional contextual information regarding the alert - for example, the Activity that originally displayed the alert - Be sure to use the same "From" value as the Android team

Step 1: Clone the SDK-tutorial repository

  • Open the iOS>Beacon>4-Alert-Analytic>Analytics folder

Step 2: Configure the SDK

  • Configure your CocoaPod and .plist files

  • Configure the SDK with:

    • the UUID of your beacon
    • the Adtag Platform you would like to connect,
    • and the login, password, and company informations received from Connecthings.

If you need more informations, have a look to the 5 minutes quickstart tutorial

Generate the log

Warning:

You must have completed the creating a beacon alert tutorial to continue.

  • Open the AlertViewController.m file

  • In the viewDidLoad method, add the [ATBeaconManager sendRedictLog:beaconContent redirectType:redirectType from:from] method to generate an alert log.

- (void)viewDidLoad {
    [super viewDidLoad];
    [...]
    [[ATBeaconManager sharedInstance] sendRedictLog:alertBeaconContent redirectType:ATBeaconRedirectTypeAlert from:@"MainView"];
    
}

Start testing

  1. In Xcode, launch the installation of the application you just built on your mobile phone.

  2. Activate your beacon and put your device in its correct action range (as defined in Adtag)

  3. Wait for a few seconds

  4. The title of the alert appears, as defined in Adtag, along with a button and the following text: Click to get more information.

    • This generates an alert log
  5. Click on the button and access the detailed content of the alert.

    • This generates a redirect log