Skip to content

Conversation

fredzqm
Copy link
Contributor

@fredzqm fredzqm commented Oct 14, 2025

We were getting some hard to parse flow in GA. Let's collapse them into counters~

image
dataconnect_init {
  flow: 'cli_pick_new_service_pick_existing_csql_save_template',
  project_status: 'blaze',
  num_web_apps: 1,
  num_android_apps: 0,
  num_ios_apps: 0,
  num_flutter_apps: 0
}

Besides this, a few minor fix:

  • Use "absent" when firebase-data-connect label is absent
  • Pass appropriate duration for dataconnect_init.

Description

Scenarios Tested

Sample Commands

…nd the number of apps for each platform (web, android, ios, flutter) as separate parameters in the `trackGA4` call.

I modified `src/init/features/dataconnect/index.ts` to include granular app counts (`num_web_apps`, `num_android_apps`, etc.) in the `trackGA4` call for the `dataconnect_init` event.

I have verified the changes in both `src/init/features/dataconnect/sdk.ts` and `src/init/features/dataconnect/index.ts`. The new analytics parameters are correctly implemented.
Copy link
Contributor

Summary of Changes

Hello @fredzqm, 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 enhances the analytics data collected during the Data Connect initialization process. It shifts the method of reporting app platform usage from a consolidated string within the flow parameter to distinct, numerical counters for web, Android, iOS, and Flutter applications. This change provides more granular and structured insights into the types of applications being initialized with Data Connect.

Highlights

  • Refactored Analytics Tracking: The pull request refactors how app platform information is tracked for the dataconnect_init event in GA4, moving from a single combined 'flow' label to individual counters.
  • Granular App Platform Counters: Introduced new GA4 parameters: num_web_apps, num_android_apps, num_ios_apps, and num_flutter_apps to provide specific counts for each app platform.
  • Updated trackGA4 Calls: Modified trackGA4 calls in src/init/features/dataconnect/index.ts and src/init/features/dataconnect/sdk.ts to include these new platform-specific app count parameters.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Google Analytics tracking for Data Connect initialization by replacing a single flow string with more granular counters for each application platform. The changes are implemented correctly in both src/init/features/dataconnect/index.ts and src/init/features/dataconnect/sdk.ts. My review focuses on improving maintainability by addressing code duplication and the use of hardcoded strings.

@fredzqm
Copy link
Contributor Author

fredzqm commented Oct 14, 2025

/gemini review

@fredzqm fredzqm changed the title [FDC] Move the apps portion from flow label to 4 counters [FDC Metrics] Move the app detection into 4 counter labels Oct 14, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the analytics tracking for Data Connect initialization by replacing a complex flow string with individual counters for each application platform. This is a positive change that improves the clarity and parsability of the collected analytics data. The implementation is sound and correctly achieves the stated goal. I have included one suggestion to refactor the new initAppCounters function for improved readability and type safety.

@fredzqm fredzqm requested a review from Copilot October 15, 2025 03:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors Firebase Data Connect analytics to use counter labels for app detection instead of flow strings, making metrics more parseable in Google Analytics. The change simplifies how app platform data is tracked by converting from flow-based strings to discrete counter fields.

Key changes:

  • Replace flow-based app tracking with individual counter labels (num_web_apps, num_android_apps, etc.)
  • Add proper duration tracking for analytics events
  • Handle absent firebase-data-connect labels with "absent" default value

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/init/features/dataconnect/sdk.ts Adds initAppCounters() function and refactors analytics tracking to use counters instead of flow strings
src/init/features/dataconnect/index.ts Updates main dataconnect init to use new counter-based analytics and include duration
src/dataconnect/provisionCloudSql.ts Sets default "absent" value for missing firebase-data-connect labels

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fredzqm
Copy link
Contributor Author

fredzqm commented Oct 15, 2025

@rosalyntan Got another small metrics PR~

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