Skip to content

Improved telemetry by adding anonymous usage reports - #4687

Draft
gabriel-bolbotina wants to merge 15 commits into
masterfrom
prototype/telemetry
Draft

Improved telemetry by adding anonymous usage reports#4687
gabriel-bolbotina wants to merge 15 commits into
masterfrom
prototype/telemetry

Conversation

@gabriel-bolbotina

@gabriel-bolbotina gabriel-bolbotina commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This enhancement has been done to better understand our app and which features are valuable to our users, as well as continuing on improving the experience overall. It also helps prioritise development and simplifies UX/ UI design. It is an OPT-OUT enhancement that stores no personal data.

Summary of changes:

  • if enabled, the app now sends a weekly anonymous usage snapshot to our telemetry endpoint
  • all analytics logic lives in main.cpp as a static function trySubmitUsageSnapshot + signal connections for each feature that is analysed
  • Added OPT-OUT button in the app settings, which removes all the analysed data
  • on app install each devices receives a telemetry id, that is not linked to device UUID or user account
  • no username, no file paths nor other personal information are being stored

Resolves: https://github.com/MerginMaps/product/issues/127

gabriel-bolbotina and others added 14 commits August 27, 2026 13:05
Add usageReportEnabled property to AppSettings with QSettings
persistence under usage_report/enabled. On opt-out, all accumulated
usage_report/* data is cleared but the enabled flag is preserved.

Wire the toggle to the settings page UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add USAGE_REPORT_KEY CMake variable and mmconfig.h.in define.

Add trySubmitUsageSnapshot() function in main.cpp that:
- checks if a weekly snapshot is due
- collects static data (device, app, server info)
- merges accumulated dynamic data from QSettings
- sends a single HTTP POST to the EU endpoint
- resets dynamic data on success, silently ignores errors

Called once after app initialization. No signal connections yet —
dynamic data accumulation will be wired in the next commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire feature class signals in main.cpp to lambdas that write usage
data to QSettings under usage_report/data/*.

Signals connected:
- FilterController::hasFiltersActivatedChanged → filtering
- AutosyncController::projectSyncRequested → autosync
- ProjectWizard::projectCreated → created_project
- AndroidUtils/IosUtils::photoCaptured/photoFromGallery → image counts
- MerginUserInfo::activeWorkspaceChanged → workspace_switches
- PositionKit::positionProviderChanged → external GPS tracking
- ActiveProject::projectRoleChanged → highest_role
- ActiveProject::loadingStarted/projectReloaded → project load time

New signals added:
- MapSketchingController::sketched() for map sketching detection
- AndroidUtils/IosUtils::photoCaptured()/photoFromGallery() to
  distinguish camera capture from gallery attachment

Connectivity ping timer: HEAD request every 5 minutes, counts
success/failure in QSettings.

Note: map measuring, map sketching, photo sketching, reuse last
value, and bulk editing are QML-instantiated objects — these will
be tracked via AppSettings helpers in the next commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add trackUsageFeature() and incrementUsageCounter() to AppSettings
for features whose C++ controllers are QML-instantiated per-use
objects with no persistent instance to connect to in main.cpp.

Tracked from QML:
- map_measuring (MMMapController)
- map_sketching (MMMapController)
- photo_sketching (MMFormPhotoSketchingPageDialog)
- reuse_last_value (MMFormStackController, on form save)
- bulk_editing (main.qml, on multi-edit with >1 feature)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added a temporary endpoint
Remaned distinct_id with device_id
Added layer and feature search analytics
Updated filtering analytics
@gabriel-bolbotina gabriel-bolbotina changed the title Add anonymous weekly usage telemetry Improved telemetry by adding anonymous usage reports Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33194016277

Coverage decreased (-1.0%) to 58.593%

Details

  • Coverage decreased (-1.0%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 737 coverage regressions across 11 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

737 previously-covered lines in 11 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
mm/app/main.cpp 265 33.79%
mm/app/maptools/recordingmaptool.cpp 185 68.01%
mm/app/position/positionkit.cpp 98 60.35%
mm/app/appsettings.cpp 70 63.71%
mm/app/variablesmanager.cpp 49 25.74%
mm/app/mapsketchingcontroller.cpp 31 0.0%
mm/app/ios/iosutils.cpp 16 15.15%
mm/app/position/geoposition.cpp 9 80.0%
mm/core/merginapi.cpp 7 74.79%
mm/app/position/positiontransformer.cpp 6 85.09%

Coverage Stats

Coverage Status
Relevant Lines: 15932
Covered Lines: 9335
Line Coverage: 58.59%
Coverage Strength: 95.85 hits per line

💛 - Coveralls

@gabriel-bolbotina gabriel-bolbotina self-assigned this Aug 28, 2026
@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 72451 dmg Expires: 26/11/2026 #7245
linux Build 📬 Mergin Maps 72711 x86_64 Expires: 26/11/2026 #7271
win64 Build 📬 Mergin Maps 64471 win64 Expires: 26/11/2026 #6447
Android Build 📬 Mergin Maps 855511 APK [armeabi-v7a] Expires: 26/11/2026 #8555
📬 Mergin Maps 855511 APK [armeabi-v7a] Google Play Store #8555
Android Build 📬 Mergin Maps 855551 APK [arm64-v8a] Expires: 26/11/2026 #8555
📬 Mergin Maps 855551 APK [arm64-v8a] Google Play Store #8555
iOS Build 📬 Build number: 26.08.949711 #9497

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 72471 dmg Expires: 26/11/2026 #7247
linux Build 📬 Mergin Maps 72731 x86_64 Expires: 26/11/2026 #7273
win64 Build 📬 Mergin Maps 64491 win64 Expires: 26/11/2026 #6449
Android Build 📬 Mergin Maps 855751 APK [arm64-v8a] Expires: 26/11/2026 #8557
📬 Mergin Maps 855751 APK [arm64-v8a] Google Play Store #8557
Android Build 📬 Mergin Maps 855711 APK [armeabi-v7a] Expires: 26/11/2026 #8557
📬 Mergin Maps 855711 APK [armeabi-v7a] Google Play Store #8557
iOS Build 📬 Build number: 26.08.949911 #9499

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.

1 participant