Navigate to Design Manager
Create a new coded file
Select the Code Files folder and click New coded file.
Choose Code Editor and Page.
Name and save file with .js extension
Get public URL
Click Copy to copy the URL.
After your have the HubL tag to generate the URL of your script, you can add it to the src attribute of your script tag.
While scripts can be added to your entire site or a single page, it is recommended that scripts are added to the <head> or a HTML module in the the global footer of your template. This ensures that you only load required scripts on pages using a certain template. To access the head tag of a template layout, click Edit > Edit Head.
Add the following to the Additional HTML Head Markup for this Layout box:
Alternatively, you can add the same code to a custom HTML module in your template's global footer.
Using jQuery plugins and external scripts on the COS
Below is some additional information about using jQuery plugins and external scripts on the COS.
jQuery is included in every COS page
Every layout or coded HubSpot template automatically includes jQuery 1.71 or 1.11x in the head tag of the page. You can learn about selecting which version of jQuery to load, here.