When creating a site with ads, wrap your placeholder with an "ad" class, and define the demensions. Also, make sure that it renders well with `.ad { display:none !important;}` set so that you work well with ad blockers.
When working on injecting ads/content, don't use heavy frameworks like jquery, stick to micro frameworks or preferably hand-craft what you need and use rollup to build/bundle. http://microjs.com/ is your friend on this one. If you can come in under 5kb for js+gz, that's your best bet here.