# Problems with Hubspot tracking code

**URL:** <https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326>\
**Category:** APIs & Integrations\
**Tags:** forms, contacts\
**Created:** [May 10, 2019, 2:59pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326 "2019-05-10T14:59:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiltonrrn](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hiltonrrn/32/99782_2.png) [@hiltonrrn](https://community.hubspot.com/u/hiltonrrn)\
**Post date:** [May 10, 2019, 2:59pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/1 "2019-05-10T14:59:27Z")

</div>

Hello,

I’m having difficulty with tracking contacts from one of the portals that I manage. Currently there is a CRM that is integrated via API with this Hubspot portal, using the “Submit data to form” method, to feed the contacts.

This client is using Google Tag Manager to insert the Hubspot snippet into their sites. When I try to simulate a form submission, coming from Google (organic search), the created contacts have their original source as “Direct traffic”. I have already confirmed that on every page up to the form, Hubspot cookies are being generated.

I already got in touch with Hubspot support and they guided me to post the problem here. Here is an example of the request being sent to Hubspot, as well as the link from the contact that was generated from sending this form:

`{"firstname":"Hilton","lastname":"Iesvap","email":"hilton22@mkt4edu.com","mobilephone":"+5531984010559","date_of_birth":"05\/10\/1979","hs_context":"{\"hutk\":\"4b34f73170cccc513440566ab18c9b7f\",\"ipAddress\":\"170.82.104.78\",\"pageUrl\":\"processoseletivo.nreeducacional.com.br\\\/iniciar-inscricao\",\"pageName\":\"Portal de inscri\\u00e7\\u00e3o - Etapa 1\"}"}`

> **[HubSpot](https://app.hubspot.com/contacts/5437378/contact/9795451/)**

Can anybody help me?

Thanks,

---

<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:** [May 13, 2019, 8:03pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/2 "2019-05-13T20:03:59Z")

</div>

Hi, @hiltonrrn.

Thanks for providing all this information. I’m happy to help.

Can you share the support ticket number? I can’t seem to find it and I’d like to close the loop with my colleague!

I do see a `hutk` cookie token value associated with [this record](https://app.hubspot.com/contacts/5437378/contact/9795451/), however the contact’s `hs_analytics_first_url` property value is `https://processoseletivo.nreeducacional.com.br/iniciar-inscricao?linkGerado=4D34W2CN8G`, which does _not_ contain tracking parameters that would merit an _Original Source_ value of “Organic Search,” per [these rules](https://knowledge.hubspot.com/articles/kcs_article/reports/how-does-hubspot-categorize-visits-contacts-and-customers-in-the-sources-report). What should the _First page seen_ be, or rather, what tracking URL did you use to test?

I navigated to the form with the dummy tracking URL`https://processoseletivo.nreeducacional.com.br/iniciar-inscricao?utm_campaign=hubspot_developer_support_test&utm_source=adwords&utm_medium=ppc` and [this test contact](https://app.hubspot.com/contacts/5437378/contact/11028851/) was properly bucketed under “Paid Search,” so the tracking code and form are working correctly for me.

---

<div class="post-metadata">

**Author:** ![hiltonrrn](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hiltonrrn/32/99782_2.png) [@hiltonrrn](https://community.hubspot.com/u/hiltonrrn)\
**Post date:** [May 14, 2019, 2:29pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/3 "2019-05-14T14:29:43Z")

</div>

Hi @IsaacTakushi,

Thank you for once again helping me.

The ticket number is 2429587. To your knowledge, there is more than one CRM feeding the contacts of this portal.

All other CRMs are running normally. But the CRM that is submitting to this particular form, the original source is not right. And the tracking done by this CRM, uses Google Tag Manager. The others copied and pasted the Hubspot snippet onto the pages of their sites.

I hope this information helps.

Any other information you need, I’m at your disposal.

Thank you.

---

<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:** [May 15, 2019, 8:55pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/4 "2019-05-15T20:55:27Z")

</div>

Hi, @hiltonrrn.

Thanks for sharing the ticket number.

There does not appear to be an issue with the tracking code firing. The [example contact](https://app.hubspot.com/contacts/5437378/contact/9795451/) you shared has a `hutk` cookie value.

I can see that the contact landed on a page which does _not_ have tracking parameters. Without tracking parameters, we bucket the contact under “Direct traffic.”

What should the _Original Source_ value be? What tracking codes are these clients using?

Per my last message, I successfully created [this example contact](https://app.hubspot.com/contacts/5437378/contact/11028851/) with a tracking URL that gave it the “Paid Search” _Original Source_.

---

<div class="post-metadata">

**Author:** ![hiltonrrn](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hiltonrrn/32/99782_2.png) [@hiltonrrn](https://community.hubspot.com/u/hiltonrrn)\
**Post date:** [May 20, 2019, 1:24pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/5 "2019-05-20T13:24:43Z")

</div>

Hello @IsaacTakushi ,

Thanks for the reply!

It’s even embarrassing to say so, but the problem lay in the cookie policy settings. LoL !!

It was a lack of attention of ours, of not realizing that this option was disabled.

The tracking system seems to be working correctly now.

Anyway, thanks again for your help!

Cheers,

---

<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:** [May 20, 2019, 1:34pm UTC](https://community.hubspot.com/t/problems-with-hubspot-tracking-code/14326/6 "2019-05-20T13:34:07Z")

</div>

No worries, @hiltonrrn! The cookie policies can be tricky  
 ![16x16_smiley-tongue.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/e/9ee85ed32f43bd1e26f190560e13ba27d75117cd.png)

Thanks for the update!
