APIs & Integrations

JHPS
Member

Traffic Source Not Tracked With API Form?

We are using an API form to submit contact data to hubspot. We are having an issue where the contact is marked as created from direct traffic, even when coming from organic search. We have followed the api guidelines for using hubspot cookie and hscontext parameters.

When we test, we use an incognito window and click through from google search and complete our forms. We are testing from IP’s that are not filtered.

One thing to note, the user completes an initial form with email and password, then on the subsequent page they complete an additional form with more contact details. The second form is the one that sends data to hubspot.

Thanks

John

0 Upvotes
6 Replies 6
Not applicable

Traffic Source Not Tracked With API Form?

@dadams we changed the Disable cookie tracking option that was set to yes and you can take a look to a new contact that was created after https://app.hubspot.com/contacts/2238251/contact/4468101/

0 Upvotes
Not applicable

Traffic Source Not Tracked With API Form?

@dadams We have found resolution for this issue. Thank you for help in resolving this matter. Have a great day.

0 Upvotes
Not applicable

Traffic Source Not Tracked With API Form?

Hi @dadams, I am a Project Manager with Payscape. Is it possible to pair you with our developer to expedite this matter? Also what would your team need from our developer to help with troubleshooting? We have implemented all suggested changes and are still not receiving the results desired.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Traffic Source Not Tracked With API Form?

Hi @JHPS

Is the tracking code installed on both of the pages with the two forms? And are the forms on the same domain or separate domains? The source we show is going to be for the first page view that we record, so the cookie that you’re passing with the form data to HubSpot would need to be the same cookie that would have been used to track the visit to the first page with the password form.

0 Upvotes
JHPS
Member

Traffic Source Not Tracked With API Form?

We have placed the tracking code on all pages, and we are still seeing it marked as direct traffic.

Here is an example contact https://app.hubspot.com/contacts/2238251/contact/4453351/

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Traffic Source Not Tracked With API Form?

@JHPS I took a look at that contact, and the form submission for the record did not have the utk in the in the data, so there wouldn’t be any actual analytics data for the record. The contact shows direct traffic as the source since that’s the default source for any contact created through a form submission.

Do you have an example of the POST data that was used for the form submission for that contact (or any other example contact)? If you’re form script is grabbing the hubspotutk cookie from the visitor, the most likely cause of this would be a formatting problem with the hs_context data in the POST data.

0 Upvotes