Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data analytics #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

kahookele
Copy link
Contributor

Summary

Added Google Analytics (GA4) tracking for user visits

Changes

  • Implemented Google Analytics 4 feature using the react-ga4 library.
  • Pageviews are now tracked across the website.
  • Refer to the following commits for implementation details.
  • Added new feature:
    Google analytics implementation using react-ga4. I think, in order to test this feature, you will have to create a Google Analytic account and change the tracking ID (made in comments in index.js file).

Installation

  1. Install Google Analytics 4 with npm install react-ga4 in your terminal.
  2. Create a Google Analytic account and just follow the steps. (When you get to the end where it shows you how to import the code, close that. You're done).
  3. Get the tracking id (ex. G-xxxxxxxx) and replace with the current tracking id in your code editor.
  4. Check to see if your tracking id works with your Google Analytics account.

Screenshots

Screenshot 2024-02-28 094414
Screenshot 2024-02-28 094543

Just let me know if this might be too big of a hassle so I can look for another issue to contribute to lol Thanks! :)

…To test, type 'npm install react-ga4' into terminal and create a tracking ID in google analytics. From there, change tracking ID in index.js file. Please let me know if this is still needed for the website or not.
…To test, type 'npm install react-ga4' into terminal and create a tracking ID in google analytics. From there, change tracking ID in index.js file. Please let me know if this is still needed for the website or not.

export default function Home() {

const TRACKING_ID = "G-4TRT9PDZQ9"; // Change tracking ID to use your own on Google Analytics. ID currently set is used for my development environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated G-9J724Z10KJ using the [email protected]

Suggested change
const TRACKING_ID = "G-4TRT9PDZQ9"; // Change tracking ID to use your own on Google Analytics. ID currently set is used for my development environment.
const TRACKING_ID = "G-9J724Z10KJ";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants