We are having some issues with page load time. Can we turn off some settings/tracking to help speed up our page load? We need to optimize for page loading speed when our HubSpot services are being used?
We have noticed that the demo button we use on our site using this JS code ….
…. is causing a large change in our site performance. We would like to know if you have a recommended method whereby, we can load this script after the page loads (deferred loading) so that it will not impact the user experience? We have considered using a load event and then loading your script, but we don't want to break the script based on how it works on your end and would like your guidance.
Most of what I got came from the Google Dev tools "lighthouse" (in the inspector) and tools.pingdom.com. However, those tools will not help you all. What we did with those tools is compare our site load speed with and without hubspot on our site and That was the big difference. Page size, load time, additional references, and time to interact all increased significantly when hubspot code was on our site.
The question we really need answered is "can we load your stuff after the page loads or will that break your stuff".”
Just chipping in here with something I've done that could be applied here. I achieved a ~90+ on desktop and ~50 on mobile in Google PageSpeed. Basically the idea is to delay scripts until a user action like scrolling.
For example I used the below for Intercom via GTM on our site: it forces intercom to wait 1 second after the page is scrolled to load, and SEO bots/crawlers don't scroll the page so it won't load for them.
var scriptOnScroll = function() {
setTimeout(function() {
// script goes here
}, 1000);
};
window.addEventListener("scroll", scriptOnScroll, {once: true});
In the case above you could remove the src from the script element and then add it in after a set time after scroll or load e.g.