Async loading of HS js files

We have our HubSpot embed code added to our site, which by default, has async defer.

This embed code dynamically loads the following HS js files: leadflows.js, conversations-embed.js, web-interactives-embed.js, fb.js, hs-banner.com/ID.js and hs-analytics/ID.js.

All of these are loading dynamically, which is expected. But these are creating a major hit on our Core Web Vitals because they are not deferred or loaded asynchronously.

Is there a recommended solution to load these asynchronously? I have seen numerous posts from the past few years regarding similar issues. I could not find any legit solution in the posts I have read.

Hi @MMason5,

Thank you for reaching out to the Community!

Let’s ask a couple of HubSpot wizards if they have any advice:

Hi @Mike_Eastwood, @Teun, @weiliang_lee, do you have any tips for @MMason5?

Thank you!

Cheers
Mia, Community Team

Sorry @MMason5

I haven’t been able to find a fix, nor a workaround.

Mike

This is unacceptable. I understand there are drawbacks to loading files asynchronously and some aspects might not be tracked as well as sync loading (and if documented, this could be acceptable in some use cases), but Core Web Vitals is paramount to most types of sites that are SEO-driven and this renders HubSpot unusable in those contexts.

We are considering loading HubSpot on demand when we need certain functionality from the script like a CSAT survey, but the first tests drew out unpredictable results for targeting, especially within an SPA page loading environment.

Is there really no solution for this?