Tracks a custom event with optional properties. Recording must be started, otherwise the event will be dropped.