Website Optimization

Hi there,

I am currently working on the optimization of our website, hosted on HubSpot and I have had several problems while working on it. The problems which occurred and which mostly had an impact on the website optimization, i.e. website load speed, and everything regarding optimization and performance, were mainly third-party scripts. The two third party scripts which took the longest time to load and had the largest impact are: 1. HubSpot scripts (precisely this HubSpot script: https://js.hs-analytics.net/analytics/1671110100000/7007026.js)
2. Hotjar scripts (precisely this: https://script.hotjar.com/modules.c28cd36cbf17f5f066e3.js)

What my question is, i.e. what I need to know in order to fix the problem is:
- How and where are those scripts implemented? Is that something I could potentially have an access to, or that’s only visible to HubSpot?
Regarding all above, is there anything you could suggest as a potential fix?

Also, important to mention is that we have two environments on HubSpot which we use, one is Sandbox (staging) account and the other is Production account. Performance scores have differences between the two (production and sandbox). The performance score is better on Sandbox account (I believe because this is our internal account which we mainly use to test things out, and there aren’t used all of the third-party scripts as they’re on Production account).

Part of the audit can be found on the image attached.
Thank you in advance.

Hi, @SMetiljevic I moved this to the SEO section of our community. You can also consider creating a job request post if you are looking for a freelancer or partner to help with your audit. Otherwise, I’d recommend searching up some recent threads on this topic, as it is discussed often. Here are a few from our community champion @Sjardo:

Best,

Jaycee

Thanks for the mention @Jaycee_Lewis

Hi @SMetiljevic ! I’m happy to help with your challenges. The CMS hub can be really fast, it’s just a little tricky from time to time.

Third party scripts should not effect the sitespeed that much, but it can indeed block the main thread. Even my own site (www.bureauvet.nl) has issues with the mean tread, but still rocks a 100 on desktop and a 95 on mobile if you just look as PSI. (I advice looking at the RUM data, as thats from real users instead of the syntatic tests from Google).

For your specific issue, try to load scripts as late as posible. The earlier they load ,the bigger the change that they block something else that should be done first.

  • Hotjar can be loaded with GTM and should help out a bit.
  • The stuff from hubspot itself… Well, you are on a HubSpot CMS and we are not able to do much with the trackign scripts or how it loads. Still, it’s not the issue if your talking about performance.
  • Jquery. Try to rebuild some jquery to vanalla JS so you can remove the jQuery scripts.
    • Or try to defer JQuery loading, it will no longer block the main thread
    • Also, load Jquery from your own CDN (hubspot, perferable on your own domain) to make sure you dont have to connect to a new connection
  • That said, preconnect or prefetch the DNS of external scripts to load them quicker. Like Cloudflare if you cant move the jQuery scripts, GTM and Hotjar.
  • At the last quick pointer: Remove or turn of ANYTHING that you dont need. Not looking into Hotjar? Remove the script. Not using social media sharing options in HubSpot? Turn it off.

Remember, Anything you add to a site, makes your sites slower.

It’s hard to give good advice if we don’t know the website, but i’m happy to help out if you want to dive into the situation.

Best,