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.

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 AdTag?

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

The 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.

A pushLogsNow method also exists in the SDK, to immediately send the logs saved in the database to the AdTag platform, each time a notification is displayed.

The Application Management section on AdTag allows you to manage:

  • The network that your application can use to send the logs back to the AdTag platform: WIFI_ONLY or ALL (for all types of networks)
  • The maximum number of logs mentioned above
  • The maximum waiting time mentioned above

Default settings are:

  • Network type: ALL
  • Maximum number of logs: 30
  • Maximum waiting time: 25 seconds

These settings can be updated at any time on the App Settings section of the Adtag Platform

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


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