rsnext/examples/with-react-ga4
Okoye Charles 829e2ebab6
Resolve grammatical errors in examples (#65644)
## Description
I fixed grammatical errors in a few READMEs in the `example` directory.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-05-13 17:10:40 +00:00
..
pages chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
utils chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
.gitignore Add .yarn/install-state.gz to .gitignore (#56637) 2023-10-18 16:34:48 +00:00
package.json
README.md Resolve grammatical errors in examples (#65644) 2024-05-13 17:10:40 +00:00

React-GA4 example

As of May 2023, react-ga uses Universal Analytics which will stop processing new data starting July 2023. Until this is fixed, this example has been updated to use react-ga4 instead.

This example shows the most basic way to use react-ga4 using a custom App component with Next.js. Modify Tracking ID in utils/analytics.js file for testing this example.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

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

npx create-next-app --example with-react-ga4 with-react-ga-app
yarn create next-app --example with-react-ga4 with-react-ga-app
pnpm create next-app --example with-react-ga4 with-react-ga-app

Deploy it to the cloud with Vercel (Documentation).