What you will learn

This tutorial will teach you how our SDK analytics library works, to enable you to retrieve and leverage all of the beacon-related interaction analytics with the AdTag platform.

About Analytics

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

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

  • Number of notifications displayed for each beacon
  • Number & percentage of engagement on notifications

While our mobile SDK automatically generates some logs, others need to be manually configured in your application.

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

Notification display logs

Each time a beacon notification is displayed, the SDK automatically creates a corresponding log.

Notification engagement logs

Each time a user engages with (= clicks on) a beacon notification, the SDK automatically creates a corresponding log, called a redirect log.

If you are working with custom-built notifications, make sure you add a dictionary to the notification, which contains the Beacon content, which then allows the SDK to generate the logs automatically:

Switch to Swift

NSDictionary *infoDict = [NSDictionary dictionaryWithObject:[content toJSONString] forKey:KEY_NOTIFICATION_CONTENT];
let infoDict = NSDictionary.init(object: content.toJSONString(), forKey:KEY_NOTIFICATION_CONTENT);

Learn more about implementing a custom-built Notification Listener in the beacon notification tutorial

How to allow the SDK to generate notification redirect logs

Case 1: you are using the ATBeaconAppDelegate class

If you use the ATBeaconAppDelegate, notification redirect logs are generated automatically.

Case 2: you are not using the ATBeaconAppDelegate class

  • Open the AppDelegate.m file
  • In the didReceiveLocalNotification method, call the didReceiveLocalNotification method from the ATBeaconManager to generate notification redirect logs

Switch to Swift

 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
    [[ATBeaconManager sharedInstance] didReceiveLocalNotification:notification];
override func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
    super.application(application, didReceive: notification);