Hubspot Tracking Code

SOLVE
Highlighted
New Contributor

After installing the hubspot tracking code, i'm receiving the following warning "A cookie associated with a cross-site resource at http://hs-scripts.com/ was set without the `SameSite` attribute"

 

How do i fix this?

3 Accepted solutions

Accepted Solutions
Highlighted
HubSpot Moderator

Hey @sambarich@finnhvman@Haymez@zimmreece and everyone, 

 

I have further checked on this with our product team and I'm able to confirm that the warning will not impact all HubSpot functionality. Any automatic browser handling for cookies without the flag set will force them into a LAX-ish state, which is slightly more permitting than LAX itself and acceptable for the functions HubSpot uses its cookies for.

 

Let me know if there's any more concerns on this. Happy to help address them.

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @bctwalling,

 

It’s important to note that HubSpot doesn’t use third party cookies to power the analytics user token we attach to contacts and that this change does not impact any functionality of HubSpot analytics tracking and the HubSpot analytics tracking code and cookies will continue to function correctly. 

 

It is the case that external trackers that use third party cookies may have issues with the flag (e.g. if a website has the Facebook pixel on it), but we don’t have control over the cookies those scripts drop. 

Highlighted
HubSpot Moderator

Hey @edthenet , @nateangell , @tinyfly , @geekbleek , @seanvarnham, @eslpics@kriswen and everyone, 

 

Just an update here!

 

I have checked in with our team and we'd first like to clarify that the cookies set by HubSpot analytics scripts do now have the SameSite flag set  (and have since February). We would not expect users to be seeing that chrome warning specifically about the js.hs-analytics at this point.


The likely root cause here is that users are seeing warnings referring to either hubspot.com or app.hubspot.com related to HubSpot app cookies (such as login/auth cookies which a user would see on their own HubSpot website if they're logged into HubSpot in that same browser) or possibly cookies related to HubSpot API requests from assets they've embedded on their website.


Having said that, HubSpot analytics passes the values we need as query parameters on requests, so because our tracking doesn't expect the cookie to be present in the header this does not affect our tracking functionality.

 

Additionally, I'd also like to suggest for you to try loading your website incognito to confirm if you still see those HubSpot warnings or not. If you do not see them in incognito, this can helps confirm that they're related to being logged into HubSpot, and not related to the website itself.


Do let me know if there's any further concerns. I'd be happy to address them 🙂

 

24 Replies 24
Highlighted
HubSpot Moderator

Hi @juice,

 

I hope all is well with you 😄

 

It looks like this may be due to chrome recent updates with regard to cookie where if no SameSite atrribute is specified the default would be SameSite=Lax.

 

Our team is aware of this issue and is currently looking into this. Once I have more insights on this, I'll keep you updated with more information as to whether this update may impacts HubSpot cookie and/or if there's anything you need to be aware of. At the same time, do you mind sharing with me the pages that you're seeing this issue?

Highlighted
HubSpot Moderator

Hi @juice,

 

Just an update here, the warning message is showing because of some updates that Chrome is making. That said, we do not expect the change to have an impact on any HubSpot product functionality as the default way which Chrome is treating the situation is in compliance with what the HubSpot tracking code needs. I hope this helps to clarify!

 

Reply
0 Upvotes
Highlighted
New Member

Hey Folks!

 

This is actually a VERY important issue - it's highly advisable HubSpot take action, even if by providing additional documentation.

 

TL;DR - So what does this mean to me as a HubSpot customer?

 

My websites using HubSpot tracking may fail to collect site visitor information due to a new third-party cookie standard.

 

Who's affected?

 

Any HubSpot clients using HubSpot Tracking Beacons to collect website visitor data who have site visitors using Chrome Browser version 80+ after February 2020.

 

The issue is "SameSite" - a new web standard impacting all third-party cookies, including HubSpot's

 

The majority browser, Chrome, will start issuing security errors for all third-party cookies (including those set by HubSpot on prospects browsers) unless they properly implement the "SameSite" cookie parameter once Chrome v80 comes out (February 2020).

 

Google themselves have committed to updating their third-party tracking cookies (like Google Analytics and Google Tag Manager) to meet the new SameSite specification.

 

Basically, HubSpot developers will need to apply the "SameSite=None; Secure" setting to all cookies set by HubSpot (instructions on GoogleChromeLabs GitHub account here) AND ensure cookies are only delivered over SSL-encrypted traffic. Failure to adhere to the standard could risk HubSpot customers having their HubSpot tracking cookies dismissed as insecure by Chrome browser.

 

Background on the "SameSite" issue for other HubSpot users

 

This Chrome browser warning occurs for in versions of Chrome 76+ for sites using third-party tracking cookies (such as using HubSpot, Google Analytics, or Google Tag Manager) that aren't using the new "SameSite" cookie security measure promoted by Google and Mozilla since 2016.

 

The Internet Engineering Task Force (IETF - governing body of internet standards) added a new standard for browser cookies called "SameSite" (see the spec here: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00). It adds an additional parameter to cookie-setting requests that broadly determines which sites can access the cookie. It was implemented to improve web security of third-party cookies and help prevent Cross-Site Request Forgery (CSRF).

 

Currently Google Chrome browser issues a warning regarding cookies not meeting this new standard. However, in February 2020, Chrome will treat these as errors, escalating the importance of the standard.

 

Learn more about SameSite cookies here:

  1. https://web.dev/samesite-cookies-explained/
  2. https://nakedsecurity.sophos.com/2019/05/10/chrome-browser-pushes-samesite-cookie-security-overhaul/
Highlighted
New Contributor

Hi @WendyGoh,

 

This will have an impact on all HubSpot functionality starting from February, when Chrome will block third party cookies not set correctly like the cookies HubSpot uses currently.

 

@sambarich explained this very thoroughly: https://community.hubspot.com/t5/APIs-Integrations/Hubspot-Tracking-Code/m-p/309868/highlight/true#M...

Highlighted
New Contributor
Is there any update HubSpot can provide on this issue? We're getting very close to February.
Highlighted
New Contributor

Echoing the questions here, an official word on if HubSpot tracking will be ready for Feb release would be great.

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @sambarich@finnhvman@Haymez@zimmreece and everyone, 

 

I have further checked on this with our product team and I'm able to confirm that the warning will not impact all HubSpot functionality. Any automatic browser handling for cookies without the flag set will force them into a LAX-ish state, which is slightly more permitting than LAX itself and acceptable for the functions HubSpot uses its cookies for.

 

Let me know if there's any more concerns on this. Happy to help address them.

Reply
0 Upvotes
Highlighted
New Contributor

So while the LAX-ish state will work fine for HubSpot, it won't work for customers or integrators who use that cookie along with your REST API to identify viewers. If you don't allow the cookie to be read by them, then your REST API which can get a contact by user token (https://developers.hubspot.com/docs/methods/contacts/get_contact_by_utk) will no longer work.

Highlighted
HubSpot Moderator

Hey @bctwalling,

 

It’s important to note that HubSpot doesn’t use third party cookies to power the analytics user token we attach to contacts and that this change does not impact any functionality of HubSpot analytics tracking and the HubSpot analytics tracking code and cookies will continue to function correctly. 

 

It is the case that external trackers that use third party cookies may have issues with the flag (e.g. if a website has the Facebook pixel on it), but we don’t have control over the cookies those scripts drop. 

Highlighted
Occasional Contributor

phew, we are counting on this cookie for chat targeting!!!

Highlighted
New Contributor

But we still get those annoing warning in the developer toolbar i want to get rid off.

Can you not simply fix this issue in a matter that it does apply to all of our needs?

Highlighted
Regular Contributor

Chrome warns: "A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

 

Can you please explain exactly what parts of HubSpot will continue to work and what will stop working once Chrome makes this change?

Highlighted
New Contributor

I'm not sure this is correct. Apparently Chrome will start blocking cross-site cookies at some point.

 

"Cookies for cross-site usage must specify SameSite=None; Secure to enable inclusion in third party context."

 

I'm including the Hubspot tracking code in my company website that is not powered by Hubspot. That tracking code sets a cookie that doesn't include a SameSite attribute. Some browsers will apply a SameSite=Lax in that case. If that cookie as also a cross-site cookie, which this is, it is only a matter of time before browsers block that cookie. My reading is that only if you set SameSite=None and the Secure flag will the browser allow it to be set.

 

https://web.dev/samesite-cookies-explained/ - Some browsers have a bug where setting SameSite=None is treated as setting it to Strict. So some feature detection would be required. Also setting the Secure flag would require all users of your tracking code to be using https, not a bad requirement, but may break some customers tracking.

Highlighted
Occasional Contributor

Chrome is now blocking these cookie requests starting July 14th.  I'm getting them blocked in my Chrome console:  

Screen Shot 2020-07-22 at 7.09.36 AM.png

 

This is pretty urgent, and you've known this change was coming for quite some time: https://www.chromestatus.com/feature/5088147346030592

Highlighted
New Contributor

Same here, I'm getting some significant warnings and the back-end of a client's WordPress website is crashing every 2 minutes when editing the home page - it would seem because these errors. I have the WP plugin installed too.

Reply
0 Upvotes
Highlighted
New Contributor

I too, am having problems with this - particularly when used with your API. At preent it only affects dev but when Chrome enforce the rule it will break our main site's functionality with Hubspot. Is this being worked on - you simply have to add SameSite=None and Secure to your cookie generation...

Reply
0 Upvotes
Highlighted
Occasional Contributor

I see the same error for all HS cookies on our site originating from the WP plug-in.   It appears that this may also be affecting the SEO of the site as I found the issue when running Google's web.dev/measure tool.

Reply
0 Upvotes
Highlighted
New Contributor

did any one have a solution?

Reply
0 Upvotes
Highlighted
New Contributor

did you have a solution to this?


@Bweber wrote:

I see the same error for all HS cookies on our site originating from the WP plug-in.   It appears that this may also be affecting the SEO of the site as I found the issue when running Google's web.dev/measure tool.


 

Reply
0 Upvotes
Highlighted
Occasional Contributor

I haven't seen a fix from Hubspot for their cookies.   But now Chrome is blocking the HS cookies:

 

A cookie associated with a cross-site resource at http://hubspot.com/ was set without the `SameSite` attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @edthenet , @nateangell , @tinyfly , @geekbleek , @seanvarnham, @eslpics@kriswen and everyone, 

 

Sincere apologise on the delayed in response.

 

Just an update, there's an ongoing discussion with our team on this case and I'll update this thread once we finalize the information. In the meantime, please share any other concerns here. I'd be happy to address them. 

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @edthenet , @nateangell , @tinyfly , @geekbleek , @seanvarnham, @eslpics@kriswen and everyone, 

 

Just an update here!

 

I have checked in with our team and we'd first like to clarify that the cookies set by HubSpot analytics scripts do now have the SameSite flag set  (and have since February). We would not expect users to be seeing that chrome warning specifically about the js.hs-analytics at this point.


The likely root cause here is that users are seeing warnings referring to either hubspot.com or app.hubspot.com related to HubSpot app cookies (such as login/auth cookies which a user would see on their own HubSpot website if they're logged into HubSpot in that same browser) or possibly cookies related to HubSpot API requests from assets they've embedded on their website.


Having said that, HubSpot analytics passes the values we need as query parameters on requests, so because our tracking doesn't expect the cookie to be present in the header this does not affect our tracking functionality.

 

Additionally, I'd also like to suggest for you to try loading your website incognito to confirm if you still see those HubSpot warnings or not. If you do not see them in incognito, this can helps confirm that they're related to being logged into HubSpot, and not related to the website itself.


Do let me know if there's any further concerns. I'd be happy to address them 🙂

 

Highlighted
New Contributor

Hi,

   I'm still seeing error with the following "(https://static.hsappstatic.net/conversations-visitor-ui/static-1.9623/bundles/visitor.js:1......"

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey everyone, 

 

For future reference, you can also visit this article: Cookies set in a visitor's browser by HubSpot (Specifically the 'Please note' box) .