APIs & Integrations

rcanedo
Participant

How to identify a company with JS Widget?

Have a way to create/identify companies with _hqs?

 

Like identify a visitor, i need to identify a company too.

 

I am have all data from user and I don´t use forms, only widget like this: https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor but I need to company too

0 Upvotes
5 Replies 5
WendyGoh
HubSpot Employee
HubSpot Employee

How to identify a company with JS Widget?

Hi @rcanedo,

 

I hope all is well with you 🙂

 

Currently, the HubSpot tracking code API can only identify a visitor however do you mind sharing with me your use case here?

 

Also, to provide more context about the identify function, it stores the visitor data in a tracker and it is not actually passing the data into HubSpot; this means that the data will only be passed when either the track page view or track an event function is being called upon.

  • Breaking it down, this means that this function can only be call by visitor which is tied to a contact object. I wouldn't expect a company object to call any of these functions as in this case the company object would need to be associated with a contact object. 

With that said, if you're looking to create company record when a contact is being created, I'd suggest for you to toggle the Automatically create and associate companies with contacts feature on so that when a contact with an email e.g. hello@hubspot.com is being created within HubSpot, HubSpot will automatically create a HubSpot company object based on the contact's email address.

 

Hope this helps to clarify!

0 Upvotes
rcanedo
Participant

How to identify a company with JS Widget?

Thanks for your reply WendyGoh.

 

In my case, I will identify the contact whent it is logged in the app. At this moment I have all information from contact and it is identifyed by API (https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor)

 

When contact is logged in, I have the company information too, and I want identify this company from _hsq code (like identified contacts). 

 

It is not viable to create all companies in the plataform manualy and link it to the contacts.

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

How to identify a company with JS Widget?

Hi @rcanedo,

 

By manually creating all the companies in the platform, you mean manually creating within HubSpot?

 

In this case, if you toggle on the Automatically create and associate companies with contacts settings in your HubSpot account, you wouldn't need to manually create contacts and this is because HubSpot will automatically create the companies by looking at the contact's email domain (expect if the contact has a freemail email account e.g. gmail.com, HubSpot will look at the contact's Website URL property to attempt the match)

 

E.g. contact A has a email domain @hello.com > once the settings is toggle on > HubSpot will automatically create a company record (in this case e.g. Hello as the company domain name) and populate the record with HubSpot insights database.

 

Hope this helps to further clarify!

0 Upvotes
rcanedo
Participant

How to identify a company with JS Widget?

Thanks @WendyGoh 

 

In my case it don´t work, because int the most of the cases users don´t have bussiness domains. Users have gmail, hotmail and others public email domains.

 

I will need to save companies attributes in the contact attributes. I know it is not the best pratice, but i can´t see other best way.

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

How to identify a company with JS Widget?

Hi @rcanedo,

 

Saving the companies attributes in the contact attributes is one way. 

 

Another way is to set the website url property in the identify function:

 

To further elaborate my previous reply, if most of the users are using freemail email account, HubSpot will look at the contact's website url property to attempt to match the contact with a company's domain name.

  • In this case, we can use the website url property in the identify function
  • E.g:

 

_hsq.push(["identify",{
    email: getParameterByName("email"),
    website: 'www.hubspot.com'
}]);

 

0 Upvotes