Consent and user data
Open “Widget integration” in the sidebar, enable “Collect visitor data”, and choose a mode in “When to collect data”. In “Only with consent” mode, pass the decision from your banner to the widget. Signing in does not itself provide consent.
js
await window.FlowtomateWidget.ready();
window.FlowtomateWidget.setConsent('granted');
await window.FlowtomateWidget.identify('user_42', {
email: 'anna@example.com',
plan: 'pro'
});Pass the same user ID to identify on every sign-in and on other devices. Keep email in a separate field because it can change. Send all user fields as strings. When the plan or email changes, call await setTraits({ plan: 'team' }) after identify. See the JavaScript API guide for a detailed example.
setConsent('denied') stops collection and clears the event queue and the widget's persistent identifiers. setConsent('unknown') removes the saved choice. In “Without requesting consent” mode, collection may resume after unknown, so use denied for a refusal. setConsent returns void: await does not confirm that settings have loaded.
Do not call identify, setTraits, or track before consent. Even if “Only with consent” mode prevents recording audience data and events, early identify and setTraits calls can leave fields in page memory and send them in the next settings request. If the visitor declines, stop calling these methods in your code.
On sign-out, wait for the reset before another person signs in:
js
await window.FlowtomateWidget.reset();
await window.FlowtomateWidget.identify('user_73', { email: 'pavel@example.com' });A normal reset() retains the consent choice. If consent belongs to the account and must be requested again on the next sign-in, use await reset({ clearConsent: true }). In “Only with consent” mode, then wait for new consent before identify. See the privacy article for rules on handling data and the public key.