restore statsig to log events

This commit is contained in:
Samuel Newman
2025-03-31 20:17:48 +03:00
committed by Eric Bailey
parent b4aa67572d
commit 33a96cee11
5 changed files with 49 additions and 21 deletions
@@ -74,7 +74,11 @@ export function SearchButton({
shape="round" shape="round"
PressableComponent={native(PressableScale)} PressableComponent={native(PressableScale)}
onPress={() => { onPress={() => {
logger.metric('explore:module:searchButtonPress', {module: metricsTag}) logger.metric(
'explore:module:searchButtonPress',
{module: metricsTag},
{statsig: true},
)
onPress?.() onPress?.()
}}> }}>
<ButtonIcon icon={SearchIcon} size="lg" /> <ButtonIcon icon={SearchIcon} size="lg" />
@@ -88,9 +88,11 @@ function Inner() {
key={topic.link} key={topic.link}
topic={topic} topic={topic}
onPress={() => { onPress={() => {
logger.metric('recommendedTopic:click', { logger.metric(
context: 'explore', 'recommendedTopic:click',
}) {context: 'explore'},
{statsig: true},
)
}}> }}>
{({hovered}) => ( {({hovered}) => (
<TrendingTopic <TrendingTopic
@@ -39,7 +39,11 @@ export function SuggestedAccountsTabBar({
interests={['all', ...interests]} interests={['all', ...interests]}
selectedInterest={selectedInterest || 'all'} selectedInterest={selectedInterest || 'all'}
onSelectTab={tab => { onSelectTab={tab => {
logger.metric('explore:suggestedAccounts:tabPressed', {tab: tab}) logger.metric(
'explore:suggestedAccounts:tabPressed',
{tab: tab},
{statsig: true},
)
onSelectInterest(tab === 'all' ? null : tab) onSelectInterest(tab === 'all' ? null : tab)
}} }}
hasSearchText={false} hasSearchText={false}
@@ -131,11 +135,15 @@ let SuggestedProfileCard = ({
profile={profile} profile={profile}
style={[a.flex_1]} style={[a.flex_1]}
onPress={() => { onPress={() => {
logger.metric('suggestedUser:press', { logger.metric(
logContext: 'Explore', 'suggestedUser:press',
recId, {
position, logContext: 'Explore',
}) recId,
position,
},
{statsig: true},
)
}}> }}>
<View <View
style={[ style={[
@@ -162,12 +170,16 @@ let SuggestedProfileCard = ({
withIcon={false} withIcon={false}
logContext="ExploreSuggestedAccounts" logContext="ExploreSuggestedAccounts"
onFollow={() => { onFollow={() => {
logger.metric('suggestedUser:follow', { logger.metric(
logContext: 'Explore', 'suggestedUser:follow',
location: 'Card', {
recId, logContext: 'Explore',
position, location: 'Card',
}) recId,
position,
},
{statsig: true},
)
}} }}
/> />
</ProfileCard.Header> </ProfileCard.Header>
@@ -43,7 +43,11 @@ function Inner() {
const trendingPrompt = Prompt.usePromptControl() const trendingPrompt = Prompt.usePromptControl()
const onConfirmHide = React.useCallback(() => { const onConfirmHide = React.useCallback(() => {
logger.metric('trendingTopics:hide', {context: 'explore:trending'}) logger.metric(
'trendingTopics:hide',
{context: 'explore:trending'},
{statsig: true},
)
setTrendingDisabled(true) setTrendingDisabled(true)
}, [setTrendingDisabled]) }, [setTrendingDisabled])
@@ -110,7 +114,11 @@ function Inner() {
key={topic.link} key={topic.link}
topic={topic} topic={topic}
onPress={() => { onPress={() => {
logger.metric('trendingTopic:click', {context: 'explore'}) logger.metric(
'trendingTopic:click',
{context: 'explore'},
{statsig: true},
)
}}> }}>
{({hovered}) => ( {({hovered}) => (
<TrendingTopic <TrendingTopic
@@ -178,9 +178,11 @@ function VideoCards({
sourceInterstitial: 'explore', sourceInterstitial: 'explore',
}} }}
onInteract={() => { onInteract={() => {
logger.metric('videoCard:click', { logger.metric(
context: 'interstitial:explore', 'videoCard:click',
}) {context: 'interstitial:explore'},
{statsig: true},
)
}} }}
/> />
</View> </View>