# Forms API doesn't capture Orginal Source correctly

**URL:** <https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [October 15, 2018, 6:16pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361 "2018-10-15T18:16:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 15, 2018, 6:16pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/1 "2018-10-15T18:16:54Z")

</div>

We recently implemented Forms API V3 on our backend to capture our form submissions.

Unfortunately, for almost all contacts I see they were “created from Direct Traffic from No URL”.

How can I get attribution right?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 15, 2018, 7:25pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/2 "2018-10-15T19:25:57Z")

</div>

Hi [@TommyKlouwers](https://community.hubspot.com/u/tommyklouwers),

Can you confirm you are passing the `hutk` cookie token and `pageUri` values in the `context` object with a few examples? As noted in [the documentation](https://developers.hubspot.com/docs/methods/forms/submit_form_ajax):

_Please Note: While the `hutk` value is not required for the submission to be accepted, this token is used to associate analytics data with a contact record, so without this you will not see any page views or analytics source data for the contact record._

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 15, 2018, 7:40pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/3 "2018-10-15T19:40:15Z")

</div>

Hey [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi),

Yes, we’re passing those values.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 15, 2018, 7:44pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/4 "2018-10-15T19:44:42Z")

</div>

Hey [@TommyKlouwers](https://community.hubspot.com/u/tommyklouwers),

Please include links to examples.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 15, 2018, 8:22pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/5 "2018-10-15T20:22:47Z")

</div>

[@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi)

Correction: we do not pass `pageUri` right now.

Is this important? We currently send everybody to [Salesforce Slack Integration to Maximize Sales | Salesforce](https://app.troops.ai/signup). That’s the only form we’re integrating using the HubSpot Forms API.

I just noticed that we do capture the right information in about 20% of all cases.  
In 80% of the cases, the web analytics data is empty. E.g. `First Page Seen` is empty too. Can that be the issue?

I’m not exactly sure what you mean by links to examples. I assume you want to see contacts where the issue is happening, so here are some sample contacts:  
[https://app.hubspot.com/contacts/4929075/contact/423151/?interaction=note](https://app.hubspot.com/contacts/4929075/contact/423151/?interaction=note)  
[HubSpot](https://app.hubspot.com/contacts/4929075/contact/410751/?interaction=note)  
[HubSpot](https://app.hubspot.com/contacts/4929075/contact/405551/?interaction=note)

Here are some contacts where it does capture everything correctly:  
[HubSpot](https://app.hubspot.com/contacts/4929075/contact/56501/?interaction=note)  
[HubSpot](https://app.hubspot.com/contacts/4929075/contact/10451/?interaction=note)  
[HubSpot](https://app.hubspot.com/contacts/4929075/contact/384801/?interaction=note)

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [October 16, 2018, 6:54pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/6 "2018-10-16T18:54:31Z")

</div>

[@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi)

Is this everything you need to investigate?

If there’s anything I can do to help, please let me know.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 18, 2018, 2:51pm UTC](https://community.hubspot.com/t/forms-api-doesnt-capture-orginal-source-correctly/11361/7 "2018-10-18T14:51:20Z")

</div>

Hi [@TommyKlouwers](https://community.hubspot.com/u/tommyklouwers),

Apologies for the delayed response. You sent everything I needed.

The three contacts showing “No URL” have _only_ submitted the [New form (September 24, 2018 5:12:09 PM)](https://app.hubspot.com/forms/4929075/editor/c46a92fe-9d4a-4218-a916-0bac8b75a77a/edit) while the three “working” contacts actually converted on different forms _before_ submitting the “New form.” The `pageUri` values passed with these submissions set the contacts’ _First page seen_ values. Based on this evidence, the “New form” doesn’t seem to be working for any contacts because it doesn’t pass the `pageUri`.

For example, [this “working” contact](https://app.hubspot.com/contacts/4929075/contact/10451/?interaction=note) submitted [Collected form: .email-form](https://app.hubspot.com/collected-forms/4929075/guid/844c3b48-6339-4935-8c8f-d7cf6d055c13) _before_ submitting the “New form.” The following property was included in the submission:

```auto
{
"name" : "pageUrl",
"value" : "https://info.troops.ai/?gclid=EAIaIQobChMI2N_w2YiD3gIVz7rACh1TOgzzEAAYAiAAEgKIQ_D_BwE&utm_expid=.O_vWpEHoRVGhh3smRe52zg.1&utm_referrer=https%3A%2F%2Fwww.google.com%2F"
}

```

You’ll notice this is the same URL which fills [the contact’s _First page seen_ property](https://app.hubspot.com/contacts/4929075/contact/10451/properties?search=first+page+seen).

[This “No URL” contact](https://app.hubspot.com/contacts/4929075/contact/423151/?interaction=note), on the other hand, only had the following meta data array:

```auto
"meta-data" : [
{
"name" : "smartFields",
"value" : ""
},
{
"name" : "requestIpAddress",
"value" : "52.45.161.100"
},
{
"name" : "cloudflareThreatScore",
"value" : "0"
},
{
"name" : "endpointType",
"value" : "AJAX_PUBLIC_API"
},
{
"name" : "hutk",
"value" : "0b4f99d42e69aae2b0d7148444c5d7da"
},
{
"name" : "serverRegion",
"value" : "us-east-1"
},
{
"name" : "ipAddress",
"value" : "4.7.93.101"
}
]

```

Thus, the first thing I’d recommend is to try including the `pageUri` parameter in the `context` object. There’s a good example in [this article](https://developers.hubspot.com/docs/methods/forms/submit_form_ajax).
