Event tracking
Set custom identifier for events
This method sets a custom identifier in the parameters of every event.
You can pass a custom identifier to match your customers in our database.
Declared In:
lib/modules/tracker/tracker_impl.dart
Class:
TrackerImpl
Declaration:
Future<void> setCustomIdentifier(String customIdentifier)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
identifier | String | yes | - | Customer’s custom identifier |
Return Value:
No value is returned.
Example:
await Synerise.tracker.setCustomIdentifier("CUSTOM_IDENTIFIER");
Set custom email for events
This method sets a custom email in the parameters of every event.
You can pass a custom email to match your customers in our database.
Declared In:
lib/modules/tracker/tracker_impl.dart
Class:
TrackerImpl
Declaration:
Future<void> setCustomEmail(String customEmail)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
String | yes | - | Customer’s custom email |
Return Value:
No value is returned.
Example:
await Synerise.tracker.setCustomEmail("CUSTOM_EMAIL");
Send event
This method sends an event.
DO NOT send transaction.charge
events as custom events.
Transactions must be tracked with these endpoints:
/v4/transactions
(single transaction)/v4/transactions/batch
(multiple transactions)
- The tracker caches and enqueues all your events locally, so they all will be sent eventually.
- The API key must have the
API_BATCH_EVENTS_CREATE
permission from the Events group.
Declared In:
lib/modules/tracker/tracker_impl.dart
Related To:
Event
CustomEvent
Class:
TrackerImpl
Declaration:
Future<void> send(Event event)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
event | Event | yes | - | Event object |
Return Value:
No value is returned.
Example:
final paramMap = <String, String>{"firstKeyCustomParam": "TEST"};
CustomEvent event = CustomEvent("label", "flutter", paramMap);
await Synerise.tracker.send(event);
Flush events from Tracker
This method forces sending the events from the queue to the server.
API_BATCH_EVENTS_CREATE
permission from the Events group.Declared In:
lib/modules/tracker/tracker_impl.dart
Related To:
Event
CustomEvent
Class:
TrackerImpl
Declaration:
Future<void> flush()
Return Value:
No value is returned.
Example:
await Synerise.tracker.flush();