APIs & Integrations

gargsatish0
Member

Pass Original Source and Original Source Drill Down 1 - Forms API

Hi Team,

 

We are doing an integration where we source leads from FB and then send those lead to our system thorugh Zapier Webhooks.

 

After that, we push that data to HubSpot using Forms API.

 

When we push the leads, they are showing as Direct under Original Source.

 

PFB the hs_context json that I am passing : 

{
"hutk": "random generated 32 character string",
"ipAddress": "14.142.193.238",
"pageUrl": "https://lp.ricssbe.org/sbe_brand_applications_2020",
"pageName": "SBE_Brand_applications_2020",
"redirectUrl": "https://lp.ricssbe.org/sbe_application_2020-thank-you",
"hs_analytics_source": "PAID_SOCIAL",
"hs_analytics_source_data_1": "Facebook"
}

 

I am fairly new to hubspot. Can you please help me out with what is it that I am doing wrong or if I need to change the approach.

 

Thanks!

 

0 Upvotes
2 Replies 2
glemosmoure
Participant

Pass Original Source and Original Source Drill Down 1 - Forms API

Hi Isaac,

 

One question. When writing out the JSON body for a contact, will the only properties updated be the properties present in the JSON body? That is, if I only include, say, the email, the name, and the original source properties, will those be the only ones updated and will the rest of the properties remain intact (not blank)? I am asking because I want to avoid having to type out a bajillion properties just to change one or two.

 

Thank you

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Pass Original Source and Original Source Drill Down 1 - Forms API

Welcome, @gargsatish0.

 

HubSpot automatically sets a contact's Original Source (hs_analytics_source) value based on analytics data associated with the hutk value passed in a form submisson and these criteria. It is not possible to set hs_analytics_source or hs_analytics_source_data_1 directly via a form submission.

 

That said, you can change hs_analytics_source (not its drill-downs) retroactively with the Contacts API.

 

Are you capturing HubSpot's hubspotutk cookie and placing its value in the hutk field?

 

For your use case, you must pass hubspotutk values which are associated with analytics events from when the visitor first clicked the Facebook ad. Said differently, the HubSpot tracking code must be present on any pages where Facebook visitors land and you must pass that same hubspotutk value after completing the Zapier webhook step.

Isaac Takushi

Associate Certification Manager
0 Upvotes