I'm currently trying to add a third party script to my Next.js application. The script inserts an iframe directly below the script tag. So I need precise control over where the script tag is located on the page.
I'm currently using next/script because regular script tags are preventing the iframe from rendering. However, the next/script tag seems to relocate the script based on the strategy used: Using beforeInteractive strategy inserts the script into the head. afterInteractive and lazyOnload insert it somewhere near the bottom of the page.
If I have something like the following:
<div id="script-container">
<Script id="script" async /* other attributes */ />
</div>
How would I ensure that the script remains inside the script-container div when the page loads?