Where in homepage html to place popup code?

Hi, I just joined a new ad network. They sent me some tags to implement a popup ad.

The code starts from <script> and ends with </script>

How should I edit my html file of my homepage to implement the popup correctly?


You can basically paste that code anywhere in the page, so put it where you’d like it to appear. If you want more specific advice, provide a link to the page and say where you’d like the ads to go. Do the ads actually appear, or is this code just a button that makes them pop up when clicked?

usually popup code is added between <head> and </head> in your html page but some adnetwork will allow you to you to add it anywhere you want.
contact your adnetwork and ask them where you should place the code

The best place to put all scripts that are properly written is immediately before the </body> tag. That way they don’t slow the loading of the rest of the page.

The only scripts that can’t be placed there are antiquated ones that still use document.write which therefore have to go in the spot in the body where you want the output to appear.

Placing script tags in the head of the page used to be common but it just makes the script more complicated and also makes the content load slower (because it has to wait for the script to load first) and so it is generally best to move those to the bottom so that you at least speed up having the content load.

Thanks all for the replies, I’m grateful!