feat(onboarding): replace Cargo with a PostHog sign-up event
Ā
JU
1d ago+107+107+012345678901234567890123456789-112-112-012345678901234567890123456789
Summary
Sign-ups no longer go to Cargo. When onboarding creates the organization, the Console sends a user-signed-up PostHog event, and a PostHog ā HubSpot destination does what Cargo used to do.
- Console:
- The
user-signed-upevent is sent once, from the completion step that creates the organization, after the profile form. It carries:- email, first name, last name, company, job title, phone;
organization_id,signup_source: Console;- UTM params and
gclid.
- Removed
useSignUpCargoand theNX_PUBLIC_CARGO_API_TOKENenv var, including in the build workflow. useCreateUserSignUpno longer tracks anything.
- The
- PostHog destination (live, outside this repo): HubSpot - Inbound sign-up.
- Company: finds the company by email domain or creates it, and sets
lead_source = Inbound. Personal email domains are skipped. The company is resolved before the contact so HubSpot's auto-association doesn't create a duplicate. - Contact: creates or updates it with
lifecyclestage = leadandcontact_source = Inbound, and associates it with the company. An existing lifecycle stage is never downgraded. - Form: submits the HubSpot "Trial - All" form, as Cargo did, so form-based workflows and conversion reporting keep working.
- Company: finds the company by email domain or creates it, and sets
After merge
- Remove
NX_PUBLIC_CARGO_API_TOKENfrom the GitHub repository variables. - Turn off the Cargo model / HubSpot sync on the Cargo side.
- Re-enable "Filter out internal and test users" on the PostHog destination. It is temporarily off for testing.
Test plan
- Unit tests for
domains-onboarding-featureanddomains-users-sign-up-featurepass. - End-to-end test from local onboarding with a new email domain. In HubSpot:
- one company was created with
lead_source = Inbound; - the contact was created as
lead/Inboundand associated with that company; - the "Trial - All" conversion was recorded.
- one company was created with
š¤ Generated with Claude Code
Summary by cubic
Sign-ups no longer go to Cargo: onboarding now sends a user-signed-up PostHog event when it creates the organization, and a PostHog ā HubSpot destination handles the lead like Cargo did.
- The event is sent once from the completion step that creates the organization, after the profile form, with profile fields,
organization_id,signup_source: Console, and attribution params. - Restores UTM/gclid capture at app entry in
main.tsx(it stopped working after the move to TanStack Router), and reads stored values via a newgetStoredUtmParamshelper instead of an onboarding-local copy. Capture is best-effort and never breaks app startup whenlocalStorageis unavailable. - Removed
useSignUpCargoand theNX_PUBLIC_CARGO_API_TOKENenv var, including from the build workflow. - The PostHog destination creates or updates the HubSpot company and contact as inbound leads and submits the "Trial - All" form.
After merge
- Remove
NX_PUBLIC_CARGO_API_TOKENfrom the GitHub repository variables. - Turn off the Cargo model and its HubSpot sync.
- Re-enable "Filter out internal and test users" on the PostHog destination (temporarily off for testing).