Using Google Analytics with React/Next.js Projects

@shaaddev

Don't mind me here, I am only creating a quick note.

  1. Create your own Google Analytics Project

If you haven't done this part before, it as simple as signing up on the Google Analytics page, see link below:

Google Analytics for Developers

  1. Create your Google Analytics Component

Inside of your components folder, create a file called google-analytics.tsx, and add the following:

  1. Add the secrets into your .env.local file
  1. Add the component to your global component

Inside of app folder, look for the file that says layout.tsx and import the component like so:

El fin. :)