Navigate to the design manager
In your HubSpot Marketing Hub Basic, Professional, or Enterprise account, navigate to Marketing > Files and Templates > Design Tools.
Create a new coded file
Create a new file by clicking Actions > New file in the left sidebar menu (you may need to click the folder iconto expand the menu) or click Create a new file in the upper right-hand corner (this button appears if you don't have any tabs open in your design manager).
Copy public 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, open the template in your design manager. In the right sidebar menu under the Edit tab, add the following to the Additional <head> markup field:
Alternatively, you can add the same code to a custom HTML module in your template's global footer. In your global footer, click the custom HTML footer module. In the right sidebar menu under the Edit tab, click Edit HubL source. Edit the code and then publish your changes.
To include your file on all HubSpot-hosted pages, click your photo or avatar in the upper right-hand corner of your HubSpot account and click Settings. In the left sidebar menu, click Marketing > Web pages. Under the Page Templates tab, scroll down to the Site footer HTML section and paste the generated HubL token as the value for the script tag’s source, as seen below:
<!-- start Main.js Do Not Remove -->
<script src='insert your generated token here'></script>
Using jQuery plugins and external scripts
Every layout or coded HubSpot template automatically includes jQuery 1.71 or 1.11x in the head tag of the page. Learn about selecting which version of jQuery to load here.