The Adjust SDK provides an AdjustEvent
object which can be used to structure and send event information from your app to Adjust’s servers.
Instantiate an AdjustEvent object
constructor(eventToken: string)
To send event information with the Adjust SDK, you need to instantiate an AdjustEvent
object. This object contains variables that are sent to Adjust when an event occurs in your app.
To instantiate an event object, create a new AdjustEvent
instance and pass the following parameters:
eventToken
(string
): Your Adjust event token.
var adjustEvent = new AdjustEvent("abc123");Adjust.trackEvent(adjustEvent);
Send an event
trackEvent(event: AdjustEvent): void
You can associate your Adjust event tokens to actions in your app to record them. To record an event:
- Create a new Adjust event instance and pass your event token as a string argument.
- Call the
trackEvent
method with your event instance as an argument.
var adjustEvent = new AdjustEvent("abc123");Adjust.trackEvent(adjustEvent);
Example
This example shows how to record an event with the token g3mfiw
whenever a user interacts with a button.