flagsmith
flagsmith copied to clipboard
fix: hubspot attribution issues
Thanks for submitting a PR! Please check the boxes below:
- [ ] I have added information to
docs/if required so people know about the feature! - [x] I have filled in the "Changes" section below?
- [x] I have filled in the "How did you test this code" section below?
- [x] I have used a Conventional Commit title for this Pull Request
Changes
⚠️ Hubspot is now in charge of initially creating (if not exists) / associating organisation with users. Reconciliation is based on domain.
- Pass hubspot cookie from frontend on signup action
- Reworked the hubspot tracking flow so that:
- Every new sign-up creates a hubspot contact (using
create_lead_formwith or without cookie) and savesHubspotLeads - On UsersOrganisation creation
a) If organisation was just created and exists in hubspot => get company data from hubspot, saves the
HubspotOrganisationobject with correct id b) if doesn't exist in hubspot for X reason => creates it and saves hubspot ID - On UsersOrganisation creation, associates the contact with the
- Removed the 30min background checker as hubspot creates/associates automatically the company
How did you test this code?
Please describe.
- Added battery of tests on client and lead_tracker
Functionally:
Set
"ENABLE_HUBSPOT_LEAD_TRACKING": "True"andHUBSPOT_ACCESS_TOKENCreate user, organisation, invite users