feat(analytics): stop client double-counting of server-side events (master)#2114
Merged
Merged
Conversation
…r-side Promotes the client-side analytics changes from qa (PR #2113) to master via cherry-pick. These five events are now emitted server-side via the backend Amplitude Node SDK, so the matching client completion events opt out of Amplitude (Firebase + GTM still fire, preserving web conversion attribution): - Account Created: SIGNUP_COMPLETED (signup/creating). - Savings Deposit: DEPOSIT_COMPLETED in the 5 backend-routed deposit hooks (EOA USDC/Fuse/ETH, Solid USDC/ETH). Client-only deposits (useDeposit, useDepositFromSolidFuse) and the add-funds-to-wallet step (useTransferToWallet) keep firing Amplitude — the backend does not track those paths. - Card Deposit: CARD_DEPOSIT_COMPLETED (useCardDepositPoller fallback). - Card Borrow: BRIDGE_TO_ARBITRUM_COMPLETED in useBorrowAndDepositToCard only. Done via a per-call `amplitude` option added to track(). trackIdentity calls are kept. Conflict in useBorrowAndDepositToCard.ts was resolved by keeping master's newer payload (transaction_result + fee field) and layering the Amplitude opt-out on top. https://claude.ai/code/session_011g7dN8ScZ3Yr4U6fhYEsq5
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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.
Promotes the client analytics changes from
qa(#2113) tomastervia cherry-pick.What this does
These five events are now emitted server-side via the backend Amplitude Node SDK (solid-backend #1504). To avoid double-counting in Amplitude, the matching client completion events opt out of Amplitude — Firebase + GTM still fire, so web conversion / ad attribution is preserved. This is done via a new per-call
amplitudeoption ontrack().SIGNUP_COMPLETED(app/signup/creating.tsx)DEPOSIT_COMPLETEDin the 5 backend-routed deposit hooks (EOA USDC/Fuse/ETH, Solid USDC/ETH)CARD_DEPOSIT_COMPLETED(useCardDepositPoller)BRIDGE_TO_ARBITRUM_COMPLETEDinuseBorrowAndDepositToCardonlyIntentionally left firing Amplitude (no backend equivalent, would otherwise lose data):
useDepositanduseDepositFromSolidFuse— client-only deposits (no backendcreateDepositcall).useTransferToWallet— the add-funds-to-wallet step (step 1), which the backend does not track.useBridgeToCard/useSwapAndBridgeToCard— generic bridge/swap-to-card (not borrows; createBRIDGE_DEPOSIT, which the borrow cron does not track).trackIdentitycalls are kept (they set the Amplitude user id / properties).Notes
mastertogether (promoting only one would cause double-counting or data loss in production).useBorrowAndDepositToCard.tscherry-pick conflict was resolved by keeping master's newer payload (transaction_result+feefield) and layering the Amplitude opt-out on top.tscclean for all changed files; ESLint + Prettier clean.https://claude.ai/code/session_011g7dN8ScZ3Yr4U6fhYEsq5
Generated by Claude Code