Mobile SDK
Accessing the SDK
The innerworks Mobile SDK is an npm package and can be found here: Innerworks-Mobile-SDK. Run the following command in your terminal to install the latest version of the SDK:
Steps to Achieve a Successful Integration
First Step
Identifying a Suitable Location to Integrate
When integrating the Innerworks Mobile SDK a suitable location within your mobile applciation needs to be identified as a suitable integration point.
The below is a non-exhaustive list of considerations to consider when choosing a location:
When a user leaves the page, it is difficult for them to get back to?
Will all users have to flow through this part of your site (i.e. an Onboarding Flow)?
Is user interaction required on this page (i.e. Typing and Screen Clicks)?
Second Step
Key Events Required for an Integration
The Innerworks SDK is designed to sit invisibly in the background to perform metric collection. To ensure optimal performance, the page where the SDK is instantiated should require the user to perform a set of actions. This should include entering text and/or screen clicks. Typical locations are sign in or sign up pages. Additionally, there will need to be some event which should be hooked into to trigger the sending of the metrics to the Innerworks API.
Third Step
Integrating into your Codebase
Once you have identified a suitable location on your site, import the InnerworksMetrics
object.
Add in text change events on any text fields
This will trigger tracking of the type of text entered (i.e. Text added or taken away and, the type of text added)
Send Metrics on Button Press
When the user clicks the button, call send
, passing in a UUID for the user (called socialId
). This can be an email, username, or wallet address.
Also pass in your Project_id
.
A boolean value will be returned indicating the success of the request.
Additional Functionality
Setting Optional Data
It is possible to add custom data to your payload.