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.
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.
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.