Preset name and email in Web Widget error OR Cannot read property 'setVisitorInfo' of null | Community
Skip to main content

Preset name and email in Web Widget error OR Cannot read property 'setVisitorInfo' of null

  • July 23, 2018
  • 1 reply
  • 0 views

Hi, 

We are a part of the Integrated Chat (Early Access Program) for the Web Widget and currently in the middle of our Zendesk implementation. We are deploying the web widget on top of Guide and are expecting the widget contact form to pre-populate the name and e-mail address of the visitor (once authenticated into Guide). However, we seem to have run into issues. 

Widget API suggests to use zE.identify. So the following code was added to Guide:

<script>
$(document).ready(function(){

      console.log("Page loaded");

      zE(function() {

    console.log("HelpCenter.user.name = ", HelpCenter.user.name);
    console.log("HelpCenter.user.email = ", HelpCenter.user.email);

    console.log("Trying to preset User name and email");

    zE.identify({
        name: HelpCenter.user.name,
        email: HelpCenter.user.email
      });

    console.log("Trying to preset language");
    zE.setLocale('en-us');
  });
});
</script>

However our Widgets throws an error and is not pre-populating fields. 

Any advice? Andrey Sarapulov and Dan Muddiman from Zendesk implementation team are supporting us on this, but have reached out to Support for advice. 

-Matti-Esko

1 reply

Daniel100
  • July 24, 2018

Hi Matti-esko, thanks for making us aware of this bug, it has now been fixed. The widget contact form should now be pre-populating the name and e-mail address of the visitor when using zE.identify as expected.