Skip to content

feat: implement PostHog event triggers for user milestones and subscription tracking#2448

Closed
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1752540526-posthog-event-triggers
Closed

feat: implement PostHog event triggers for user milestones and subscription tracking#2448
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1752540526-posthog-event-triggers

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

PR description is being written. Please check back in a minute.

Devin Session: https://app.devin.ai/sessions/53f9c4916b874a769efa64fe0fa03165


Important

Implement PostHog event triggers for tracking user milestones and subscription status across various client-side and server-side components.

  • User Milestone Events:
    • user_create_project: Track first project creation in create.tsx.
    • user_import_project: Track first project import in index.tsx (local) and context.tsx (GitHub).
    • user_start_app_builder: Track first app start in use-start-project.tsx.
    • user_send_ai_message: Track first AI message in chat-input/index.tsx.
    • user_publish_project: Track first project publish in publish.ts.
    • user_map_custom_domain: Track first custom domain mapping in helpers.ts and index.ts.
  • Subscription Status Events:
    • subscription_event: Track subscription activation/cancellation in stripe.ts.
  • Implementation:
    • Added PostHog imports and event captures at strategic points.
    • Uses $set_once for milestones and $set for subscription status.
  • Testing:
    • Events triggered at project creation, import, app start, AI message, publishing, domain verification, and subscription changes.

This description was created by Ellipsis for 7c69533. You can customize this summary. It will automatically update as commits are pushed.

…iption tracking

- Add  events for user milestones:
  - user_create_project: Track first project creation
  - user_import_project: Track first project import completion
  - user_start_app_builder: Track first time opening project in builder
  - user_send_ai_message: Track first AI chat message
  - user_publish_project: Track first project publishing
  - user_map_custom_domain: Track first custom domain mapping

- Add  events for subscription status tracking:
  - subscription_event: Track subscription activation/cancellation

- Events follow existing PostHog patterns in codebase
- Client-side events for user interactions
- Server-side events for webhooks and publishing
- All events include timestamps for milestone tracking

Implements GitHub issue #2415

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel

vercel Bot commented Jul 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 1:39am
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 1:39am

@supabase

supabase Bot commented Jul 15, 2025

Copy link
Copy Markdown

This pull request has been ignored for the connected project wowaemfasoptxrdjhilu because there are no changes detected in apps/backend/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

- Fix FileSyncManager constructor (no parameters needed)
- Update updateCache calls to use SandboxFile objects
- Fix test expectations to compare SandboxFile objects
- Fix TemplateNodeMapper constructor (no parameters needed)
- Update processFileForMapping to use new signature
- Replace invalid readFile test with invalid content test

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
- Add toJS import from mobx to convert observables to plain objects
- Update test assertions to use toJS() for proper comparison
- Fixes CI test failures while maintaining PostHog functionality

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
- Replace Bun.file().stat() with Node.js fs.stat for compatibility
- Remove unused translation key from Spanish locale to match English reference
- Ensures CI passes for PostHog event triggers implementation

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
- Add disconnect method to all session mocks to prevent 'disconnect is not a function' errors
- Update mock return values to match SandboxFile structure
- Fix session setup for caching test to prevent 'No session found' errors
- Resolves 'Unhandled error between tests' issue

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
- Fix mock function call expectations to account for semicolon and newline added by SandboxManager
- All sandbox tests now pass locally (8 pass, 0 fail)
- Resolves mock expectation mismatches in writeFile tests

Co-Authored-By: kiet@onlook.dev <kiet@onlook.dev>
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.

1 participant