Skip to content

feat(cloud): PostHog analytics for trial conversion - #5825

Merged
Siumauricio merged 2 commits into
canaryfrom
feat/posthog-trial-analytics
Oct 31, 2026
Merged

Siumauricio merged 2 commits into
canaryfrom
feat/posthog-trial-analytics

Conversation

@Siumauricio

@Siumauricio Siumauricio commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds PostHog to Dokploy Cloud to understand why trials don't convert. Everything is gated by IS_CLOUD; self-hosted loads and sends nothing.

Server-side events

  • user_signed_up, trial_started, server_created
  • server_setup_succeeded/failed, deployment_succeeded/failed (single hook in updateDeploymentStatus)
  • subscription_activated (checkout / trial_converted), trial_ended, subscription_canceled from the Stripe webhook. A trial cancelled because the customer paid through checkout is not counted as lost.
  • Events from user actions carry the browser $session_id (PostHog tracing_headers for tRPC, onRequest hook for better-auth) so they link to the replay.

Frontend

  • posthog-js initialized only when settings.getPostHogConfig returns a key (cloud).
  • identify by Dokploy user id + organization group; reset on logout.
  • Session replay only for users on trial or without a plan (not paying, not Enterprise Cloud, not anonymous). Inputs, editors, terminals and logs are masked. Recording stops on payment, logout or leaving the dashboard.
  • getBillingStatus now returns isEnterpriseCloud to exclude those accounts.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Adds cloud-only PostHog events and trial session replay.

  • PostHog records limited dashboard sessions for Dokploy Cloud users.
  • Cloud signup, server, and deployment activity now reaches PostHog.
  • Stripe events distinguish new subscriptions, trial conversions, and lost trials.

Reviews (2) · Last reviewed commit: "feat(tracking): enhance PostHog event ca..." · Reviewed by Greptile

Cloud-only (IS_CLOUD). Server-side events for signup, trial, servers,
deployments and Stripe billing; frontend identify/group and session
replay limited to trial and no-plan users.
@Siumauricio
Siumauricio merged commit 46a0762 into canary Oct 31, 2026
5 checks passed
@Siumauricio
Siumauricio deleted the feat/posthog-trial-analytics branch October 31, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants