Event types
Event types are automatically created in your schema when you create an event trigger.
An event trigger is a special kind of flag that has a Void return type — it doesn't return a value, but can be called like any other flag, to log an event.
By default, new event types contain:
A
contextfield with theContexttype, so they can capture the top-levelcontextpassed to the SDK.A
propertiesfield with an automatically created type, e.g.PageViewEventProperties. By default, the type is empty, but you can add event-specific properties here, e.g.href. You can then passpropertiesas an argument when calling the event trigger from your code.
This setup enables you to log events with both the top-level context you pass to the SDK and extra event-specific properties, with full end-to-end type safety based on your schema.
See the analytics guide for more details on logging events.
Last updated