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: Added analytics logging on non-admin pages access #229

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

DedsecKnight
Copy link
Member

No description provided.

@DedsecKnight DedsecKnight requested a review from a team as a code owner April 11, 2023 06:14
@vercel
Copy link

vercel bot commented Apr 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hackportal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2023 3:32am

@geeth24
Copy link
Contributor

geeth24 commented Apr 11, 2023

@DedsecKnight i think we should disable analytics while in development?

@DedsecKnight
Copy link
Member Author

Good point! Will make that change once I got everything sorted out for this feature.

@geeth24
Copy link
Contributor

geeth24 commented Apr 11, 2023

wait then why is this pr not a draft?

Copy link
Member

@Spaceface16518 Spaceface16518 left a comment

Choose a reason for hiding this comment

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

I'm concerned that unconditionally placing the analytics calls in useEffect hooks will not provide the correct behavior for analytics. As noted by the docs, useEffect without dependencies runs after every re-render, so it might cause spurious event logs. Instead, we might look into listening to Next.js router events for logging, as detailed in this Next.js + Firebase analytics tutorial. This tutorial show how to use the built-in screen-view tracking feature of Firebase analytics (as opposed to logging custom events for each page).

pages/dashboard/index.tsx Outdated Show resolved Hide resolved
pages/register.tsx Outdated Show resolved Hide resolved
@geeth24
Copy link
Contributor

geeth24 commented Apr 17, 2023

@DedsecKnight does this require an extra env variable?

Copy link
Member

@Spaceface16518 Spaceface16518 left a comment

Choose a reason for hiding this comment

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

Can you remove all the imports you added when you had analytics in each individual page?

pages/profile.tsx Outdated Show resolved Hide resolved
@DedsecKnight
Copy link
Member Author

@DedsecKnight does this require an extra env variable?

@thetechie7 I am not sure what extra env variable you are referring to in this case.

pages/hackerpacks/index.tsx Outdated Show resolved Hide resolved
pages/profile.tsx Outdated Show resolved Hide resolved
pages/index.tsx Outdated Show resolved Hide resolved
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.

4 participants