var G_name = 'My Name';
var G_email = 'myemail@gmail.com';
var G_phone = '92849287423987';
var G_transcript = '';
function sendDetails(conversationID){
var _hsq = window._hsq = window._hsq || [];
console.log('NAME : ' + G_name);
console.log('EMAIL : ' + G_email);
console.log('PHONE : ' + G_phone);
console.log('TRANSCRIPT : ' + G_transcript);
_hsq.push(["identify",{
email: G_email,
conversation_id: conversationID,
name: G_name,
phone: G_phone,
transcript: G_transcript
}]);
}
I call this function inside:
window.HubSpotConversations.on('conversationStarted', payload => {
sendDetails(payload.conversation.conversationId);
});
This info is not yet in my contact list... So I was expecting, according to identify documentation that it will be added automatically. But it is not there.
<script type="text/javascript">
function onConversationsAPIReady() {
console.log(`HubSpot Conversations API: ${window.HubSpotConversations}`);
}
/*
If external API methods are already available, use them.
*/
if (window.HubSpotConversations) {
onConversationsAPIReady();
} else {
/*
Otherwise, callbacks can be added to the hsConversationsOnReady on the window object.
These callbacks will be called once the external API has been initialized.
*/
window.hsConversationsOnReady = [onConversationsAPIReady];
}
</script>
One other note is that if you're using the identify function, that just stores the data in the tracker, but the data is not actually passed to HubSpot with this call. The data will only be passed when tracking a pageview or an event (with either thetrackPageViewor trackEvent functions). I'd be sure to add that to your code as well.
This info is not yet in my contact list... So I was expecting, according to identify documentation that it will be added automatically. But it is not there.
Hi @DakogIkog , if you know the identity of the customer visiting your site, you can pass those values to custom properties using the identify function. This information can be used in the chat widget. That said, a custom message would have to be built inside HubSpot, and can't be passed into the chat widget via the API.
This info is not yet in my contact list... So I was expecting, according to identify documentation that it will be added automatically. But it is not there.