what is https://js.hsleadflows.net/leadflows.js

What is https://js.hsleadflows.net/leadflows.js it add 500k to the site. Can it be used as defer script.

How do you remove it - reserching I can think leadflows is to with with pop ups

Hey, @simonp, Check out this post from our Community Champion @himanshurauthan for some thoughts on deferring these scripts — Execute defer tag.

Best,

Jaycee

Thanks Jaycee - fully onboard on the principle of defer and async js files, as Hubspot is a bit of beast, the leadflow script is being automatic created, just wondering how you can go about applying a defer status to the file

Hello @simonp
Yes you are right, the script is loaded on Hubspot pages if

1. Use any chat options once, somewhere, it will load conversations.js on any HubSpot page.
2. If you use a single pop-up form/lead flow once, somewhere, it will load leadflows.js on any HubSpot page.

You can modify the script tag to defer it, you can exactly use the hack from this blog post : https://www.corewebvitals.io/pagespeed/defer-hubspot-forms.

Thanks

Brilliant many thanks