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 zone-related interaction analytics with the Herow platform.
About Analytics
The Herow platform generates many types of analytics around zones usage and interactions, based on the logs created by the mobile SDK.
For instance, the Herow platform manages the following notification-related metrics:
- Number of notifications displayed for each zones
- Number & percentage of engagement on notifications
While the mobile SDK automatically generates some logs, others need to be manually configured in your application. In particular, the engagement logs require some implementation.
How does the SDK send logs to Herow?
The SDK uses the HerowAnalyticsManager object to send logs to the Herow platform.
The HerowAnalyticsManager saves the logs in a specific database, and sends them in a dedicated thread when a maximum number of logs and 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 Herow platform, each time a notification is displayed.
The Application Settings section on Herow allows you to manage:
- The network that your application can use to send the logs back to the Herow 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 Herow Platform
Being GDPR compliant
Please refer to the dedicated GDPR tutorial to make the SDK compliant with the GDPR.
Warning
Starting from version 3.0.3 on Android, the SDK won't collect analytics without getting the appropriate opt-ins
Notification display logs
Each time a local notification is displayed, the SDK automatically creates a corresponding log.
Notification engagement logs
Each time a user engages with (= clicks on) a local notification, the SDK automatically () creates a corresponding log, called a redirect log. () – pending the implementation of the following code
How to allow the SDK to generate notification redirect logs
Prior to iOS 10
- Open the AppDelegate.m file
- In the didReceiveLocalNotification method, call the didReceivePlaceNotification method from the HerowDetectionManager to generate notification logs
Switch to Swift
- (void) application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
[[HerowDetectionManager shared] didReceivePlaceNotification:[notification userInfo]];
}
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
HerowDetectionManager.shared.didReceivePlaceNotification(notification.userInfo)
}
Warning:
This method is deprecated after iOS 10.
In addition, on iOS 10 and later, the method won't be called if UNUserNotificationCenterDelegate is registered.
On iOS 10+
- Notifications analytics are automatically handled.