# PostHog PostHog is a product analytics platform that helps teams understand how users interact with their applications. It offers event tracking, funnels, retention and cohort analysis, session recordings, feature flags, and experimentation tools, enabling teams to build better products and make informed, data-driven decisions. ## What you can do with this integration The integration for PostHog lets you send events read in real-time from sources to PostHog to activate them.
## Session tracking Krenalis supports PostHog sessions with [automatic session tracking](#automatic-session-tracking) enabled by default. You only need to **manage it manually** if _all_ of the following are true: - You already use the PostHog JavaScript SDK on the client - You already track events both in the browser and on the server for the same user journey - You want PostHog to decide when a session starts and ends, not Krenalis To do this, you need to: 1. Read the session ID generated by the PostHog client 2. Send it to Krenalis as part of the event 3. Map the PostHog session ID to the `session_id` property in the pipeline transformation ### Automatic session tracking If you don't explicitly set a value for the `session_id` property in the pipeline transformation, Krenalis automatically generates a PostHog-compatible session ID and attaches it to every event forwarded to it, guaranteeing that sessions are correctly recognized and aggregated by PostHog. #### How Krenalis generates PostHog-compatible session IDs For every event, Krenalis creates a UUIDv7 where the timestamp component is derived from the event's session ID (minus one second), ensuring that the session start always precedes the first event. The remaining bits are deterministically derived from the anonymous ID, guaranteeing global uniqueness across users and sessions. This ensures that all automatically generated session IDs are valid UUIDv7 values, respect PostHog's timestamp constraints, and are safely aggregated into sessions without requiring any configuration.