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/main/modules/TrackerModule.js

Class:
TrackerModule

Declaration:

public setCustomIdentifier(identifier: string)

Parameters:

Parameter Type Mandatory Default Description
identifier string yes - Customer’s custom identifier

Return Value:
No value is returned.

Example:

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/main/modules/TrackerModule.js

Class:
TrackerModule

Declaration:

public setCustomEmail(email: string)

Parameters:

Parameter Type Mandatory Default Description
email string yes - Customer’s custom email

Return Value:
No value is returned.

Example:

Synerise.Tracker.setCustomEmail("CUSTOM_EMAIL");

Send event


This method sends an event.

WARNING:

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

Note:
  • 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/main/modules/TrackerModule.js

Related To:
Event
CustomEvent

Class:
TrackerModule

Declaration:

public send(event: Event)

Parameters:

Parameter Type Mandatory Default Description
event Event yes - Event object

Return Value:
No value is returned.

Example:

let parameters = {
  "name": "John",
  "surname": "Rise",
  "company": "Synerise",
  "age": 25,
  "lastOrder": 380.50
};

let event = new CustomEvent("label", "my.action", parameters);
Synerise.Tracker.send(event);

Flush events from Tracker


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

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

Declared In:
lib/main/modules/TrackerModule.js

Class:
TrackerModule

Declaration:

public flushEvents(onSuccess: () => void)

Parameters:

Parameter Type Mandatory Default Description
onSuccess Function no - Function to be executed when the operation is completed successfully

Return Value:
No value is returned.

Example:

Synerise.Tracker.flushEvents(function() {
  // success
});

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker