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

Add Google Analytics #338

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Add Google Analytics #338

merged 1 commit into from
Feb 16, 2024

Conversation

mihow
Copy link
Collaborator

@mihow mihow commented Jan 26, 2024

No description provided.

Copy link

netlify bot commented Jan 26, 2024

Deploy Preview for ami-storybook ready!

Name Link
🔨 Latest commit a29ba10
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/65b43a725cc325000890d59c
😎 Deploy Preview https://deploy-preview-338--ami-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 26, 2024

Deploy Preview for ami-web ready!

Name Link
🔨 Latest commit a29ba10
🔍 Latest deploy log https://app.netlify.com/sites/ami-web/deploys/65b43a72260e610008b63dd4
😎 Deploy Preview https://deploy-preview-338--ami-web.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73
Accessibility: 100
Best Practices: 92
SEO: 92
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@mihow mihow requested a review from annavik January 26, 2024 23:14
@mihow
Copy link
Collaborator Author

mihow commented Jan 26, 2024

@annavik I haven't added GA to a React UI before. Let me know if there is a better way to integrate the tag.

@mihow
Copy link
Collaborator Author

mihow commented Jan 27, 2024

@annavik it would be preferable to make the gtag code a variable (as well as the Sentry DSN). Even though those aren't sensitive values, the project should be configurable in different environments (and for other groups, since it is open source).

@annavik
Copy link
Member

annavik commented Jan 27, 2024

I think this lib could be worth checking out: https://www.npmjs.com/package//react-gtm-module

Then we can easily pass GTM id as a variable (and have different values for different envs). Also have GTM more integrated with rest of the React app, for example if we want to configure custom events from other places in code, etc.

Let me know if you want me to give it a go! :)

@annavik
Copy link
Member

annavik commented Jan 27, 2024

Depending on where app will launched, we might have to make sure to only initialize the tracking if we have cookie consent. I n Europe we have laws about it so always in the back of my mind, but probably not to worry about at this early stage!

@mihow
Copy link
Collaborator Author

mihow commented Jan 28, 2024

Hi yes that react-gtm-module looks great @annavik! It's very nice to trigger custom actions as well (like start/cancel Job). Hopefully this library will trigger page views automatically when there is a URL location change, because that will cover most interaction events.

@mihow
Copy link
Collaborator Author

mihow commented Jan 28, 2024

For the GDPR cookie consent, we will need that before people can even log in. Is there a React or Radix module for such consent forms? Since it's ubiquitous now.

@annavik
Copy link
Member

annavik commented Jan 29, 2024

For the GDPR cookie consent, we will need that before people can even log in. Is there a React or Radix module for such consent forms? Since it's ubiquitous now.

I have only made custom solutions in the past, seems the law is still being interpreted in some different ways. However for the popup UI there are definitely Radix stuff we can use!

There are also different categories of cookies to consider. Necessary (login), preferences (could be a language setting for example) and statistics (like the GTM cookie). Some you just need to inform about, some must be opt out by default, etc. It ca be a bit of a jungle!

I think we should perhaps get some legal advice here first?

@mihow
Copy link
Collaborator Author

mihow commented Feb 7, 2024

I think the basic GDPR cookie acceptance modal will be enough. I haven't had any legal problems with using google analytics in Europe on other apps, as long as we have that GDPR question. I prefer the ones that say "By using this site you agree to... " with a button that says "Okay" or "I understand" rather than "I Agree" & "I Disagree". Because you can't actually continue to use the website if you disagree.

@mihow
Copy link
Collaborator Author

mihow commented Feb 16, 2024

Merging this as-is so we can troubleshoot interactions during the beta preview phase this month. I added two tickets with TODOs based on the conversation in this PR.

#351
#350

@mihow mihow merged commit 2c63b7e into main Feb 16, 2024
8 checks passed
@mihow mihow deleted the tracking/google-analytics branch February 16, 2024 05:16
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