Skip to content

Commit 20f452e

Browse files
Add Koala identify tracking to newsletter signup flow (#1489)
* Add Koala identify tracking to newsletter signup - Add rx.call_script to trigger ko.identify() after successful email validation - Integrates with existing Koala pixel infrastructure - Maintains existing newsletter signup functionality - Returns both Koala identify call and success toast message Co-Authored-By: Alek <[email protected]> * Add error handling to Koala identify call - Wrap ko.identify() in try-catch block to prevent script errors - Ensures newsletter signup flow is never blocked by tracking failures - Logs warning to console if Koala identify fails - Maintains robust user experience with graceful degradation Co-Authored-By: Alek <[email protected]> * Add Koala identify tracking to pricing form submission - Add rx.call_script to trigger ko.identify() after successful form validation - Integrates with existing Koala pixel infrastructure - Maintains existing pricing form functionality - Uses same try-catch error handling pattern as newsletter signup - Ensures form submission flow is never blocked by tracking failures Co-Authored-By: Alek <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Alek <[email protected]>
1 parent 128e756 commit 20f452e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pcweb/pages/pricing/header.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ def submit(self, form_data: dict[str, Any]):
185185
# Send to PostHog for all submissions
186186
yield QuoteFormState.send_demo_event(form_data)
187187

188+
yield rx.call_script(f"try {{ ko.identify('{email}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}")
189+
188190
yield ThankYouDialogState.push(True)
189191
yield rx.redirect("/pricing?lead=1")
190192
return

pcweb/signup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,7 @@ def signup(
100100
self.send_contact_to_webhook(email)
101101
self.add_contact_to_loops(email)
102102
self.signed_up = True
103-
return rx.toast.success("Thanks for signing up to the Newsletter!")
103+
return [
104+
rx.call_script(f"try {{ ko.identify('{email}'); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"),
105+
rx.toast.success("Thanks for signing up to the Newsletter!")
106+
]

0 commit comments

Comments
 (0)