Mobile: What Are Analytics Callbacks and How Are They Used?
Overview
As of version 2.3.0 the WalkMe Mobile SDK supports analytics callbacks.
Callbacks are a programmatic way for an app to register to WalkMe analytics events. By implementing the Analytics Callbacks interface, apps can use the data transferred through the callback objects (including event type and event payload) and utilize it for the app's purposes - such as passing that information to any analytics or CRM system unrelated to WalkMe, or updating any app or user settings according to the user interaction with the app.
Use Cases
Analytics callbacks can used for the following and many more:
- Track user onboarding from any analytics system
- Generate opportunities in a CRM based on user engagement with app features - i.e. "Are you interested in unlocking the full app? Yes / No"
- Integrate with existing monitoring systems to track session related events in relation to campaign engagement - i.e. identify when in a session is campaign engagement highest
How to use Analytics Callbacks
Below is a description of all the required steps in order to implement analytics callbacks.
To be able to register to analytics callbacks, first implement this protocol:
@protocol WMAnalyticsDelegate <NSObject> /** * Called after an analytics event was sent. * * @param type The type of the event * @param payload The payload json that contains the event details */ - ( void )didSendAnalyticsEventOfType:(WMStatsEventType)type withPayload:(NSDictionary<NSString *, id> *)payload; @end |
After implementing the protocol, use the setAnalyticsDelegate method to register to the analytics callback events:
/** * Register a delegate to analytics events * * @param delegate The delegate * */ + ( void )setAnalyticsDelegate:(id<WMAnalyticsDelegate>)delegate; |
The callback will return the type of the event, together with the payload each event holds:
Type | Description |
SessionStarted | When the SDK starts a new session |
SessionStop | When the SDK stops |
AppEnteredFg | When app moves to foreground |
AppEnteredBg | When app moves to background |
PromoImp | On campaign impression |
PromoClk | On campaign interaction / Walk-Thru end |
StepImp | On step impression |
StepClk | On step dismissal |
Goal | Whenever tracked event (goal) is reached |
ViewTransition | On screen changes |
Users | On setting of User Attributes (through API) |
OnboardingItemCompleted | On OB item completed |