Back to Next Js

Example app with analytics

examples/with-google-analytics/README.md

16.2.51.3 KB
Original Source

Example app with analytics

This example shows how to use Next.js along with Google Analytics 4.

If you are using the Pages Router, please refer to the pages/ documentation.

Deploy your own

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

bash
npx create-next-app --example with-google-analytics with-google-analytics-app
bash
yarn create next-app --example with-google-analytics with-google-analytics-app
bash
pnpm create next-app --example with-google-analytics with-google-analytics-app

Deploy it to the cloud with Vercel (Documentation).