-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: nicer analytics funnel #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the newsletter subscription analytics funnel by adding a new newsletter/attempting_subscribe event that tracks when users submit the subscription form, before the API mutation is triggered. This provides better visibility into the subscription flow between form submission and the success/error outcomes.
Key changes:
- Adds
newsletter/attempting_subscribePostHog event tracking immediately before the subscription mutation in both subscription components - Enables tracking of subscription attempts that may fail before reaching the success/error handlers
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/components/SubscriptionForm/SubscriptionForm.tsx |
Adds newsletter/attempting_subscribe event capture after validation and posthog.identify(), before the mutation call |
src/app/subscribe/page.tsx |
Adds newsletter/attempting_subscribe event capture in the onSubmit handler, after posthog.identify() and before the mutation call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| email: data.email, | ||
| firstName: data.firstName, |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This analytics event includes personally identifiable information (email and firstName) which creates privacy concerns. Other analytics events in this file (lines 41-43, 57-59, 70-73) intentionally exclude PII and only send the source. Consider removing email and firstName from this event to align with the existing privacy-conscious pattern.
Suggested change:
posthog.capture('newsletter/attempting_subscribe', {
source: 'subscribe-page',
});| email: data.email, | |
| firstName: data.firstName, |
| email, | ||
| firstName, |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This analytics event includes personally identifiable information (email and firstName). While other events in this component (like newsletter/already_subscribed and newsletter/subscribed) include PII, it's worth noting that the same event in src/app/subscribe/page.tsx should follow a consistent approach. Consider whether PII is necessary for this analytics event or if just tracking the source would be sufficient for funnel analysis.
| email, | |
| firstName, |
| posthog.capture('newsletter/attempting_subscribe', { | ||
| source, | ||
| email, | ||
| firstName, | ||
| }); |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new newsletter/attempting_subscribe event lacks test coverage. Consider adding a test case to verify this analytics event is captured when a user submits the subscription form, similar to the existing tests for newsletter/spam_detected events.
| posthog.capture('newsletter/attempting_subscribe', { | ||
| source: 'subscribe-page', | ||
| email: data.email, | ||
| firstName: data.firstName, | ||
| }); |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new newsletter/attempting_subscribe event lacks test coverage. The file src/app/subscribe/page.test.tsx exists and should include a test case to verify this analytics event is captured when the form is submitted.
No description provided.