From afca4bf70160b6b15e3fe55e2cf8ba326a30597c Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Thu, 7 Dec 2023 18:48:23 -0600
Subject: Add more breadcrumbs (#2141)

---
 src/lib/analytics/analytics.web.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/lib/analytics/analytics.web.tsx')

diff --git a/src/lib/analytics/analytics.web.tsx b/src/lib/analytics/analytics.web.tsx
index 71c32d758..b717950ae 100644
--- a/src/lib/analytics/analytics.web.tsx
+++ b/src/lib/analytics/analytics.web.tsx
@@ -1,8 +1,9 @@
 import React from 'react'
 import {createClient} from '@segment/analytics-react'
 import {sha256} from 'js-sha256'
-import {TrackEvent, AnalyticsMethods} from './types'
+import {Browser} from 'sentry-expo'
 
+import {TrackEvent, AnalyticsMethods} from './types'
 import {useSession, SessionAccount} from '#/state/session'
 import {logger} from '#/logger'
 
@@ -29,6 +30,7 @@ function getClient(): SegmentClient {
 }
 
 export const track: TrackEvent = async (...args) => {
+  logger.info('analytics: track', {args})
   await getClient().track(...args)
 }
 
@@ -38,9 +40,11 @@ export function useAnalytics(): AnalyticsMethods {
     if (hasSession) {
       return {
         async screen(...args) {
+          logger.info('analytics: screen', {args})
           await getClient().screen(...args)
         },
         async track(...args) {
+          logger.info('analytics: track', {args})
           await getClient().track(...args)
         },
       }
@@ -59,6 +63,7 @@ export function init(account: SessionAccount | undefined) {
     if (account.did) {
       const did_hashed = sha256(account.did)
       client.identify(did_hashed, {did_hashed})
+      Browser.setUser({id: did_hashed})
       logger.debug('Ping w/hash')
     } else {
       logger.debug('Ping w/o hash')
-- 
cgit 1.4.1

