# Collect Contacts’ Emails and Phone Numbers

Contacts’ email addresses and phone numbers are valuable information that can be used to identify an existing customer or lead for more context. With a better understanding of a customer or lead, agents can provide better assistance.

### Benefits of Collecting Contacts’ Emails and Phone Numbers <a href="#benefits_of_collecting_contacts_emails_and_phone_numbers" id="benefits_of_collecting_contacts_emails_and_phone_numbers"></a>

Use the email addresses or phone numbers collected to:

* [merge Contacts](https://docs.is-messenger.com/ismessenger/handling-inbound-conversations/broken-reference) when a Contact messages you from a different Channel.
* be able to [sync Contacts](https://docs.is-messenger.com/ismessenger/support-use-cases) and Contact properties with another CRM.

### Methods for Collecting Contacts’ Emails and Phone Numbers <a href="#methods_for_collecting_contacts_emails_and_phone_numbers" id="methods_for_collecting_contacts_emails_and_phone_numbers"></a>

Here are four methods that you can use to collect Contacts’ emails and phone numbers:

1. Automatically obtained from Channel's Metadata.
2. Ask for email or phone number using Workflows.
3. Use Pre-Chat Form on Website Chat Widget.
4. Identify logged-in Contacts via Website Chat Widget.

### **Automatically obtained from Channel's Metadata**

{% hint style="success" %}
**Use this method** when you are using channels that pass metadata containing Contact's email or phone number to respond.io platform.
{% endhint %}

Respond.io platform automatically receives Contacts’ emails or phone numbers for the following channels:

* [WhatsApp](https://docs.is-messenger.com/ismessenger/workspace-setting/channels)
* [SMS](https://docs.is-messenger.com/ismessenger/workspace-setting/channels)
* [Email](https://docs.is-messenger.com/ismessenger/workspace-setting/channels)

For channels that do not provide Contacts’ emails or phone numbers to respond.io platform, use the other methods to collect the information.

### **Ask for email or phone number using Workflows**

{% hint style="success" %}
**Use this method** when you expect Contacts to message you via instant messaging.
{% endhint %}

**Method Objectives**

* Select a Workflow Template and customize steps if needed
* Continue the Workflow when the question is skipped

### **Select Workflow Template and customize steps if needed**

In the **Workflows** module, click **+ Add Workflow** and choose your template:

* To collect emails, click **Welcome Message & Ask For Email** > Click **Use Template**.
* To collect phone numbers, click **Welcome Message & Ask For Phone Number** > Click **Use Template**.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/6x6dimkhoc/1687340155208/ask-4-email-pn-2.png" alt="Workflow Templates"><figcaption></figcaption></figure>

Customize the steps based on your business needs.

**1.** [**Trigger**](https://docs.is-messenger.com/ismessenger/modules/workflow): The Workflow starts when a conversation is opened by a Contact.

**2. Welcome Message**: [Sends a message](https://docs.is-messenger.com/ismessenger/modules/workflow) to greet your Contact.

**3. Have Email** / **Phone # already?**: This is a [Branch](https://docs.is-messenger.com/ismessenger/modules/workflow) step to check if the Contact Field already contains the email address or phone number.

| **Condition**                                  | **Outcome**        |
| ---------------------------------------------- | ------------------ |
| Contact’s email or phone number does not exist | Asks the question  |
| Contact’s email or phone number exists         | Skips the question |

**4. Ask for Email** or **Ask for Phone Number**: This [Ask a Question](https://docs.is-messenger.com/ismessenger/modules/workflow) step lets you send a message to the Contact asking for email or phone number if the Contact Field does not contain the email or phone number.

{% hint style="info" %}
Consider continuing your Workflow with [Routing](https://docs.is-messenger.com/ismessenger/support-use-cases/how-to-identify-contacts-by-email-and-phone-numberi) or [Assignment](https://docs.is-messenger.com/ismessenger/support-use-cases/how-to-identify-contacts-by-email-and-phone-numberi).
{% endhint %}

{% hint style="success" %}
Once you have completed the setup, click **Save** and **Publish** to activate the Workflow.
{% endhint %}

### **Use Pre-Chat Form on Website Chat Widget**

{% hint style="success" %}
**Use this method** when you expect Contacts to message you via Website Chat Widget.
{% endhint %}

When Contacts message from the Website Chat Widget, you’ll need to get their names in addition to the email addresses or phone numbers.

<figure><img src="https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FiycprK2RkkJ6Wz34bncT%2Fspaces_-Mbui1HRO4dGghy5ITOz_uploads_Yg8c2PN8doY0ujWqIJP1_Screenshot%202023-07-13%20113008.webp?alt=media&#x26;token=d9095c1c-ce76-466a-ae93-6d29a69a5b72" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Must-have:** Firstly, add and install the [IS Messenger Chat Widget](https://docs.is-messenger.com/ismessenger/messaging-channels/website-chat-widget). Learn more about [Pre-Chat Forms here](https://docs.is-messenger.com/ismessenger/messaging-channels/website-chat-widget).
{% endhint %}

Here’s how to set up the Contact information you want to collect from the Pre-Chat Form:

1. Click **Settings** > Click **Channels** > Click **Website Chat Channel** > Click **Customize**.
2. Open the Pre-Chat toggle and enable Pre-Chat Form.
3. Add *First Name* and *Email Address* or *Phone Number* fields to the form, and then make the fields Mandatory for Contacts to fill them out.

**Identify logged-in Contacts via Website Chat Widget**

{% hint style="info" %}
**Use this method** when you expect Contacts to message you via Website Chat Widget from a logged-in area on website.
{% endhint %}

If Contacts are logged in, you can automatically get the names, email addresses, phone numbers and more.

Follow the instructions to add JavaScript code to your website [here](https://docs.is-messenger.com/ismessenger/messaging-channels/website-chat-widget).
