bebf3725a8
Next.js-hydration now triggered after gtag is initialized. Fixed by adding _document.js and appropriate script elements. --- ## Documentation / Examples - [X] Related issues linked using fixes #40410 - [X] Make sure the linting passes by running `pnpm lint` - [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Next.js-hydration now triggered after gtag is initialized. |
||
---|---|---|
.. | ||
components | ||
lib | ||
pages | ||
.env.local.example | ||
.gitignore | ||
package.json | ||
README.md |
Example app with analytics
This example shows how to use Next.js along with Google Analytics. A custom _app is used to inject tracking snippet and track pageviews and event.
Deploy your own
Deploy the example using Vercel:
How to use
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-google-analytics with-google-analytics-app
yarn create next-app --example with-google-analytics with-google-analytics-app
pnpm create next-app --example with-google-analytics with-google-analytics-app
Deploy it to the cloud with Vercel (Documentation).