chore: track onboarding progress
Easy self-onboarding has been hardest to get right in complex business apps, even though we have worked on this for long long time we have no clear idea on how well it works, or if it's severly lacking. We want to improve this by first understanding how efficient current system is. This PR adds basic telemetry for which steps are being completed, which are skipped and what onboarding group is dismissed completely.
This commit is contained in:
parent
fa80cfd2cf
commit
cbbb6a7d85
2 changed files with 6 additions and 2 deletions
|
|
@ -617,4 +617,8 @@ def update_onboarding_step(name, field, value):
|
|||
value: Value to be updated
|
||||
|
||||
"""
|
||||
from frappe.utils.telemetry import capture
|
||||
|
||||
frappe.db.set_value("Onboarding Step", name, field, value)
|
||||
|
||||
capture(frappe.scrub(name), app="frappe_onboarding", properties={field: value})
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ def init_telemetry():
|
|||
frappe.local.posthog = Posthog(posthog_project_id, host=posthog_host)
|
||||
|
||||
|
||||
def capture(event, app):
|
||||
def capture(event, app, **kwargs):
|
||||
init_telemetry()
|
||||
ph: Posthog = getattr(frappe.local, "posthog", None)
|
||||
with suppress(Exception):
|
||||
ph and ph.capture(frappe.local.site, f"{app}_{event}")
|
||||
ph and ph.capture(distinct_id=frappe.local.site, event=f"{app}_{event}", **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue