// the event name used here will automatically
// appear in the goal and audience builders
The track function sends an event to Unless' system. The event can be connected in the dashboard to an audience (to join the audience) or a goal (to achieve the goal).
The options object is required and should be structured as follows:
|The name of the event.
|Used in case of a goal achievement to store the value of the goal conversion.
|Record additional traits to the visitor, see the updateProfile function for a description of the data format.
|callback function that will be executed after sending the event to our server.
Using an event to join an audience like described above is usually the preferred method because you don't have to know the exact audience ID. Alternatively, you can also join an audience directly using the audience ID by using the following API call.
You can also force a visitor to leave a specific audience. Remember, the visitor can re-join the audience at any time.