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.

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 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, an analytics log is automatically sent to the platform.

'Click-through' logs

Each time a beacon alert is clicked, the SDK automatically creates a corresponding log.

This is what Connecthings calls a redirect log.

These automatic logs are possible because the SDK sets up a convention for your beacon notification intent. To help you, the SDK comes with the class BeaconIntent which provides several static methods to add the correct parameters to your beacon intent.

In the case of an alert is clicked:

  • If the click launches a new activity, you can use the configureAlertIntent method from the BeaconIntent class that helps to configure your intent to generate a 'Click-through' log
	BeaconIntent.configureAlertIntent(YourIntentPackage, TheBeaconContent, RedirectType, TagOfYourActivity);
  • If the click triggers a new action inside the new activity, use the sendRedirectLog method from the AdtagBeaconManager to send the log:
	AdtagBeaconManager.getInstance().sendRedirectLog(TheBeaconContent, RedirectType, TagOfYourActivity);

Note:

The parameters of the methods are:

  • BeaconContent: the beaconContent object for which the log is generated. It must be identical to the object used to create the alert
  • AdtaglogData.REDIRECT_TYPE: indicates the origin of the activity. In this case, the activity was launched from an alert: AdtagLogData.REDIRECT_TYPE.ALERT
  • TAG: 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 tag than the iOs team

You can learn more about configuring your own BeaconAlertListener by reading the creating beacon alert tutorial