Conversations showing 'Unknown Visitor' and not getting the contact's information


#1

Hi,

we have been trying to figure out this issue for a week, without success.
We connected Conversations to our page and our Slack channel and it does work broadly speaking. It just doesn't work completely.
Whenever a user is starting a chat in the widget, it registers as Unknown Visitor, although we identify our visitors. See below:

  • We have the hubspot script embedded in our HTML (obviously).

  • In our Root Component we run the following code:

      import { history } from '../history';
    
      export const trackPageViewHubSpot = location => {
        const hsq = window._hsq || [];
        hsq.push(['setPath', location.pathname + location.search]);
        hsq.push(['trackPageView']);
      };
    
      export const initializeHubSpot = () => {
        if (process.env.NODE_ENV !== 'production') return;
        const location = history.location || { pathname: '/', search: '' };
        const hsq = window._hsq || [];
        hsq.push(['setPath', location.pathname + location.search]);
        history.listen(trackPageViewHubSpot);
      };
    
  • When the user logs in we run:

    const hsq = window._hsq || [];
    hsq.push([
      'identify',
      {
        email
      }
    ]);
    

Since trackPageViewHubSpot gets run everytime history changes, the identifier should be sent to Hubspot after the next page visit/redirect.

The tracker itself works and records pages visited and activity for the user in Contacts.

What am I missing. It's been quite an annoying issue, given the time I spent on it and the Docs didn't.

Thank you for your feedback :pray: