Set additional properties for creating contact via API

We have Integrated the HubSpot client with our lead management app, and we are creating the contact through API (Hubspot::Crm::Contacts::BasicApi.new.create ) when new signup happens in the lead management app.

We are sending the default properties, which are
{
“company”: “Biglytics”,
“email”: “bcooper@biglytics.net”,
“firstname”: “Bryan”,
“lastname”: “Cooper”,
“phone”: “(877) 929-0687”,
“website”: “biglytics.net”
}

But we need to send more additional properties like hs_analytics_last_referrer or hs_analytics_last_url, but all these are the ready-only fields, and we are getting that error response.

Recently I saw one post in the community related to this: https://community.hubspot.com/t5/APIs-Integrations/Set-quot-First-page-seen-quot-for-new-created-contacts-via-API/m-p/410829.

But in the reply, someone says the custom property, but my question is, even if we create the custom property, we cannot see that information under the Last referring site or Last Page Seen, and all right?

So how can we make it if we go for the custom property? Or how can we pass that information along with the default properties like

{
“company”: “Biglytics”,
“email”: “bcooper@biglytics.net”,
“firstname”: “Bryan”,
“lastname”: “Cooper”,
“phone”: “(877) 929-0687”,
“website”: “biglytics.net”,
“hs_analytics_last_referrer”: ‘https://www.test.com/sg/campaign/sapaad-online’
}

Hi, @KSapaad :waving_hand: Thanks for reaching out. Hey @ChrisoKlepke @Chris-M @LMeert, do you have any experience here?

Thank you! — Jaycee

Hi @KSapaad,

Using a custom property as mentionned in other thread won’t work with the hubspot native web analytics fields like Last referring site or Last Page Seen.

Why don’t you add the hubspot tracking script on your app and either :

- use the identify method when your users sign up ?

or

- use the forms API to submit a form a create a user while passing the hutk cookie value (used by HubSpot to make the link between web analytics data and a contact).

In both cases you’ll benefit from all web analytics data provided natively by Hubspot as well as any property you want to populate while creating your contacts.

Hope this helps !
If it does, please consider marking this answer as a solution :slightly_smiling_face:

Best,

Ludwig