feat(stage-*): track provider card clicks and time-to-first-message#832
Conversation
…ta registration from app-specific modules
…mation management in the analytics store by using a dedicated buildInfo object.
…rack provider clicks
…m store to `useAnalytics`
Summary of ChangesHello @shinohara-rin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's analytics capabilities by introducing a centralized analytics store and integrating PostHog for tracking key user interactions. It establishes a robust framework for collecting build-related metadata and user behavior, specifically focusing on how users engage with service providers and their initial interaction with the chat functionality. This refactor aims to provide deeper insights into user experience and application performance without affecting core functionalities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.
Hey, @nekomeowww, @sumimakito, @luoling8192, @LemonNekoGH, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏 |
There was a problem hiding this comment.
Code Review
This pull request introduces analytics tracking for provider card clicks and time-to-first-message using PostHog. It also includes a significant and beneficial refactoring to centralize analytics logic into a shared store and composable, which improves maintainability by decoupling components from build-time information.
I've found a critical issue in both stage-web and stage-tamagotchi applications where useAnalytics() is called before the Pinia store is initialized, which will cause the applications to crash on startup. I've provided a detailed fix for this. Additionally, I've suggested a small improvement to make the version tracking logic more robust.
Overall, the changes are well-structured and the new features are implemented correctly, pending the fix for the initialization issue.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…adata registration to mitigate potential race condition
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces analytics for tracking provider card clicks and the time to the first message, which is a valuable addition for understanding user behavior. The refactoring of analytics initialization into a shared Pinia store is a significant improvement for maintainability and consistency across the applications. The implementation is solid and well-executed. I've included a couple of minor suggestions to further enhance the encapsulation and simplify the API of the new analytics store.
|
ooops i didn't meant to push that |
8ff1a11 to
66d7af9
Compare
| // Initialize analytics | ||
| const analyticsStore = useSharedAnalyticsStore(pinia) | ||
| analyticsStore.initialize({ | ||
| version: version ?? 'dev', | ||
| commit: abbreviatedSha, | ||
| branch, | ||
| builtOn: buildTime.toISOString(), | ||
| }) | ||
|
|
There was a problem hiding this comment.
We should initialize in App.vue.
|
|
||
| // Initialize analytics | ||
| const analyticsStore = useSharedAnalyticsStore(pinia) | ||
| analyticsStore.initialize({ | ||
| version: version ?? 'dev', | ||
| commit: abbreviatedSha, | ||
| branch, | ||
| builtOn: buildTime.toISOString(), | ||
| }) | ||
|
|
There was a problem hiding this comment.
We should initialize in App.vue.
track provider card clicks and time-to-first-message
introduces new events:
provider_card_clicked,first_message_sent