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

feat(analytics): Implement usage analytics with react-ga4 #1847

Merged
merged 7 commits into from
Mar 3, 2025

Conversation

Ninfa-Jeon
Copy link
Contributor

Done

  • Upgraded react-ga to react-ga4
  • Implemented usage analytics using event params

QA

  • Login to dashboard
  • Dashboard should send values like dashboard version, controller version and whether you’re using JAAS on successful login

Details

https://warthogs.atlassian.net/browse/WD-18723

@webteam-app
Copy link

Copy link

github-actions bot commented Feb 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 97.89% (🎯 95%) 14384 / 14694
🟢 Statements 97.89% (🎯 95%) 14384 / 14694
🟢 Functions 98.2% (🎯 95%) 601 / 612
🟢 Branches 92.11% (🎯 90%) 2991 / 3247
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/App/App.tsx 100% 100% 100% 100%
src/hooks/useAnalytics.tsx 100% 100% 100% 100%
src/store/middleware/model-poller.ts 95.98% 91.56% 100% 95.98% 55-56, 117-124, 159-160, 209, 407
src/utils/analytics.ts 100% 100% 100% 100%
Generated in workflow #181 for commit 35afec2 by the Vitest Coverage Report Action

Copy link
Contributor

@huwshimi huwshimi left a comment

Choose a reason for hiding this comment

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

For some reason the dimensions are still not included in dataLayer so we might need to investigate this a bit more.

@Ninfa-Jeon
Copy link
Contributor Author

For some reason the dimensions are still not included in dataLayer so we might need to investigate this a bit more.

I tried various things too but they don't seem to be working either. For now, pushing the successful changes. Investigating this.

@Ninfa-Jeon
Copy link
Contributor Author

For some reason the dimensions are still not included in dataLayer so we might need to investigate this a bit more.

I tried various things too but they don't seem to be working either. For now, pushing the successful changes. Investigating this.

Okay, so I've got the values to show up in dataLayer under user_properties. I have verified for both Juju and Jimm controller (PFA)
Screenshot 2025-02-18 at 3 07 31 PM
Screenshot 2025-02-18 at 3 11 15 PM

@Ninfa-Jeon Ninfa-Jeon marked this pull request as ready for review February 18, 2025 09:56
@Ninfa-Jeon Ninfa-Jeon force-pushed the add-usage-analytics branch 4 times, most recently from 5b6d394 to 5f17b69 Compare February 21, 2025 07:57
Copy link
Contributor

@huwshimi huwshimi left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks!

@Ninfa-Jeon Ninfa-Jeon merged commit 10e6d25 into canonical:main Mar 3, 2025
8 checks passed
@Ninfa-Jeon Ninfa-Jeon deleted the add-usage-analytics branch March 3, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants