Analytics for the React Native Module
Track user engagement and app performance with Airship analytics, including custom events, screen tracking, and associated identifiers.
For information about controlling what data Airship collects, see Privacy Manager.
Analytics events are batched and uploaded asynchronously in the background to minimize battery impact. The database size is fixed, so events are safely stored even when offline. Events may not upload immediately and may wait until the next app initialization if the app is closed before the upload completes.
Custom Events
Track user activities and key conversions with custom events. They require enabling analytics for your app. For detailed information, see the Custom Events guide.
// Import CustomEvent
import Airship, {
CustomEvent
} from '@ua/react-native-airship';
// ...
var customEvent: CustomEvent = {
eventName: "event_name",
eventValue: 123.12,
properties: {
"my_custom_property": "some custom value",
"is_neat": true,
"any_json": {
"foo": "bar"
}
}
}
await Airship.analytics.addCustomEvent(customEvent);Associated Identifiers
Associated identifiers (also called custom identifiers) associate an external identifier with a Channel IDAn Airship-specific unique identifier used to address a channel instance, e.g., a smartphone, web browser, email address.. They are visible in Real-Time Data StreamingA service that delivers user-level events in real time to your backend or third-party systems using the Data Streaming API.. We recommend adding any IDs that you may want to be visible in your event stream. You can assign up to 20 associated identifiers to a device. Unlike other identifiers (e.g., tags), you cannot use associated identifiers to target your users.
await Airship.analytics.associateIdentifier("key", "value");Screen Tracking
The Airship SDK gives you the ability to track which screens a user views within the application, how long a user stayed on each screen, and also includes the user’s previous screen. These events then come through Real-Time Data StreamingA service that delivers user-level events in real time to your backend or third-party systems using the Data Streaming API., allowing you to see the path a user took through the application, or trigger actions based on a user visiting a particular area of the application.
await Airship.analytics.trackScreen("MainScreen");Categories