As of WalkMe Mobile SDK version 1.6.0 the WalkMe Mobile SDK supports campaign callbacks.
Callbacks are a programmatic way for an app to register to WalkMe Campaign events. By implementing the Campaign Callbacks interface, apps can use the data transferred through the callback objects (including Campaign and user information) 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 Campaign.
Campaign callbacks can be used for the following and many more:
Below is a description of all the required steps in order to implement campaign callbacks.
To be able to register to campaign callbacks, first register events on the campaignEventEmitter:
import RNWalkme from 'react-native-walkme-sdk'; // ... componentDidMount() { // ... this.campaignDismissedSubscription = RNWalkme.campaignEventEmitter.addListener( 'wmCampaignInfoEventDismissed', (event) => { console.log(event) } ); this.campaignShowSubscription = RNWalkme.campaignEventEmitter.addListener( 'wmCampaignInfoEventWillShow', (event) => { console.log(event) } ); } |
Use the remove() function to remove subscriptions when not needed:
componentWillUnmount() { // ... this.campaignDismissedSubscription.remove(); this.campaignShowSubscription.remove(); } |
The callback return object will includes the following information:
Item | Retreived By | Description |
Campaign CTA | "campaign_cta" |
The campaign CTA that the app user has interacted with. For all CTAs other than the custom one, the CTA returned will be: |
Campaign ID | "campaign_id" | The unique ID assigned to the campaign |
Campaign CTA ID | "cta_ud" | The unique ID for the Campaign CTA |
Campaign Data | "data" | A placeholder object added for possible future use of additional data appended to the campaign. Survey submission data is populated here. |