feat(analytics): add Chat Blast: Message Viewed event#14534
Open
dylanjeffers wants to merge 1 commit into
Open
feat(analytics): add Chat Blast: Message Viewed event#14534dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
Fires an Amplitude "Chat Blast: Message Viewed" event the first time a user opens a blast DM thread (detected via chat.is_blast), once per blast per user. Adds the event on both web (ChatPage) and mobile (ChatScreen), deduping via localStorage / AsyncStorage keyed on the blast chat id. Properties: isNativeMobile, chatId, audience, audienceContentType, audienceContentId. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new Amplitude analytics event,
Chat Blast: Message Viewed, that fires when a user opens a DM thread that is a blast (chat.is_blast === true).Previously the only blast recipient-side event was
Chat Blast: CTA Clicked; there was no signal for a user actually opening the blast thread. This tracks opens.Behavior
chat_id, persisted inlocalStorage(web) /AsyncStorage(mobile).ChatPage) and mobile (ChatScreen), mirroring the existingtrack(make(...))pattern used byCHAT_BLAST_MESSAGE_SENT.Event properties
isNativeMobilefalseon web,trueon mobile (existing convention)chatIdchat_id(the recipient-side blast identifier; the clientChatBlasttype has no separateblast_id)audienceaudienceContentTypetrack/albumwhen scoped to contentaudienceContentIdOptionalHashId.parseto a numericID, matchingCHAT_BLAST_MESSAGE_SENTChanges
packages/common/src/models/Analytics.ts— addCHAT_BLAST_MESSAGE_VIEWEDto theNameenum, add theChatBlastMessageViewedtype, and register it in theAllTrackingEventsunion.packages/web/src/pages/chat-page/ChatPage.tsx—useEffectthat fires the event on opening a blast thread, deduped vialocalStorage.packages/mobile/src/screens/chat-screen/ChatScreen.tsx— same, deduped viaAsyncStorage.packages/mobile/src/constants/storage-keys.ts— newVIEWED_BLAST_CHATS_KEY.Testing
tsctypecheck passes forcommon,web, andmobile.eslintclean on all changed files.🤖 Generated with Claude Code