I've tried this and it seems to work in next/head. I have a Layout component which has a Head, and this is used in every page. Placing the script in there should also work.
But I guess placing it in _document is best since this ensures the script is always on all pages.
How should the
_documentcomponent look like as aFunctionComponent?Also is there any difference in injecting the tags in
_documentorNextHead?I've tried this and it seems to work in
next/head. I have a Layout component which has aHead, and this is used in every page. Placing thescriptin there should also work.But I guess placing it in
_documentis best since this ensures the script is always on all pages.Yeah I did the same but forgot to add the general
Pagecomponent to every page so I was missing the script in some of my pages.