# hutk not working

**URL:** <https://community.hubspot.com/t/hutk-not-working/61535>\
**Category:** APIs & Integrations\
**Created:** [July 22, 2022, 2:14pm UTC](https://community.hubspot.com/t/hutk-not-working/61535 "2022-07-22T14:14:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AShi2](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@AShi2](https://community.hubspot.com/u/AShi2)\
**Post date:** [July 22, 2022, 2:14pm UTC](https://community.hubspot.com/t/hutk-not-working/61535/1 "2022-07-22T14:14:36Z")

</div>

Hi,

I included the hutk property in my form submission but I am still not able to see the pageview history:

 ![AShi2_1-1658500055616.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/5/e5fe00796746349c7603c65c6dbbee82ef25cced.png)

 ![AShi2_0-1658499921562.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/4f8093a0c8bb9f9efd6518b415a02afc0b9c9335.png)

I’m using this regular expression to get the hutk from cookie: document.cookie.replace(/(?:(?:^|.\*;\s\*)hubspotutk\s\*=\s\*([^;]\*).\*$)|^.\*$/, '$1’)

But sometimes it returns me an empty string which means there is no hutk value in the cookie, and I think that’s the reason that caused this issue.

If I’m a new user, how does the hutk value been added to my cookie?

Could you help me to fix this?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [July 25, 2022, 3:46pm UTC](https://community.hubspot.com/t/hutk-not-working/61535/2 "2022-07-25T15:46:21Z")

</div>

Hi, @AShi2 👋 Welcome to the community! Hey @Teun @assi @Ismail, do you have any insights for @AShi2?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![assi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/assi/32/25699_2.png) [@assi](https://community.hubspot.com/u/assi)\
**Post date:** [July 27, 2022, 2:36am UTC](https://community.hubspot.com/t/hutk-not-working/61535/3 "2022-07-27T02:36:17Z")

</div>

Hi @AShi2 .

If hubspotutk value is empty, visitor may be reject cookie policy, or using ad-block featrues of browser, browser extentions, and so on.

First of all, hubspotutk value is sent automatically and implicitly when form submitted. And this will be used for tracking.

Documents are here:

> **[Cookies set in your visitor's browser by HubSpot](https://knowledge.hubspot.com/privacy-and-consent/what-cookies-does-hubspot-set-in-a-visitor-s-browser)**
>
> Learn about the cookies the HubSpot tracking code sets in a visitor's browser.

> **[Cookies set on HubSpot's websites](https://knowledge.hubspot.com/privacy-and-consent/hubspot-cookie-security-and-privacy)**
>
> HubSpot is committed to privacy and current industry initiatives to protect individual rights on the internet. Learn what, why, and how we are using cookies within the HubSpot product.

So generallly we don’t have to care about hubspotutk value. What do you want to do with using hubspotutk value? If you tell me more detail, I could tell you other ways.

---

<div class="post-metadata">

**Author:** ![AShi2](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@AShi2](https://community.hubspot.com/u/AShi2)\
**Post date:** [July 27, 2022, 2:31pm UTC](https://community.hubspot.com/t/hutk-not-working/61535/4 "2022-07-27T14:31:18Z")

</div>

Hi [@Bass](https://community.hubspot.com/t5/user/viewprofilepage/user-id/38253) ,

Thanks for the clarification, the issue I have is that I can’t track users’ pageview data after they submit the form. I’ve included the hutk value in the form submission, but it’s not working for new users.

Please let me know if there is anything I could do to fix it, thank you!

---

<div class="post-metadata">

**Author:** ![assi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/assi/32/25699_2.png) [@assi](https://community.hubspot.com/u/assi)\
**Post date:** [August 1, 2022, 2:41am UTC](https://community.hubspot.com/t/hutk-not-working/61535/5 "2022-08-01T02:41:28Z")

</div>

Hi @AShi2 ,

Let me check some assumption:

- You’re using [this submission API](https://legacydocs.hubspot.com/docs/methods/forms/submit_form), right?
- Can’t you get hubspotutk value every time?
  - If not you can’t get the value every time (sometimes can get the value), it seems that your codes is not wrong, the problems might be in visitor’s browser.
    - such as: reject cookie policy, or using ad-block featrues of browser

---

<div class="post-metadata">

**Author:** ![AShi2](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@AShi2](https://community.hubspot.com/u/AShi2)\
**Post date:** [August 2, 2022, 7:51pm UTC](https://community.hubspot.com/t/hutk-not-working/61535/6 "2022-08-02T19:51:05Z")

</div>

Hi Assi,

Thanks for the message!

Yes we are using the submission API and here is a screenshot of our code:

 ![3521659469594_.pic.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/9/9257e3bdc6ada4d453fc75111dac5a15cb91f573.jpeg)

I tested it on other computers that do not have ad blocker and I accepted the cookie policy and it’s not working.
