Blog, Website & Page Publishing

Anasser6
Member

Javascript not appearing on hubspot webpage

SOLVE

I have followed the steps from this knowledge article: https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot 
- I created a Javascript file 

- I copied the file's public URL and added it to the specific web page's Footer under the Advanced Settings > Footer HTML, and formatted it as follows: 
<!-- start Main.js Do Not Remove -->
<script src='PATH URL PASTED HERE'></script>
<!---End Main.js-->. 

I even tried pasting this under Settings > Content > Pages > Site footer HTML for the domain I wanted but no luck. When I load the test page and view page source (using google chrome) I don't see the javascript anywhere. 

Any ideas on what I'm missing?

0 Upvotes
1 Accepted solution
jonchim
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Javascript not appearing on hubspot webpage

SOLVE

hey @Anasser6, okay looks like you haven't created/using a custom theme. I think best solution for you would be to navigate to file manager https://app.hubspot.com/files/YOUR PORTAL ID
Drop the file in there, once you have that you can click on Copy URL
and then in your page settings just use <script src="URL"></script>

Screenshot 2025-03-03 at 9.48.37 AM.png

 








Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution

View solution in original post

7 Replies 7
jonchim
Guide | Diamond Partner
Guide | Diamond Partner

Javascript not appearing on hubspot webpage

SOLVE

Hi @Anasser6,
You shouldn't need the script tags if the javascript file you created lives in your theme folder
it should look something like this {{ require_js(get_asset_url("../../js/NAME_OF_FILE.js")) }}

If you uploaded it to the file manager that you should be able to use script src="URL"






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
Anasser6
Member

Javascript not appearing on hubspot webpage

SOLVE

Hi @jonchim

Thank you for your response. I'm not familiar with theme folders - when creating the javascript file I saved it in the root folder (see screenshot). 

Also, how would I reference the file path for the script you included? Would it be like this?
{{ require_js(get_asset_url("FOLDER_NAME/js/NAME_OF_FILE.js")) }}

 

Anasser6_0-1740755582516.png

 

Thank you!

 

0 Upvotes
jonchim
Guide | Diamond Partner
Guide | Diamond Partner

Javascript not appearing on hubspot webpage

SOLVE

Hi @Anasser6,

If you're using the default theme/base theme, in your theme folder, there should be a js folder which you can move the file in there. 
If it's in the root folder try this code
{{ require_js(get_asset_url("../../NAME_OF_FILE.js")) }}






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
Anasser6
Member

Javascript not appearing on hubspot webpage

SOLVE

Hi @jonchim

I tried the code you mentioned but no luck. I also don't see an option to move my file into any folder from my file settings - see screenshots. The only folder I see is the @hubspot folder - is this the default one you're referring to? From within that folder the only subfolder that had a js folder was the cmsdefaultsystempages.

 

Anasser6_2-1740782097582.png

 

Anasser6_3-1740782187041.png

 

 

0 Upvotes
jonchim
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Javascript not appearing on hubspot webpage

SOLVE

hey @Anasser6, okay looks like you haven't created/using a custom theme. I think best solution for you would be to navigate to file manager https://app.hubspot.com/files/YOUR PORTAL ID
Drop the file in there, once you have that you can click on Copy URL
and then in your page settings just use <script src="URL"></script>

Screenshot 2025-03-03 at 9.48.37 AM.png

 








Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution
BérangèreL
Community Manager
Community Manager

Javascript not appearing on hubspot webpage

SOLVE

Hi @Anasser6 and welcome, it's such a pleasure to see you here! 🎉

Thank you for asking the HubSpot Community!

Can you please share with us the URL of the page where you added the Javascript?

I'd love to put you in touch with some of our Top Experts: Hi @stefen, @Syeda_Fatima and @jonchim do you have suggestions to help @Anasser6, please?

Have a wonderful weekend and thanks so much! ❤️

Best,
Bérangère


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


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

Javascript not appearing on hubspot webpage

SOLVE

Hi @BérangèreL

Thank you for your message. 
The site URL is: https://test-242118198.hubspotpagebuilder.net/test 

0 Upvotes