Google Analytics automatically tracks pageviews when the browser history state changes. This means that client-side navigations between Next.js routes will send pageview data without any configuration.
Code link:- https://codewithdev.com/blog/how-to-a...