next.js google script 1

next.js google script

// https://github.com/zeit/next.js/tree/canary/examples/with-google-analytics

Here is what the above code is Doing:
1. We’re importing the GoogleAnalytics class from the next-ga package.
2. We’re creating a new instance of the GoogleAnalytics class and passing in our tracking ID.
3. We’re exporting a function called pageview that takes a page path as an argument.
4. We’re calling the pageview method on our GoogleAnalytics instance and passing in the page path.

Similar Posts