- 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.
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>
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"
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")) }}
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")) }}
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.
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>
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.