Skip to content

Conversation

@mbifulco
Copy link
Owner

@mbifulco mbifulco commented Dec 2, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 2, 2025 20:13
@vercel
Copy link

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mikebifulco-com-bnbu Ready Ready Preview Comment Dec 2, 2025 8:16pm

Copy link
Contributor

Copilot AI left a 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_subscribe PostHog 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.

Comment on lines +84 to +85
email: data.email,
firstName: data.firstName,
Copy link

Copilot AI Dec 2, 2025

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',
});
Suggested change
email: data.email,
firstName: data.firstName,

Copilot uses AI. Check for mistakes.
Comment on lines +208 to +209
email,
firstName,
Copy link

Copilot AI Dec 2, 2025

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.

Suggested change
email,
firstName,

Copilot uses AI. Check for mistakes.
Comment on lines +206 to +210
posthog.capture('newsletter/attempting_subscribe', {
source,
email,
firstName,
});
Copy link

Copilot AI Dec 2, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +82 to +86
posthog.capture('newsletter/attempting_subscribe', {
source: 'subscribe-page',
email: data.email,
firstName: data.firstName,
});
Copy link

Copilot AI Dec 2, 2025

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.

Copilot uses AI. Check for mistakes.
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