Skip to main content
Answered

How to get the current user details in order to prepopulate forms

  • September 13, 2021
  • 4 replies
  • 596 views

  • New Participant
  • 1 reply

Hi everyone,

I have a WordPress website and have recently added intercom. The website itself doesn't have a function (or market need) to log users in, but I'd still like to remember and prefill their details across the website once they've entered their details once before (in the chat app, or website forms).

For example​, I have a quote form and if Intercom has the name and email stored I would like it to be pre-populated into the form (and vice versa).

My question is, how can I achieve this? Intercom doesn't appear to have a JS method to get the current user details.

Thanks in advance!

Sam.​

Best answer by Roy

Hello @sam k​ ,

 

@eric f11​ - Thanks for mentioning 🙏

 

To send Intercom data about form submission you can do it via Javascript API:

https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomboot-intercomsettings/p>

 

To get data from Intercom, you can use GetVisitorID via Javascript API:

https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomgetvisitorid/p>

 

Then with the following ID, you can pass website customer information via Intercom API.

 

I hope this will be helpful, let me know if you have any additional questions on this topic.

 

Best,

Roy

View original
Did this topic help you find an answer to your question?

4 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 17, 2021

Hey @roy s11​, you're particularly skilled in getting Intercom to integrate with different platforms, might you be able to help @sam k​ here?


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • Answer
  • September 20, 2021

Hello @sam k​ ,

 

@eric f11​ - Thanks for mentioning 🙏

 

To send Intercom data about form submission you can do it via Javascript API:

https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomboot-intercomsettings/p>

 

To get data from Intercom, you can use GetVisitorID via Javascript API:

https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomgetvisitorid/p>

 

Then with the following ID, you can pass website customer information via Intercom API.

 

I hope this will be helpful, let me know if you have any additional questions on this topic.

 

Best,

Roy


  • Author
  • New Participant
  • 1 reply
  • September 20, 2021

Thank you so much for your responses @eric f11​ and @roy s11​.

 

Roy, your answer has been helpful and I will try both both of your recommendations. Hopefully it works as planned.

 

Cheers!

Sam.


  • New Participant
  • 2 replies
  • September 13, 2023

@Roy this method doesn’t appear (link is broken).  Can you please update your answer?  Looking for the same.  I also would like to know how to retrieve the user infor using js method, ie, pull their email address.  I only see a method as GetVisitorId, but nothing returned other than the internal ID, and doesnt work (undefined) for logged in users.  I need this to be able to track our tool updating email addresses in. intercom, so we log when a user of a certain user_id, is identified in the JS methods we deploy with a different email address (tracking changed to that email address for a user_id in intercom).

Finally, if we were to send info like email address using visitor id, doesnt that turn them into an authenticated user?  Only method for that is update, or install?  I think the question is how to add data to Intercom without loggin them in.  Making them leads?

Thanks.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings