Event tracking

Get customer's events


This method retrieves events for an authenticated customer.

This method requires customer authentication. Method name:
Client.getEvents(clientEventsQuery)

Declaration:

public static IDataApiCall<List<ClientEventData>> getEvents(ClientEventsQuery clientEventsQuery)
fun getEvents(clientEventsQuery:ClientEventsQuery):IDataApiCall<List<ClientEventData>>

Parameters:

Parameter Type Mandatory Default Description
clientEventsQuery ClientEventsQuery yes - Object to create clientEvent query

Return Value:
IDataApiCall<List<ClientEventData>> object to execute the request.

Example:

private IDataApiCall<List<ClientEventData>> getEventClientsCall;
    if (getEventClientsCall != null) getEventClientsCall.cancel();
    getEventClientsCall = Client.getEvents(clientEventsQuery);
    getEventClientsCall.execute(({ this.onSuccess() }), ({ this.onFailure() });
private val getEventClientsCall:IDataApiCall<List<ClientEventData>>
  if (getEventClientsCall != null) getEventClientsCall.cancel()
  getEventClientsCall = Client.getEvents(clientEventsQuery)
  getEventClientsCall.execute(({ this.onSuccess() }), ({ this.onFailure() })

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. Method name:
Tracker.setCustomIdentifier(customIdentifier)

Declaration:

public static void setCustomIdentifier(String customIdentifier)
fun setCustomIdentifier(customIdentifier:String)

Parameters:

Parameter Type Mandatory Default Description
customIdentifier String yes - Client's custom identifier

Return Value:
Void type method. Example:

Tracker.setCustomIdentifier(customIdentifier)
Tracker.setCustomIdentifier(customIdentifier)

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. Method name:
Tracker.setCustomEmail(customEmail)

Declaration:

public static void setCustomEmail(String customEmail)
fun setCustomEmail(customEmail:String)

Parameters:

Parameter Type Mandatory Default Description
customEmail String yes - Customer's email

Return Value:
Void type method.

Example:

private void setCustomEmail(String customEmail) {
    Tracker.setCustomEmail(customEmail);
}
private fun setCustomEmail(customEmail:String) {
  Tracker.setCustomEmail(customEmail)
}

Send event


This method sends an event.

DO NOT send transaction.charge events as custom events.
Transactions must be tracked with these endpoints:

  • 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.
  • It also supports Android O's Background Execution Limits.

    Method name:
    Tracker.send(event)

    Declaration:

    public static void send(Event event)
    
    fun send(event:Event)
    

    Parameters:

    Parameter Type Mandatory Default Description
    event Event yes - Event object (e.g. CustomEvent() instance).

    Return Value:
    Void type method.

    Example:

    Tracker.send(new CustomEvent("my.action", "label"));
    
    Tracker.send(CustomEvent("my.action", "label"))
    

    Flush events from Tracker


    This method forces sending the events from the queue to the server.

    The API key must have the API_BATCH_EVENTS_CREATE permission from the Events group.

    Method name:
    Tracker.flush()

    Declaration:

    public static void flush()
    
    fun flush()
    

    Parameters:
    No parameters required.

    Return Value:
    Void type method.

    Example:

    Tracker.flush();
    
    Tracker.flush();
    

    Canonical URL: https://hub.synerise.com/developers/mobile-sdk/method-reference/android/tracking