Last updated on
You have an HTML page.
The good news is, it’s as simple as adding another tag to your HTML.
It’s important to put the tag in the right place.
Or you can load a script straight from a URL. Like when you are loading something from a CDN.
Note, the <script> tag isn’t self closing – it needs the </script> closing tag.
Where to put the tag
The answer is, as long as you get it somewhere on the page (and the path is right!), it will work.
The choice of where you put it can affect the load times of your pages and slowing down your site.
Choice 1: In the <head> tag
Choice 2: At the very bottom of the <body> tag
If you don’t want to hold up the rest of your page loading, then put the <script> tag at the very bottom of your page. Right before closing </body> tag.
We also explored where to place the tag and the reasons why you will probably want to choose option 2 and place the tag at the bottom of your page.