I have a NextJS app and the page structure loosely looks like this:
<Head>
<Navigation>
<Page>
<Footer>
I have a DTM script that I need to load in the <Head> component and then there are tags that I am firing in the <Page> component. But the problem is, the tags in <Page> starts firing before the DTM script get's loaded onto the page.
So, is there a way to let the DTM script in the <Head> tag load first before the <Page> component loads? I was looking to use "componentwillmount" but it's being deprecated.
Can someone please advice how can I tackle this issue?