gtag('js', new Date()); This package optimizes script loading using Next.js Script tag, which means that it will only work on apps using Next.js >= 11.0.0. To do so, I suggest you create a lib folder where you will put all your code related to third-party libraries and another folder inside called ga for Google Analytics. To load it and test it on development, add: As an alternative, you can use the gaMeasurementId param to pass your Google Analytics measurement id. The