Profile Sync
When syncWithProfile: true is set on LeadsOptions (or as a direct prop on CollectLead), submitted form data is automatically written to the user's Fans United profile after a successful lead submission. This is opt-in and defaults to false.
How it works
- The user submits the lead form.
- The component calls
sdk.leads.create(...)as normal. - If the call succeeds and
syncWithProfileistrue, the component then calls the SDK profile namespace with the user's data:sdk.profile.getOwn() .setName(...) .setEmail(...) // ...other setters .update(); - The user proceeds to the next stage regardless of profile-sync result. Profile-sync errors are logged but do not break the flow.
Synced fields
Only fields that are both included in the form configuration and have non-empty values are synced. Other fields on the profile are left untouched.
| Field | Synced as |
|---|---|
fullName | Profile name (takes priority over firstName/lastName) |
firstName + lastName | Combined as "firstName lastName" when both present |
firstName only | Profile name |
lastName only | Profile name |
email | Profile email |
phoneNumber | Profile phone number |
phoneCountryCode | Profile phone country code |
country | Profile country |
gender | Profile gender |
Name field priority
- If
fullNameis configured and has a value, it sets the profile name directly. - Otherwise, if both
firstNameandlastNameare configured and have values, the combined"firstName lastName"is used. - Otherwise,
firstName(if present) orlastName(if present) is used alone.
Enable on game components
import { LeadsOptions } from "fansunited-frontend-core";
const leads: LeadsOptions = {
position: "after",
fields: ["firstName", "lastName", "email", "phoneNumber", "country"],
campaignId: "engagement-2024",
campaignName: "Engagement Sync Campaign",
syncWithProfile: true,
};
<ClassicQuizPlay {...otherProps} leads={leads} />Enable on CollectLead
CollectLeadCollectLead exposes syncWithProfile as a top-level prop:
<CollectLead
entityId="lead-form-123"
sdk={sdk}
template={WidgetTemplate.STANDARD}
language="en"
fields={["firstName", "lastName", "email", "phoneNumber"]}
syncWithProfile={true}
/>Use cases
- Registration forms that double as profile updates.
- Newsletter signups that capture additional profile information.
- Engagement campaigns where you want a lead-and-profile event in one submission.
- Contact forms that enhance existing profiles with new fields.
Behavior notes
- Opt-in by default. If
syncWithProfileis omitted, no profile mutation happens. - Failures are isolated. A profile-sync error never blocks the lead submission — the user still sees the success screen.
- Empty fields are skipped. A configured but empty field will not overwrite an existing profile value.
- No deletions. Profile sync only sets values; it never clears or removes existing profile data.
