feat(kiloclaw): add claw_trial_started and claw_transaction PostHog events#1346
Open
pedroheyerdahl wants to merge 4 commits intomainfrom
Open
feat(kiloclaw): add claw_trial_started and claw_transaction PostHog events#1346pedroheyerdahl wants to merge 4 commits intomainfrom
pedroheyerdahl wants to merge 4 commits intomainfrom
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.4-20260305 · 736,047 tokens |
…vents Add server-side PostHog tracking for KiloClaw trial creation and subscription payments to close the funnel visibility gap between signup and paid conversion.
4104c8a to
60bddfe
Compare
pandemicsyn
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two server-side PostHog events to close the KiloClaw funnel visibility gap between signup and paid conversion:
claw_trial_started— fires inensureProvisionAccesswhen a new trial subscription row is created during first provisioning. Properties:user_id,plan,trial_ends_at.claw_transaction— fires oninvoice.paidfor KiloClaw subscription invoices withamount_paid > 0. Wires up the previously-unusedinvoiceLooksLikeKiloClawByPriceIdclassifier. Properties:user_id,plan,amount_cents,currency,stripe_invoice_id,stripe_subscription_id.Both events use
google_user_emailasdistinctId, matching the codebase convention.claw_transactionruns insideafter()withIS_IN_AUTOMATED_TESTguard, matching theorganization-seats.tspattern for Stripe webhook PostHog events.claw_trial_startedcaptures inline, matching theuser.tspattern for tRPC-context events.Verification
pnpm typecheck— passes (no new errors, all pre-existing)oxfmt --list-different— passesoxlint— passes (0 warnings, 0 errors)eslint— passesVisual Changes
N/A
Reviewer Notes
ensureProvisionAccessis unchanged (no.returning()chain).invoiceLooksLikeKiloClawByPriceIdwas written previously but never wired up — this PR connects it to theinvoice.paidhandler instripe.ts.