iOS SDK Data Collection
In this page:
Visilabs uses events to collect data from IOS applications. The developer needs to implement the methods provided by SDK. customEvent
is a generic method to track user events. customEvent
takes 2 parameters: pageName and properties.
pageName : The current page of your application. If your event is not related to a page view, you should pass a value related to the event. If you pass an empty String the event would be considered invalid and discarded.
properties : A collection of key/value pairs related to the event. If your event does not have additional data apart from page name, passing an empty dictionary acceptable.
In SDK, apart from customEvent
, there are 2 other methods to collect data: login
and signUp
. As in the customEvent
method, the login
and signUp
methods also take a mandatory and an optional parameter. The first parameter is exVisitorId
which uniquely identifies the user and can not be empty. The second parameter properties
is optional and passsing an empty dictionary also valid.
In order for your data from the mobile channel to be uploaded to RMC, please pay attention that whatever reference value you have used in your active RMC account (KEY_ID * or E-Mail) comes from the mobile channel with this reference.
*KEY_ID: These are the id values used by the application owner to deduplicate the customer. These can be expressed with different names such as CRMid, userid, customerid, accountid.
Some of the most common events:
Sign Up
Visilabs.callAPI().signUp(exVisitorId: "userId")
Moreover, you can pass additional information to the optional parameter properties
when user signs up. The following example shows the call of signUp
method with properties which includes OM.sys.TokenID
and OM.sys.AppID
parameters. OM.sys.TokenID
and OM.sys.AppID
are required to send push notifications and OM.sys.AppID
parameter can be obtained by RMC web panel.
var properties = [String:String]()
properties["OM.sys.TokenID"] = "F7C5231053E6EC543B8930FB440752E2FE41B2CFC2AA8F4E9C4843D347E6A847" // Token ID to use for push messages
properties["OM.sys.AppID"] = "VisilabsIOSExample" //App ID to use for push messages
Visilabs.callAPI().signUp(exVisitorId: "userId", properties: properties)
Login
Like signUp
method login
method can be called with or without optional parameter properties
.
Visilabs.callAPI().login(exVisitorId: "userId")
Moreover you can add user segment parameters to properties
.
Page View
Use the following implementation of customEvent
method to record the page name the visitor is currently viewing. You may add extra parameters to properties dictionary or you may leave it empty.
Product View
Use the following implementation of customEvent
when the user displays a product in the mobile app.
Add to Cart
Use the following implementation of customEvent
when the user adds items to the cart or removes.
Product Purchase
Use the following implementation of customEvent
when the user buys one or more items.
Product Category Page View
When the user views a category list page, use the following implementation of customEvent
.
In App Search
If the mobile app has a search functionality available, use the following implementation of customEvent
.
Banner Click
You can monitor banner click data using the following implementation of customEvent
.
Add To Favorites
When the user adds a product to their favorites, use the following implementation of customEvent
.
Remove from Favorites
When the user removes a product from their favorites, use the following implementation of customEvent
.
Sending Campaign Parameters
After launching the application by clicking on a push message, use the following implementation of customEvent
.
Sending Location Status Information
You can send the location permission status of your users to the server as follows and use this information on the panel later.
This information can take one of the following 3 values:
"always" : Location permission is obtained while the application is open and closed.
"appopen" : Location permission is only obtained when the app is open.
"none" : Location permission is not obtained.
Push Message Token Registration
Visilabs needs to receive token to send push messages to users. The token value generated by APNS will be the value of the OM.sys.TokenID
key. The value of the OM.sys.AppID
could be obtained by RMC administration panel. Follow the link https://intelligence.relateddigital.com/a02/index#/Push/AppList and select the relevant push application. The value of App Alias
refers to OM.sys.AppID
. If you have problems, please contact RMC support team.
Copyright 2020 Related Digital