Skip to content

Commit

Permalink
Update Readme (React-ga4 clarification)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEsteves committed May 12, 2023
1 parent 52c8836 commit ccadcaf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/with-react-ga4/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# React-GA example
# React-GA4 example

As of this change, [React-GA](https://github.com/react-ga/react-ga ) uses Universal Analytics which will be deprecated in July 1, 2023. Until this is fixed, this example has been updated to use the `React-GA4` library.

This example shows the most basic way to use [react-ga4](https://github.com/codler/react-ga4) using custom [App](https://github.com/vercel/next.js#custom-app)
component with NextJs. Modify `Tracking ID` in `utils/analytics.js` file for testing this example.
Expand All @@ -14,15 +16,15 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:

```bash
npx create-next-app --example with-react-ga with-react-ga-app
npx create-next-app --example with-react-ga4 with-react-ga-app
```

```bash
yarn create next-app --example with-react-ga with-react-ga-app
yarn create next-app --example with-react-ga4 with-react-ga-app
```

```bash
pnpm create next-app --example with-react-ga with-react-ga-app
pnpm create next-app --example with-react-ga4 with-react-ga-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

0 comments on commit ccadcaf

Please sign in to comment.