Recent searches


No recent searches

Zendesk Chat Pre-Chat and Offline Forms - Any Way to Pre-Populate?



Posted Mar 13, 2024

I'm trying to figure out if there is any way to pre-populate the Name and E-mail address fields on the Pre-Chat and form that appears prior to a chat beginning (using the Web Widget (Classic). We'd also like to pre-populate these fields for users who attempt a chat after hours.

The API documentation does mention PreChatForm and OfflineForm setttings, but it appears to only allow for changing some display text.

https://developer.zendesk.com/api-reference/widget/settings/#prechatform

https://developer.zendesk.com/api-reference/widget/settings/#offlineform

Basically, I want to be able to do what the contact form API allows with pre-population of fields:

https://developer.zendesk.com/api-reference/widget/settings/#fields

 

I did find this recommended approach in another thread, but it doesn't seem to work:

<script type="text/javascript">
  zE('webWidget', 'identify', {
    name: 'Lex Luthor',
    email: 'ceo@lexcorp.com',
    organization: 'LexCorp'
  });
</script>

0

1

1 comment

Update: The webWidget identify approach DOES work after all. The trick is that JavaScript must be executed AFTER the JavaScript src tag that loads the Script library.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post