Zipy
Search
K
Comment on page

Hubspot

Note : Make sure you have Zipy and Hubspot installed on your site.
Go to your Hubspot settings > Properties (Under data management). Select object type Contact. Select group to contact information. Then create the property.
Enter label name as Zipy session link. Copy its internal name(this will be used in further steps).

Configure the contact view

Go to your Hubspot settings > Contacts > Open any contact > Go to About this contact section and click on View all properties button at the bottom of this section.
Find Zipy session link property that we created in earlier steps.
Click on Add to your view button next to it

Allow tracked events to update contact properties

Go to your hubspot settings > tracking code > Advanced Tracking. Then turn on the Allow tracked events to update contact properties to allow code snippet to update the user’s Zipy session link

Adding code to your site:

Insert this code after body tag
<script type="text/javascript">
function sendZipySessionLinkToHubspot() {
const email = ''; //put your user email here, hubspot identifies user by its unique email id
/* if user has passed the email in chat then user will be identified */
const zipy_session /*property internal name*/ = window.zipy.getCurrentSessionURL();
const identifyData = email ? { email, zipy_session } : { zipy_session }
_hsq.push(["identify",identifyData]);
_hsq.push(['trackPageView']);
}
function onConversationsAPIReady() {
const hubspotWidgetActions = ['widgetLoaded','conversationStarted','unreadConversationCountChanged']; //Hubspot widget events
hubspotWidgetActions.forEach((action) => {
window.HubSpotConversations.on(action, () => {
sendZipySessionLinkToHubspot();
});
})
}
if (window.HubSpotConversations) {
onConversationsAPIReady();
} else {
window.hsConversationsOnReady = [onConversationsAPIReady];
}
</script>
Note:
To store Zipy session link for a user we need to first identify it then update its Zipy session link property.
A record for user will be created in hubspot only after the email is supplied by user in chat or set up by us in code. Until then the user will be seen as a visitor by hubspot.
For more information on this please read https://developers.hubspot.com/docs/api/events/tracking-code