Code for logging events in Unity games/apps to PostHog.
Originally forked from Gamefound PostHog.Net
import UnityPosthog.AnalyticsTracker;
// Log a basic event/user action
AnalyticsTracker.Track("usage_events/app_opened");
// Log an event with associated properties
AnalyticsTracker.Track("usage_event/example_event_with_properties"),
AnalyticsTracker.makeProperties(new Dictionary<string, object> { { "propertyKey", "propertyValue" } });
When UnityPosthog is first imported and used, User will be Identified and created in PostHog. You can modify what user properties they get in AnalyticsTracker.cs.