Track General Event
To track an event in Unity, you will use the TrackEvent
function. The following example demonstrates how to track an event from a Unity script.
Method Signature:
Explanation:
Calling the
TrackEvent
Method:The
TrackEvent
method is called on theactivity
object with the event name"casual_startgame"
.
Adding Parameters
If you need to pass additional parameters to the TrackEvent
function, you can modify the call to include a dictionary of parameters.
Modified Example Script:
Explanation:
Dictionary Creation:
A dictionary of parameters is created with key-value pairs.
Calling
TrackEvent
with Parameters:The
TrackEvent
method is called with the event name and the dictionary of parameters.
Last updated