How to combine external JavaScript files on COS



I ran a speed test on Pingdom for a COS website and it says there are 7 JavaScript files (not 3rd party) should be combined. How can I achieve this? Any advice or guidance would be greatly appreciated!

Thank you!

4 Replies 4
HubSpot Employee

Hi @cinanoglu,

Just to make sure that we're on the same page, are these your own custom JS files that you're hosting on the COS? If that's the case, I'd recommend just combining them to a single file in the COS.

Not applicable

Hi @Derek_Gervais, I'm having a similar issue. Please see the Pingdom report for Render Blocking JS:!/bSaiyY/

We've combined the code as much as we can, but we're running into issues with a few links still.

For example, a webpage may have five external or separate JS files like YouTube popup, sticky menu, etc. We combine all them in one file, but now our page is loading a CTA, so it called a new JS file (through HubSpot backend). So the issue is happening with our dynamic JS files, which we are unable to combine without breaking the page.

My question is, how can we further combine all the rest of the dynamic JS files into one (or fewer than currently)?

Please advise.

HubSpot Product Team

Hi ccjesse,

Looking at your pingdom report, there's a number of custom files you could combine. Those are

As for the others, we are looking at loading the CTA js only once.

There is a Web Pages setting you can turn on that will load jQuery in the footer which will make it non-render blocking. You will need to verify that your pages don't use jQuery before the footer though.

The rest are all async scripts that should not block rendering.


Hi boulter,I want to know How can I make JS load once。