Go to the downloads page to download the BlackBerry Analytics SDK for Android or iOS.

Complete the following steps to verify that you are entitled to the BlackBerry Analytics app:

Log in to the BlackBerry UEM management console.

Click Apps.

Search for BlackBerry Analytics.

If you are entitled to use BlackBerry Analytics, the BlackBerry Analytics app appears in the app list. If you do not see the BlackBerry Analytics app in the app list, you must contact your BlackBerry representative to request entitlement.

1. In the UEM management console, click Users and select the user.

2. In the Apps section, click the plus icon.

3. Search for and select the BlackBerry Analytics entitlement.

4. Click Next.

5. In the Disposition drop-down list, select Required.

6. Click Assign.

Unzip the BlackBerry Analytics framework.

Under the Build Phases of the application target, add BAFBlackberryAnalytics.framework to the Link Binary with Libraries phase.

Under the Other Linker Flags build setting of the project, add -lstdc++ -lz –ObjC.

In AppDelegate, import Analytics.

Obj-C

#import <BAFBlackberryAnalytics/BAFBlackberryAnalytics.h

Swift

import BAFBlackberryAnalytics

Initialize the SDK in the didfinishlaunchingwithoptions method.

Obj-C

[BAFBlackberryAnalytics setStage];

Swift

BAFBlackberryAnalytics.setStage();

Relay BlackBerry Dynamics events to the BlackBerry Analytics engine by adding this code to the handleEvent method.

Obj-C

[BAFBlackberryAnalytics sendGDAppEvent:anEvent];

Swift

BAFBlackberryAnalytics.sendGDAppEvent(anEvent)

Extract the downloaded BlackBerry Analytics SDK.

Copy BlackBerryAnalytics-release.aar to the libs directory.

Add the following dependency in the module gradle file: compile(name:'BlackberryAnalytics-release', ext:'aar')

Declare the libs directory as a repository in the project gradle file.flatDir { dirs 'libs' }

Create a new class which has a superclass android.app.Application.

6. Change the android.name property of the application in the manifest file to the new class create in the last step.

7. Import BlackBerry Analytics SDK package in the new class.

import com.blackberry.analytics.analyticsengine.BlackberryAnalytics

8. Override the onCreate() method to initialize the BlackBerry Analytics.

BlackberryAnalytics.setStage(this.getApplication());

It takes 24 hours for the data to be updated on the BlackBerry Analytics Dashboard.

The BlackBerry Analytics Library introduces two APIs to track custom events in apps.

The following events are provided to use with APIs to track metrics.

Paired Events(Feature Active/Inactive) : These events provide the time slices to track the start/open or end/close events of specific task/feature.

Single Events (Adoption Event): This event uniquely represents a specific event/task that should be tracked in the portal.

Feature Active and Feature Inactive events are confined to the visible life cycle of the app. When the app moves to the background, the BlackBerry Analytics SDK marks all of the current active features as inactive features. Features that were active prior to the app going to the background will no longer be tracked as active features after the app moves to the foreground. The app will have to mark a feature as active when it is in the foreground again. Also, apps may need to call the trackFeatureEvent API to record Feature Inactive events when the apps view/screen is switched to different view/screen.

If the app calls the trackFeatureEvent API to record a Feature Inactive event after the app enters background, the BAFFeaturetNotFound response is returned.

Corporate

legal Info

BlackBerry uses cookies to help make our website better. Some of the cookies are necessary for proper functioning of the site, while others are to help us understand how you use it. Read more here about our cookies, and how you can opt out.