Sending events on iOS
You can send multi-level events in AppMetrica. For more information about displaying multi-level events, see Events.
To send a multi-level event, pass a key:value
pair in the event parameters. In the interface, key
and value
are considered nesting levels. Event parameters can be sent as an NSDictionary object.
To send a custom event with nested parameters, use the +reportEvent:parameters:onFailure:
method of the AMAAppMetrica
class:
NSDictionary *params = @{@"key1": @"value1", @"key2": @"value2"};
[AMAAppMetrica reportEvent:@"EVENT"
parameters:params
onFailure:^(NSError *error) {
NSLog(@"error: %@", [error localizedDescription]);
}];
The report in the web interface shows the following:
To send a custom event with nested parameters, use the reportEvent(name:parameters:onFailure)
method of the AppMetrica
class:
let params : [AnyHashable : Any] = ["key1": "value1", "key2": "value2"]
AppMetrica.reportEvent("EVENT", parameters: params, onFailure: { (error) in
print("DID FAIL REPORT EVENT: %@", message)
print("REPORT ERROR: %@", error?.localizedDescription)
})
The report in the web interface shows the following:
See also
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.