Skip to content

How to create events

There are two steps when defining new events: 1. Creating the event definition 2. Implementing the event

(1) Creating the event definition

Usually done by a tracking analyst or with their help. 1. Copy-paste the 0_Template.md file inside the EventList folder 2. Rename the pasted file as ID_EventName.md (e.g. 1_Registration.md) 3. Open the newly created file and modify/add the fields as required by your event

(2) Implementing the event (client)

  1. Create a struct that implements both IComponentData and ITrackingEventId
  2. Name the file as the event itself EventNameEvent.cs (e.g. RegistrationEvent.cs)
  3. Implement the Id that is defined in the event list document
  4. Add the fields that are not provided by default (generally speaking, those fields that are new in comparison to the 0_Template.md)
  5. Implement the handling of this new event type on your specific company event handler, to read and send the data to the tracking servers.
  6. Create the entity with the component in the part of code where relevant (e.g. create a new entity with the given RegistrationEvent component after performing the registration on the client)