From 618c4e4a56987a1520ee9ca871b2d8e20b13fded Mon Sep 17 00:00:00 2001
From: Hailey <me@haileyok.com>
Date: Thu, 6 Mar 2025 12:20:48 -0800
Subject: add some metrics for labelers (#7747)

* add some metrics

* add label pref switch metric

* Update src/screens/Profile/Header/ProfileHeaderLabeler.tsx

* Use new logger.metric

* Fix conflicting types

* Remove duplicate toasts

* Move metric to try body

* Move metric to try body

---------

Co-authored-by: Eric Bailey <git@esb.lol>
---
 src/screens/Profile/Header/ProfileHeaderLabeler.tsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'src/screens/Profile/Header/ProfileHeaderLabeler.tsx')

diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx
index 94de86228..d355b9987 100644
--- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx
+++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx
@@ -134,11 +134,21 @@ let ProfileHeaderLabeler = ({
   const onPressSubscribe = React.useCallback(
     () =>
       requireAuth(async (): Promise<void> => {
+        const subscribe = !isSubscribed
+
         try {
           await toggleSubscription({
             did: profile.did,
-            subscribe: !isSubscribed,
+            subscribe,
           })
+
+          logger.metric(
+            subscribe
+              ? 'moderation:subscribedToLabeler'
+              : 'moderation:unsubscribedFromLabeler',
+            {},
+            {statsig: true},
+          )
         } catch (e: any) {
           reset()
           if (e.message === 'MAX_LABELERS') {
-- 
cgit 1.4.1

