feat(website): track email signups in PostHog#1702
Draft
anthonyiscoding wants to merge 4 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Capture a website_email_submit event in PostHog when a user successfully submits the email signup form, mirroring the Common Room notify timing but without the email address — only that a submission happened. Attach the Common Room visitor id (signals-sdk-user-id cookie) as both an event and person property so the two systems can be joined per visitor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Under person_profiles: 'identified_only' a bare $set on an anonymous visitor is dropped, so attach the Common Room visitor id via posthog.identify() instead — this creates the person profile and keys it to Common Room. Still capture website_email_submit so the conversion is recorded even without a Common Room id. No email is sent to PostHog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ookie Record the email in PostHog and identify the person by it (the key Common Room also de-anonymizes on), attaching the Common Room visitor id when present so the two systems join per visitor. Common Room writes its signals-sdk-user-id cookie asynchronously, so if it's absent at submit time wait 2s and retry once before recording without it. The submission is always recorded either way, with or without the Common Room id. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Read the signals-sdk-user-id cookie once at submit time and fire identify + capture immediately, instead of waiting 2s and retrying when the cookie is absent. If Common Room hasn't written the cookie yet we simply record without common_room_user_id. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
daba9ee to
e85b38a
Compare
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.
What
Records a
website_email_submitevent in PostHog when a visitor successfully submits the email signup form (hero or footer), mirroring the existing Common Room notification.submitToMailmodo, gated on Mailmodo success (2xx/409) — in lockstep with the Common Roomsignals.formcall.person_profiles: 'identified_only'.signals-sdk-user-idcookie) as both an event property and a person property when present, so the two systems can be joined per visitor. Read once at submit time; if the cookie isn't set yet we just record without it.form_location(hero/footer).No new event volume on anonymous traffic — only submitters become identified.
Files
website/posthog-consent.js—window.iiiNotifyPostHogEmailSubmit(email, formLocation)helper.website/index.html— wires the helper into the hero/footer submit flow.Notes
🤖 Generated with Claude Code