Fire the post:view client event in more places, anywhere a post can be seen (#9467)
* Fire the post:view client event in more places * Fix bad import --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -492,7 +492,8 @@ let VideoItem = ({
|
||||
}): React.ReactNode => {
|
||||
const postShadow = usePostShadow(post)
|
||||
const {width, height} = useSafeAreaFrame()
|
||||
const {sendInteraction} = useFeedFeedbackContext()
|
||||
const {sendInteraction, feedDescriptor} = useFeedFeedbackContext()
|
||||
const hasTrackedView = useRef(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (active) {
|
||||
@@ -502,8 +503,31 @@ let VideoItem = ({
|
||||
feedContext,
|
||||
reqId,
|
||||
})
|
||||
|
||||
// Track post:view event
|
||||
if (!hasTrackedView.current) {
|
||||
hasTrackedView.current = true
|
||||
logger.metric(
|
||||
'post:view',
|
||||
{
|
||||
uri: post.uri,
|
||||
authorDid: post.author.did,
|
||||
logContext: 'ImmersiveVideo',
|
||||
feedDescriptor,
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
}
|
||||
}
|
||||
}, [active, post.uri, feedContext, reqId, sendInteraction])
|
||||
}, [
|
||||
active,
|
||||
post.uri,
|
||||
post.author.did,
|
||||
feedContext,
|
||||
reqId,
|
||||
sendInteraction,
|
||||
feedDescriptor,
|
||||
])
|
||||
|
||||
// TODO: high-performance android phones should also
|
||||
// be capable of rendering 3 video players, but currently
|
||||
|
||||
Reference in New Issue
Block a user