-
SummaryI want to add a few scripts from Google for website tracking and cookies... previously I only had the tracking on the app.js and it was working fine. Now I want to add a few other scripts to work for cookies but it isn't working. According to Next.js information, some scripts like cookie consent should/could be set as The code I have is this from _document.js ^^ the divs from the component doesn't even show. If I put the Because Next.js mentions that cookie consent beforeInteractive should work from the _document.js page, then I would like to implemented in the _document.js page... What would be a good way for the component to work in the _document.js page? The link for page tags is this (with errors on tags, and still testing) Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi, The problem is the From, https://nextjs.org/docs/pages/building-your-application/routing/custom-document:
I'd say, break it down, into the Component that injects the Scripts you need, used in What errors are you seeing? |
Beta Was this translation helpful? Give feedback.
Hi,
The problem is the
_documentcan't contain any interactivity.From, https://nextjs.org/docs/pages/building-your-application/routing/custom-document:
I'd say, break it down, into the Component that injects the Scripts you need, used in
_document, and the component that handles consent, in_appWhat errors are you seeing?