How do I prefill the user contact form in the widget?

Question

When users sign in to my website, I want the widget to identify them and prefill their name and email address in my contact forms. How do I capture the user's name and email address at the start of a conversation in my widget?

Answer

Zendesk offers two widget experiences:

Web Widget (the messaging widget)

Web Widget (Classic), the legacy widget for classic chat and contact forms

Setup differs by widget. First, verify which widget you use.

Web Widget

Use end-user authentication to identify the user and pass the name and email address to the widget. This step associates the conversation with the correct user and can prefill relevant forms. For details, see Authenticating end users in messaging for the Web Widget and mobile SDK.

Web Widget (Classic) and Chat-only Web Widget (Classic)

You can use the identify and prefill settings. For more information, see the developer documentation for the identify and prefill settings.

For complete instructions, see Advanced customization of the Web Widget (Classic).