Getting User's Name and E-mail variables for Widget



  • Official comment
    Nicole Saunders
    Zendesk Community Manager

    Hey Jeremy - 

    I've posted the solution Dwight shared with Eric below. This isn't my area of expertise, so let us know if that answers your question or if you need more info: 



    Here's an article that walks through how to auto-populate that contact form:

    The basic gist is that you can insert the following code immediately after the web-widget code within your header page:

    Within my own test account, it looks like this:

    Please let me know if this helps with what you're trying to do!

  • Jonathan Pabon

    Hey Eric,

    The way you can get the current user attributes (for use in zE.identify) is by using the users./me.json endpoint. 

    More information on this can be found in this link:

    Hope that helps!

  • Eric Biddle

    Hello Jonathan,

    Thank you for the response, but are there better examples of actually utilizing something like this? 

    When actually editing the pages and trying to use this, I'm not sure how to actually use the get statement or tell the ze.Identify to pull the name and email from it. 

    Thank you again.

  • Dwight Bussman
    Zendesk Customer Care

    Hi Eric,

    I'm going to reach out to you within a ticket so that we're not going back and forth within here. I'd be happy to add our eventual solution back to this page once we've worked something out.

    I'll see you on that channel shortly! Thanks.

  • Jeremy Robinson

    Dwight/Eric, or anyone else who may look at this - 

    Any follow up on this from 3 years ago? Last comment was a solution coming back to this post, but no solution provided.

    I too am looking at how to populate the GET data for a user into a specific section of my code/scripts to gain usage data in our backend system. I can do some stuff with RegEx, but want to shy away from that as much as I can since it's not as reliable as a coded solution that pulls the correct data EVERY time a user is authenticated.

    I want to use this outside of the script.js file in our Copenhagen theme, and the values I am most interested in getting/populating are: UserID, Name, Email, Organization_ID


    Anyone else have thoughts on this too?

  • Jeremy Robinson

    Thanks Nicole, this does help with what I am trying to do. I appreciate the quick turnaround and follow up even through I posted on a several-years old thread.

  • Nicole Saunders
    Zendesk Community Manager

    Great! I'm so glad to hear that it's useful. You're quite welcome. :)


Post is closed for comments.

Powered by Zendesk