Merge pull request #769 from ankitnayan/feat/opt-out

feat: adding org name and adding opt-out
This commit is contained in:
Ankit Nayan 2022-02-25 20:42:27 +05:30 committed by GitHub
commit 3a67d0237c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -683,8 +683,9 @@ func (aH *APIHandler) user(w http.ResponseWriter, r *http.Request) {
telemetry.GetInstance().IdentifyUser(user)
data := map[string]interface{}{
"name": user.Name,
"email": user.Email,
"name": user.Name,
"email": user.Email,
"organizationName": user.OrganizationName,
}
telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER, data)
@ -1108,6 +1109,12 @@ func (aH *APIHandler) setUserPreferences(w http.ResponseWriter, r *http.Request)
return
}
data := map[string]interface{}{
"hasOptedUpdates": userParams.HasOptedUpdates,
"isAnonymous": userParams.IsAnonymous,
}
telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER_PREFERENCES, data)
aH.writeJSON(w, r, map[string]string{"data": "user preferences set successfully"})
}

View File

@ -6,8 +6,9 @@ import (
)
type User struct {
Name string `json:"name"`
Email string `json:"email"`
Name string `json:"name"`
Email string `json:"email"`
OrganizationName string `json:"organizationName"`
}
type InstantQueryMetricsParams struct {

View File

@ -18,6 +18,7 @@ const (
TELEMETRY_EVENT_INPRODUCT_FEEDBACK = "InProduct Feeback Submitted"
TELEMETRY_EVENT_NUMBER_OF_SERVICES = "Number of Services"
TELEMETRY_EVENT_HEART_BEAT = "Heart Beat"
TELEMETRY_EVENT_USER_PREFERENCES = "User Preferences"
)
const api_key = "4Gmoa4ixJAUHx2BpJxsjwA1bEfnwEeRz"