The CustomEvent class
Use the generic CustomEvent class to record events without creating dedicated event classes.
읽는 시간 1분최근 업데이트: 6달 전
For simplicity and quick turn-around, the Analytics SDK offers a generic class that you can use for any custom event in a very similar way to the plain dictionary API used in earlier SDK versions. This comes at the cost of the type safety and validation options offered by using dedicated sub-classes for each type of event, but may be useful during migration or prototyping.
CustomEventCustomEvent myEvent = new CustomEvent("MyEvent"){ { "fabulousString", "woah!" }, { "peculiarBool", true }, { "sparklingInt", 1337 }, { "spectacularFloat", 313.37f }, { "timelessTimestamp", DateTime.Now }};AnalyticsService.Instance.RecordEvent(myEvent);