User Identification
Attach a customer name and email to each submission so the inbox shows a real person.
<button
data-sf
data-sf-name="Ada Lovelace"
data-sf-email="ada@example.com"
>
Give Feedback
</button>You can also set data-sf-name and data-sf-email on the <html> element for a site-wide default. Use that when visitors open the widget from the floating button, which has no host element of its own.
In a single-page app, call identify() after login instead of putting attributes on every button. Later calls merge — you can pass only name or only email. Call identify(null) on logout. Identity is remembered for the current tab.
window.SupaFeedback.identify({
name: currentUser.name,
email: currentUser.email,
});A data-sf-name or data-sf-email attribute on the trigger or <html> still wins over identify(). An attached email also opts the visitor in for status-update emails.
Custom metadata
Any other key you pass to identify() is saved as metadata on each feedback submission and survey response. It shows in the feedback details panel, is searchable in the inbox, and is included in exports and webhooks.
window.SupaFeedback.identify({
name: currentUser.name,
email: currentUser.email,
userId: currentUser.id,
plan: "pro",
seats: 12,
});Values must be strings, numbers, booleans or null. Nested objects and arrays are dropped. You can send up to 30 keys, key names up to 40 characters (letters, digits, _, ., -), and strings up to 500 characters. Later calls merge, and passing a key as undefined removes it.