Hubspot Tracking

We’ve got HubSpot tracking added to our app - this allows us to have a Hubspot Live Chat popup. It’s working fine however at the moment, we’re not able to see the users email when they message us via chat.

Hubspot has a way of tracking this by passing a users email and id via a tracker.

What I’ve tried and what’s not working:
The below js is from the Hubspot docs but I’m not sure how to implement this in Anvil - especially how to pass the username and user id into this.

*/
var _hsq = window._hsq = window._hsq || [];
_hsq.push(["identify",{
    email: user.email,
    id: user.id
}]);
1 Like

Have you seen the worked example in the docs here? Anvil Docs | JavaScript