How to override or how to customize the Hubspot Tracking Script?

Daniela2
Member

Hello, is there a way to override or to customize the HubSpot Tracking Script, so, the SameSite attribute will have None value (SameSite=none)? I have created an integration between a software product I am using called Ion Interactive and HubSpot to integrate custom forms made in Ion with HubSpot forms. In addition, the custom-made Ion forms can be embedded on an external site using an iframe.

 

The issue has become that we keep getting an error reading this on the form submissions if we embed the forms on an external page

the cookie needed to link form submissions to existing contacts isn’t being sent. You’ll need to ask your developer to update the integration for this form.

We found that the HubSpot Tracking Script is creating hubspotutk cookie. And it is this cookie, created by HubSpot, that has SameSite=Lax attribute. This means that it will be sent to HubSpot ONLY directly from Ion, not like we want to do now, as an embedded form on an external page.

 

In order to allow the cookie needed to link form submissions to existing contacts we will need to change the SameSite attribute to None value (SameSite=none). Any help or guidance with this will be greatly appreciated.

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Moderator

Hey @Daniela2,

 

As mentioned on this dev forum thread,

 

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.

Hence, I'd believe that embed HubSpot form on an external site (with HubSpot tracking code) should be able to track contact cookie just fine.

 

In this case, could you share further on how you're sahring the HubSpot form on your external page. Are you sharing it via the embed code?

0 Upvotes
Daniela2
Member

Thank you @WendyGoh. So I am using an embed code to embed my form on an external page (https://visual.ly/creative-services/quote) however, this is an embed code for an Ion form that was custom-built (not the HubSpot embed code for the HubSpot form).

In order for the Ion form to integrate the respondent data with the HubSpot form, I created an integration using the HubSpot REST API. I created field mappings that will map the Ion data collection fields (from the custom Ion form) to the corresponding HubSpot API field names (in the HubSpot form). I would like to note that the cookie error message doesn't display if I use the Ion form directly from Ion, but if it's embedded on the external page it gives me the cookie error message and the tracking cookie does not get incorporated to the existing contacts and therefore does not track page visits or other relevant tracking information.

0 Upvotes
WendyGoh
HubSpot Moderator

Hey @Daniela2,

 

Thank you for the additional information.

 

Just to clarify, are you passing in the form submission via the HubSpot Form API? Or are you using other endpoint to pass the Ion form submission into HubSpot? 

 

Additionally, could you share with me the page url in question?

0 Upvotes