feat(analytics): multi-provider (Firebase+Matomo), queueing with persistence, standardized events#2932
feat(analytics): multi-provider (Firebase+Matomo), queueing with persistence, standardized events#2932
Conversation
- Resolved conflicts in analytics_repo.dart by keeping the new provider-based architecture while maintaining compatibility - Updated dependency resolved-refs to latest from dev branch - Unified HTTP dependency version to match dev branch - Updated win32 dependency version from dev branch
…into add/enhanced-analytics-v2
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Visit the preview URL for this PR (updated for commit c3551a3): https://walletrc--pull-2932-merge-7y966wuu.web.app (expires Wed, 08 Oct 2025 15:43:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
…into add/enhanced-analytics-v2 # Conflicts: # lib/bloc/coins_manager/coins_manager_bloc.dart
…into add/enhanced-analytics-v2
* Refactor analytics events with wallet type and add logging for various flows Co-authored-by: charl <charl@vanstaden.info> * Remove analytics logging from NFT withdraw footer Co-authored-by: charl <charl@vanstaden.info> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…into add/enhanced-analytics-v2 # Conflicts: # ios/Podfile.lock # macos/Podfile.lock # pubspec.lock
- ci(generate-assets,firebase-hosting): update action and PR workflow - feat(analytics): Matomo API and analytics repo updates - chore(shared): update constants - test(integration): update integration test runner - style: apply dart format across repo
… flags Add MATOMO_SETUP.md; expand FIREBASE_SETUP.md; update ANALYTICS.md with runtime flags and queue persistence.
…into add/enhanced-analytics-v2 # Conflicts: # lib/services/initializer/app_bootstrapper.dart # lib/services/logger/universal_logger.dart # lib/shared/widgets/coin_type_tag.dart # lib/views/fiat/fiat_select_button.dart # lib/views/market_maker_bot/coin_selection_and_amount_input.dart # lib/views/wallet/wallet_page/common/expandable_coin_list_item.dart
- Standardized analytics events to use walletType instead of hdType - Updated bridge events to use new BridgeSucceededEventData and BridgeFailedEventData classes - Added analytics logging for marketbot setup started events - Merged both walletType and durationMs parameters in bridge events
…ading details\n\n- Add optional duration_ms to bridge_success and bridge_failure payloads\n- Forward durationMs through AnalyticsBridgeSucceeded/FailedEvent wrappers\n- Pass computed durationMs when logging bridge events from trading_details.dart\n- Update required_analytics_events.csv to document duration_ms for bridge events
No functional changes in this commit. This just stages prior local modifications to ensure a clean working tree.
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
Co-authored-by: charl <charl@vanstaden.info>
c73ae06 to
51f31cc
Compare
smk762
left a comment
There was a problem hiding this comment.
Confirmed dashboard detects app, though upon browsing I noticed a few instances of Oops… there was a problem during the request. and very little else - most pages showed "no data" - though there was some. Perhaps it just needs to be populated more?
Approving as there is enough data to confirm the linkage, and general smoke test of standard wallet/dex ops function as expected.
If further confirmation testing is required regarding the "no data", please let me know.
|
@smk762 there was a permissions issue and I fixed it. please check again, the data should populate |
the view_asset, swap_initiated, asset_enabled, swap_success events should mention the actual names of the assets @CharlVS |
|
Thanks, @gcharang I'll have a look. It should be receiving exactly the same data as the other provider. |
|
@cursoragent, check for issues where event parameters are not being included in the events logged by Matomo. |
|
I've enhanced the Matomo analytics tracking by modifying how events are labeled, ensuring that event parameters are now captured and displayed as the event's name (label) in Matomo. This provides more detailed and contextual information directly within the analytics interface.
Learn more about Cursor Agents |
Thanks - confirmed I dont see the error boxes any more. There's still a few places with "no data", but I can see new things too like the events table. Just took a little VPN tour around a few countries, which soon after were visible on the map. My prior approval remains in effect, otherwise let me know if anything else specific to look for. |
…ytics_events.csv Add explicit event->category map; expand numeric keys; add sync note; prefer metadata source over hardcoding.
…into add/enhanced-analytics-v2 # Conflicts: # sdk
…ered - Remove premature swap_success event from maker order confirmation - Maker orders only place orders on orderbook; swap happens when matched - Actual success/failure logged in trading_details when swap completes - Remove incorrect swap_failure event from maker order submission errors - Order creation failures are not swap failures (swap never started) - Add swap_failure tracking to taker flow for immediate RPC errors - Logs analytics when sell RPC fails before swap UUID is returned - Add AnalyticsBloc and KomodoDefiSdk dependencies to TakerBloc - Required for logging failure events with correct wallet type All swap analytics events (swap_initiated, swap_success, swap_failure) now: - Trigger at correct lifecycle stages - Are idempotent (no duplicates via state flags) - Capture all success and failure scenarios - Follow CSV specification requirements
- Add and update analytics events across multiple categories (cross-chain, market bot, NFT, portfolio, rewards, security, transactions, user acquisition) - Integrate analytics tracking in blocs (bridge, coin addresses, coins manager, custom token import, market maker bot, NFT withdraw, taker) - Integrate analytics tracking in views (bridge, DEX, settings, wallet) - Update Matomo analytics API implementation - Update required analytics events tracking CSV
# Conflicts: # AGENTS.md # lib/views/dex/simple/confirm/maker_order_confirmation.dart # lib/views/dex/simple/confirm/taker_order_confirmation.dart # lib/views/market_maker_bot/market_maker_bot_confirmation_form.dart # lib/views/settings/widgets/security_settings/private_key_settings/private_key_show.dart

feat(analytics): multi-provider (Firebase+Matomo), queueing with persistence, standardized events
@KomodoPlatform/qa Jump to the bottom of this message for testing info; but I still suggest reading below for additional context.
Overview
Key changes
lib/bloc/analytics/analytics_api.dart.FirebaseAnalyticsApiandMatomoAnalyticsApi.lib/bloc/analytics/analytics_repo.dartregisters Firebase always; registers Matomo only when bothMATOMO_URLandMATOMO_SITE_IDare provided; enforcesANALYTICS_DISABLEDandCIgating vialib/shared/constants.dart.SharedPreferencesand restore on startup; flush on activation.matomo_trackerpersistent dispatch; queues in-memory when disabled and flushes on activation. Optional visit-scoped custom dimension for platform.--dart-defineandlib/shared/constants.dart:MATOMO_URL,MATOMO_SITE_ID, optionalMATOMO_PLATFORM_DIMENSION_ID.ANALYTICS_DISABLEDandCI. Adds optionalX-KW-KEYheader fromFEEDBACK_API_KEYif present.EventInfowith category derived from event name; numeric value inferred from common keys.lib/analytics/analytics_factory.dart,lib/analytics/events/*, and updates inlib/views/*such as:lib/views/dex/simple/confirm/maker_order_confirmation.dartlib/views/dex/simple/confirm/taker_order_confirmation.dartlib/views/bridge/bridge_confirmation.dartlib/views/wallet/coin_details/withdraw_form/withdraw_form.dartlib/shared/constants.dart:ANALYTICS_DISABLED,CI,MATOMO_URL,MATOMO_SITE_ID,MATOMO_PLATFORM_DIMENSION_ID.docs/ANALYTICS.md, newdocs/MATOMO_SETUP.md,docs/FIREBASE_SETUP.md.pubspec.yamladdsmatomo_tracker.Developer notes (build flags)
Notes:
MATOMO_URLorMATOMO_SITE_IDis missing. EnsureMATOMO_URLends with a trailing slash (as required bymatomo_tracker).Scope
lib/bloc/analytics/*,lib/analytics/analytics_factory.dart,lib/analytics/events/*,lib/shared/constants.dart, DEX/Bridge/Withdraw/NFT/MMB views, docs, workflows, and macOS registrant.No breaking changes
Testing (QA)
kwa.komodoplatform.comfor Matomo, not sure about URL for Google Analytics), or (preferably) viewing the events in Matomo and Firebase. @gcharang, please set up @smk762 with access to Matomo.It's not realistic to test all 45 analytics events (file), but it may be sufficient to monitor the logged events post-release. When we have time, we can do a thorough scrub of all analytics to ensure they are always firing when they should, exactly once - no more and no less.
Note
Introduce unified analytics with Firebase+Matomo, robust queueing/persistence, runtime/CI gating, and standardized event instrumentation across DEX, Bridge, Wallet, NFTs, MMB, Settings, and UI.
AnalyticsApiinterface and unifiedAnalyticsRepositoryto fan out events to multiple providers.FirebaseAnalyticsApiand optionalMatomoAnalyticsApi(registered via flags); both support activate/deactivate/retry.SharedPreferences; Matomo uses persistent dispatch; flush on activation.ANALYTICS_DISABLEDandCIflags; optionalMATOMO_URL,MATOMO_SITE_ID(and platform dimension) inshared/constants.dart.asset/network/hd_type/failure_reason, etc.).docs/ANALYTICS.md,docs/FIREBASE_SETUP.md; adddocs/MATOMO_SETUP.mdwith flags and setup guidance.matomo_tracker(and related plugin registrations); minor macOS registrant/project updates.AnalyticsRepository.Written by Cursor Bugbot for commit c3551a3. This will update automatically on new commits. Configure here.