Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ def track_intro_form_posthog_submission(
)


def track_newsletter_posthog_submission(
form_data: dict[str, Any],
) -> rx.event.EventSpec:
"""Capture a newsletter_signup event in PostHog.

Returns:
Event that runs PostHog identify and capture in the browser.
"""
return _track_form_posthog("newsletter_signup", form_data, _COMMON_KEYS)
Comment thread
carlosabadia marked this conversation as resolved.


def get_posthog_trackers(
project_id: str,
api_host: str = POSTHOG_API_HOST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from email_validator import EmailNotValidError, ValidatedEmail, validate_email

import reflex as rx
from reflex_components_internal.blocks.telemetry.posthog import (
track_newsletter_posthog_submission,
)
from reflex_site_shared.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
Expand Down Expand Up @@ -104,6 +107,7 @@ async def signup(
return
yield IndexState.send_contact_to_webhook(email)
yield IndexState.add_contact_to_loops(email)
yield track_newsletter_posthog_submission({"email": email})
Comment thread
carlosabadia marked this conversation as resolved.
async with self:
self.signed_up = True
yield
Expand Down
Loading