status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
276 stars 75 forks source link

Implement placeholder opt-in metrics checkbox at the start of onboarding for new users and backend #15446

Closed jrainville closed 1 week ago

jrainville commented 3 weeks ago

Description

status-go PR: https://github.com/status-im/status-go/pull/5477 (mostly ready now)

Once the status-go PR above is ready, we can start working on adding a placeholder checkbox on the onboarding for new users to opt in sending metrics.

This setting will be global for the installation/device. It needs to be before the sign in and login, because we want to track the onboarding metrics too.

Make it placeholder as we'll get the designs later.

Acceptance Criteria

jrainville commented 3 weeks ago

As per @cammellos :

(native-module/initialize-centralized-metrics {:appsflyerAppId config/appsflyer-app-id
                                                   :appsflyerToken config/appsflyer-token}
                                                  (fn [response]
                                                    (log/debug "metrics init response" response)
                                                    (toggle true #(log/debug "started metrics"))
                                                    (app-started-event))

So first you want to call the method:

.initializeCentralizedMetrics {"appsflyerAppId": "appid", "appsflyerToken": "token"} this should be at app initialization (we want to inject credentials at build time from the clients, discussed with Jakub) once you do that, you can start stop by running: .toggleCentralizedMetrics {"enabled": true} and you can push metrics using .addCentralizedMetrics {"eventName": "a string", "eventValue": any-valid-json}