Identify leads

Set up the contact bot

While you are away, Closer’s bot can help you to gather contact information from the clients who reached out to you. To be able to do that, it needs to be set for the job correctly. In the Profile & Settings>widget configuration, you should add three mandatory fields:

1. Bot's welcome message

Customer leaving their contact data may depend on the tone of this message. You can learn more about this subject here

Bot's welcome message

2. GDPR agreement

Closer GDPR settings

3. Default prefix number

Phone default setting for faster entering data

Identify a customer via our JS SDK

The apiKey parameter allows you to identify customers logged in to your website or app, so that their conversation history is stored and synced. To get it, enter your endpoint’s URL to listen for the conversation.created webhook:

The data structure being sent contains the apiKey parameter. Store it and use it in the closer.init method every time the user is logged in with the same credentials.

closer.init({
orgId: "00000000-0000-0000-0000-000000000000",
apiKey: "00000000-0000-0000-0000-000000000000",
})

Push customer contact data to Closer

Your website or app usually has customer’s contact information at some point. You can use the closer.identify method to send this data to Closer. It will be automatically displayed on the dashboard and in the mobile app. You can call this method multiple times, every time some piece of information is added.

closer.identify({
firstName: "Jon",
lastName: "Snow",
email: "jon.snow@winterfell.com",
phone: {
region: "PL",
number: "+48123456789",
},
});

To remove data that is no longer valid for the current customer, just use the closer.identify with an empty string:

closer.identify({
email: "",
});

Send custom data about the customer

Closer also allows you to send custom data in the key: value format - you should use the additionalData parameter for that purpose. You can use it to send insights that will be visible to your team. You can also define the customer’s language via the languageLocale parameter, so that your team know in which language the customer was reading the website.

closer.identify({
languageLocale: "en",
additionalData: {
internalId: "value",
customerGroup: "premium",
},
});

Use widget in sidebar mode

Closer widget can also be displayed in a sidebar instead of floating on top of the page. In order to do that, you need to prepare a container that will hold the widget’s body after opening, and provide this container’s selector via the container parameter of the closer.init method.

closer.init({
orgId: "00000000-0000-0000-0000-000000000000",
container: "#widget-sidebar",
});