Skip to content

Add Firebase-backed product analytics when measurement phase begins #8

Description

@daniel-techAI

Goal

Add Firebase/Google Analytics only when MindSwipe is ready to measure real usage or introduce cloud-backed product features, while preserving the current privacy-first local prototype until then.

Current state

  • React/Vite PWA + Capacitor Android wrapper.
  • No analytics SDK, advertising SDK, account system or remote user database.
  • Progress, saved cards, streaks and reminders stay on-device.

Why Firebase fits here

MindSwipe is an actual app, so Firebase can become useful for product analytics and later app infrastructure. It should be added deliberately, not merely because it exists.

External prerequisites

  • Create a Firebase project.
  • Enable Google Analytics for the Firebase project if product analytics is desired.
  • Register the web app.
  • Register the Android app when native measurement/release work begins.
  • Store platform configuration safely and document environments.
  • Update privacy notice/store disclosures before enabling collection in production.

Phase 1 — analytics only

  • Add the modular Firebase JS SDK to the web app.
  • Initialize Firebase from a single config module.
  • Enable Analytics only in supported production contexts and never during tests unless explicitly mocked.
  • Keep analytics code isolated from core learning/session logic.

Initial event taxonomy

Measure product value rather than every tap:

  • learning_session_started
  • learning_session_completed
  • card_saved
  • mission_completed
  • reminder_enabled
  • install_prompt_accepted
  • return_session or an equivalent retention event if needed

Do not send raw mood selections, free-form personal text, financial details or learning-content text as analytics parameters unless there is a separately justified and reviewed reason.

Phase 2 — reliability tooling

Evaluate after a real Android release path exists:

  • Crash reporting / Crashlytics where appropriate.
  • Performance Monitoring if actual performance problems need measurement.
  • Remote Config only when there is a concrete experiment/rollout need.

Phase 3 — cloud product features

Do not add these until the roadmap requires them:

  • Authentication.
  • Firestore/cloud sync.
  • Cross-device saved progress.
  • Server-side or cloud functions.

Local-first behavior is currently a feature, not a defect.

Reporting

  • Create a simple product overview focused on activation, completed learning sessions, saves, retention/returning use and install behavior.
  • Define a small KPI set before adding more events.

Validation

  • Verify events in Firebase/GA DebugView.
  • Confirm production-only initialization behavior.
  • Confirm offline/PWA behavior is unaffected.
  • Run npm run check and Android sync/build checks after integration.
  • Verify privacy notice and store disclosures match the implemented SDKs.

Definition of done

Firebase is attached only to the platforms/features that need it, the app emits a small intentional event set, analytics is verifiably useful for product decisions, and MindSwipe does not become a cloud architecture project before there is a product reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions