Just import Script from 'next/script'
.
However, it must be Next.js v11 or later released before 2021/06/16
- [Next.js 11 next/script contains the basics of JavaScript].
- Can’t resolve ‘next/script’.
- I did
npm install react@latest react-dom@latest next@latest
and it worked!
This page is auto-translated from [/nishio/NextJSでGoogle Analytics](https://scrapbox.io/nishio/NextJSでGoogle Analytics) using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.