score:0

You can use Head in any components by Nextjs. How about you add Head in Page and put <script/> inside

score:4

You could listen to the script load event from your <Page> component using vanilla javascript. in your custom _document:

<script id="dtm" src="dtm.js" />

then in the <Page> component:

document.getElementById("dtm").addEventListener('load', () => {
  // DTM is loaded
})

Related Query

More Query from same tag