CMS Development

chrisati
Member

Can I host my HubSpot Embeded Code .js locally?

SOLVE

I am starting to host most of my scripts on my local web server. Are there any issues with storing the .js script myself?

Any best-practices or how-tos or is it as easy as creating the below .js file at /scripts/555555.js and referencing it in the code?

 

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="js/5555555.js"></script>
<!-- End of HubSpot Embed Code -->

0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Can I host my HubSpot Embeded Code .js locally?

SOLVE

@chrisati should have no problems with hosting it locally. Just download it and reference the local one instead of the hubspot hosted one. One thing I'd recommend is use something to download the file every once in a while in case it gets changed to keep them in sync. You could do that with PHP or Node or what have you. You could also just setup a notification service to send you a notifcation when the online file is updated and manually change it at that time.

Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

TiphaineCuisset
Community Manager
Community Manager

Can I host my HubSpot Embeded Code .js locally?

SOLVE

Hi @chrisati 

 

Thank you for reaching out!

 

I want to tag an expert on this - @stefen  do you have any suggestions for @chrisati on this? 

 

Thank you!

Best

Tiphaine


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Can I host my HubSpot Embeded Code .js locally?

SOLVE

@chrisati should have no problems with hosting it locally. Just download it and reference the local one instead of the hubspot hosted one. One thing I'd recommend is use something to download the file every once in a while in case it gets changed to keep them in sync. You could do that with PHP or Node or what have you. You could also just setup a notification service to send you a notifcation when the online file is updated and manually change it at that time.

Stefen Phelps, Community Champion, Kelp Web Developer