Custom event log records button clicks, link clicks and other actions. The logs can be embedded when any action in the App is triggered, and used for custom event analysis and funnel analysis. According to business requirement, you can implement user behavior analysis through custom event tracking.
After integrating MAS to your client, you need to log in to the mPaaS console, and configure the relevant attributes and events on the Mobile Analysis Service > Custom Analysis > Custom configurations page. Then, you can view relevant data on the Custom analysis > Event analysis page.
Tracking
API
The custom event tracking API is defined in the MPRemoteLoggingInterface
class of MPMasAdapter
. The API is defined as follows:
/**
* Behavior tracking API. The client version, user ID, device ID, operating system version, network type, device type, and software version are automatically filled in, and no service tracking is required.
*
* @param bizType: optional, business type, which defaults to User_behavior_iOS. It is recommended that you fill in with the business identification.
* @param eventId: required, event tracking ID.
* @Param extParam: optional, extended parameter, which can be set by service personnel as required. The element is a dictionary, the dictionary content can be customized, and the dictionary will be converted into key-value strings and recorded in logs.
*/
+ (void)writeLogWithBizType:(NSString *)bizType
eventId:(NSString *)eventId
extParam:(NSDictionary *)extParam;
Parameters
bizType
: Optional, business type, which defaults toUser_behavior_iOS
. It is recommended that you fill in with the business identifier.eventId
: Tracking ID, corresponding to Event ID on the event creation page in the console.extParam
: Extension parameter. The key in the dictionary corresponds to Attribute ID on the attribute creation page in the console, and the value type determines Data type of the attribute.
Code sample
[MPRemoteLoggingInterface writeLogWithBizType:@"customBiz" eventId:@"customEvent" extParam:@{@"key":@"v"}];