Traffic source is not set correctly for API submitted forms

contacts

#1

Hello,

I am trying to submit the form data using API and it works successfully. I am passing following details in hs_context parameter:
‘hutk’ => hubspotutk cookie value,
‘ipAddress’ => ip address of the server making webhook call,
‘pageUrl’ => link of the page where user submitted the form, e.g. ‘https://www.eiseverywhere.com/160551’,
‘pageName’ => title of the page

Although, all these details, specially hutk, are passed correctly to hubspot from api call, it still generate and show the contact’s source as “Direct Traffic” instead of showing relevant traffic source. I am not sure what I am missing here.

Can you please tell me what should I do in order to get correct traffic source?

Thanks for reading and help!

Thank you, Naresh


#2

Hi @nareshk

Does the submission show the correct page name and URL? And does the contact show the correct IP? If those items are correct, can you send me a link to the contact record you’re seeing this with? It’s possible that the contact doesn’t have any traffic data even if the hutk was correctly associated with the contact.

Otherwise, if those other items are not showing up correctly, do you have an example of the data being sent in the POST request? Usually this means that there’s a problem with the format of the hs_context data, so seeing an example could help track down the issue.


#3

David,

Thanks for the response.

I made sure that page name and URL are passed correctly to hubspot but Can you please tell me where I can see page name and URL in hubspot contact? I can see the IP address in the contact.

Here is a sample contact: https://app.hubspot.com/contacts/2353114/contact-beta/4227401/

Please note that IP address is always the same because the script (which makes API call) is called (as webhook) by eiseverywhere.com when form is submitted on their system. So my script always gets an IP address of eiseverywhere.com server instead of real IP address of user’s computer/ISP. If this is an issue, can I remove passing IP address to hubspot?

Thanks, Naresh


#4

David, any updates on this?


#5

@dadams,

Thanks for the response.

I made sure that page name and URL are passed correctly to hubspot but Can you please tell me where I can see page name and URL in hubspot contact? I can see the IP address in the contact.

Here is a sample contact: https://app.hubspot.com/contacts/2353114/contact-beta/4227401/

Please note that IP address is always the same because the script (which makes API call) is called (as webhook) by eiseverywhere.com when form is submitted on their system. So my script always gets an IP address of eiseverywhere.com server instead of real IP address of user’s computer/ISP. If this is an issue, can I remove passing IP address to hubspot?

Thanks, Naresh


#6

@nareshk You would see the page name and URL in the details for the form submission in the timeline. Specifically it would show 'submitted {form name} on {page name} in the timeline entry. The 'on {page name} won’t appear if the submission doesn’t include the name.

Looking at your example contact, the name, URL, and cookie all look correct, but there is no traffic data associated with the cookie, so the contact shows direct traffic as the source since that’s the default source for anyone who filled out a form.

Was this a test submission? You have several different IP addresses set up in Reports > Reports Settings > Exclude traffic from these IP addresses, and any visits from those IPs would be filtered, so if this was a test submission from one of those IPs the traffic would be filtered out, and you’d see the default source (direct traffic).


#7

@dadams, thanks for the details.

  1. I can see {page name} on all contacts submitted via API. so this data is passed correctly.
    Also, you noted that cookie, URL, page name etc looks fine. But you also mentioned that there is no traffic data associated with the cookie.

    • What does that mean exactly?
    • Does it involve the IP address being passed in hs_context parameter?
  2. I checked it, this is not a test submission and also the IP address is not filtered as well. All submissions done on eiseverywhere.com are then sent over to http://savvyprodemo.com/etouches/index.php script which then fetches the submitted data from eiseverywhere.com (including the cookie, page url, page name) and then it sends/submits the data to hubspot form.
    Unfortunately this (index.php) script do not get IP address of the user (who submitted the form) but instead it gets only the IP address of the eiseverywhere.com (from where this webhook is called) and hence it sends the same IP for all submissions. Let me know if this IP is a problem and if it would get correct traffic source if I remove this IP from api call data.

Thanks for your continued help!

Thanks, Naresh


#8

@dadams, did you check my last message? Here it is again, if it did not reach to you for some reason:

  1. I can see {page name} on all contacts submitted via API. so this data is passed correctly.
    Also, you noted that cookie, URL, page name etc looks fine. But you also mentioned that there is no traffic data associated with the cookie.
  • What does that mean exactly?
  • Does it involve the IP address being passed in hs_context parameter?
  1. I checked it, this is not a test submission and also the IP address is not filtered as well. All submissions done on eiseverywhere.com are then sent over to http://savvyprodemo.com/etouches/index.php script which then fetches the submitted data from eiseverywhere.com (including the cookie, page url, page name) and then it sends/submits the data to hubspot form.
    Unfortunately this (index.php) script do not get IP address of the user (who submitted the form) but instead it gets only the IP address of the eiseverywhere.com (from where this webhook is called) and hence it sends the same IP for all submissions. Let me know if this IP is a problem and if it would get correct traffic source if I remove this IP from api call data.

Thanks for your continued help!


#9

There are some more details in this help doc, but any page views are tracked by our tracking code whenever someone views a page with our code installed on it. The page views get associated with the cookie, and the view show up for the contact record when that cookie also gets associated with the contact through the form submission.

IP filtering gets applied to the page views themselves, based on the IP our tracking system records for the visitor at the time of the page view. That filtering is independent of the IP included in hs_context that gets set for the contact record, so even if the form is sending the IP of the system sending the webhook, the visits would record (and get filtered based on) the IP of the actual visitor.