Method 1: JavaScript tab
Go to Settings > Themes > edit current theme
Click on the JavaScript tab
Paste your JavaScript in the area below
Save and Publish your theme
NOTE: JavaScript added should NOT include the opening and closing <script></script>
tags.
For example:
Method 2: Header / Footer tab
Go to Settings > Themes > edit current theme
Click on the Parts tab
Click "customize" or the pencil icon to edit your header or footer.
HEADER: Paste your JavaScript between the header tags
<head> </head>
FOOTER: Paste your JavaScript before the closing
</body>
tag
Save and close that tab
Save and Publish your theme
Add Javascript between <head> </head>
tags.
Add Javascript before closing </body>
tag.