Engagement
The Engagement controller allows the app to send analytics events to the Mobify Engagement Engine.
Sample Usage
const engagementController = await EngagementController.init('engagementSlug', 'www.mobify.com')
engagementController.sendEvent('eventName', 'channelName', {dimension1: 'dimension1Value'})
Methods
EngagementController.init(slug, baseURL)
#
Creates and returns an instance of the Engagement controller that is used to make subsequent method calls.
- slug: project's identifier for the engagement engine
- baseURL: project's base URL
sendEvent(eventName, channel, dimensions)
#
Sends an event to the Mobify Engagement Engine.
- eventName: name of the event being sent to the engagement engine
- channel: name of the channel which will contain the event in the engagement engine
- dimensions: additional parameters to associate with the event in the engagement engine
sendAssociateEvent(channel, webAppEngagementId))
#
Sends an associate event to the Mobify Engagement Engine. Event allows native app to associate itself with a web app.
- channel: name of the channel which will contain the event in the engagement engine
- webAppEngagementId: engagement id from the web app hosted by the app