Track Custom Events
Reteno SDK
provides ability to track custom events.
RetenoPlugin().logEvent({required RetenoCustomEvent event});
Custom Event model:
class RetenoCustomEvent {
RetenoCustomEvent({
required this.eventTypeKey,
required this.dateOccurred,
this.forcePush = false,
required this.parameters,
});
final String eventTypeKey;
final DateTime dateOccurred;
final List<RetenoCustomEventParameter> parameters;
final bool forcePush;
}
-
eventTypeKey
- key qualifier of the event (provided by appDeveloper, confirmed by marketing team). -
dateOccurred
- time when event occurred (Date should be in ISO8601 format) -
parameters
- list of parameters, which describe the event -
forcePush
-iOS
-only feature; Please read more about it here
Parameter model containt key/value fields to describe the parameter:
class RetenoCustomEventParameter {
RetenoCustomEventParameter(this.name, this.value);
final String name;
final String? value;
}
Example of usage:
final dateOccured = DateTime.now();
final event = RetenoCustomEvent(
eventTypeKey: eventTypeName,
dateOccurred: dateOccured,
parameters: [
RetenoCustomEventParameter(<parameter_name>, <parameter_value>)
],
forcePush: true|false,
);
await RetenoPlugin().logEvent(event: event);