Answered

I'm wondering if I can assign a visitor an email address via API?

  • 2 February 2023
  • 1 reply
  • 58 views

Userlevel 3
I'm wondering if I can assign a visitor an email address via API?
icon

Best answer by Lisa B11 2 February 2023, 09:36

View original

1 reply

Hey @lisa b13​ 👋

 

This is definitely possible. Every visitor to your website is given a Visitor ID (you can find the visitor id of a person on the frontend with this JavaScript method: 

Intercom('getVisitorId')

 )

 

This script will return a string value which indicates the ID of the account which you can then use in the API to convert the visitor to a lead. Before you convert a visitor to a lead, I'd recommend you check to that the ID is not already a lead or a user in your systems. To check for this you will want to make a request through the API to see if the visitor exists.



Tip:

If you're thrown a 404 Error, you should next make a request to see if this person is already a lead

If you receive another 404 Error, then there's a good chance that this person is already a user, or that the person has been deleted from Intercom.

 

Once you've verified that your customer is a visitor, we can use their Visitor ID to convert them to a lead. After they've been converted to a lead, you'll want to update them with an email address. You could also submit a conversation on the lead's behalf.

 

Hope this helps 🙌

Reply