• Ready to build your local HubSpot community?

    HUG leaders host events, spark connections, and create spaces where people learn and grow together.

    Become a HUG Leader

Add value for custom field when user starts conversation in chat

vilgefo
Member

Hi! When user starts discuss in the hubspot chat, hubspot creates a new contact. I need to add value for the custom field for this contact. I tried add this value here (field "market"), but it doesn't work unfortunatelly. 

$response = $this->client->post('https://api.hubspot.com/conversations/v3/visitor-identification/tokens/create', [
            'headers' => [
                'Authorization' => sprintf('Bearer %s', $this->key),
            ],
            'json' => [
                'email' => $user->getEmail(),
                'firstName' => $user->getFirstName(),
                'lastName' => $user->getLastName(),
                'market' => "USA"
            ]
        ]);

How can I do this? Thanks for answers

0 Upvotes
1 Reply 1
Bryantworks
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

Hey @vilgefo,

 

Two quick questions here, is "market" the internal value of the custom property as well as "USA" being the internal value of the option?  If so, are you including _hsq.push(['trackPageView']) after the identify method?

Chris Bryant | Your Dedicated HubSpot Expert