Skip to content

Suppress client Amplitude for server-side emitted events#2113

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/clever-gates-lWgca
Jun 2, 2026
Merged

Suppress client Amplitude for server-side emitted events#2113
MusabShakeel576 merged 1 commit into
qafrom
claude/clever-gates-lWgca

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

This PR prevents double-counting of analytics events by suppressing client-side Amplitude tracking for events that are now emitted server-side by the backend. Firebase and GTM continue to fire to preserve web conversion and ad attribution.

Key Changes

  • Added TrackOptions type to lib/analytics.ts with an amplitude boolean flag (defaults to true)
  • Updated the track() function to accept an optional options parameter and conditionally call trackAmplitudeEvent() based on the amplitude flag
  • Suppressed client Amplitude ({ amplitude: false }) for the following events that are now emitted server-side:
    • Deposit events: DEPOSIT_COMPLETED in useDepositFromEOAEth.ts, useDepositFromEOAFuse.ts, useDepositFromEOA.ts, useDepositFromSolidUsdc.ts, and useDepositFromSolidEth.ts
    • Signup event: SIGNUP_COMPLETED in app/signup/creating.tsx
    • Card/borrow events: BRIDGE_TO_ARBITRUM_COMPLETED in useBorrowAndDepositToCard.ts and CARD_DEPOSIT_COMPLETED in useCardDepositPoller.ts
  • Added explanatory comments to each suppressed event indicating which server-side event it corresponds to and confirming that Firebase + GTM still fire

Implementation Details

  • Firebase and GTM event tracking remain unaffected and continue to fire for all events, ensuring web conversion attribution is preserved
  • The change is backward compatible—existing calls to track() without the options parameter continue to send to Amplitude by default
  • Each modified call includes a comment explaining why Amplitude is suppressed and which backend event handles the server-side tracking

https://claude.ai/code/session_011g7dN8ScZ3Yr4U6fhYEsq5

…r-side

These five events are now emitted server-side via the backend Amplitude
Node SDK. Add a per-call `amplitude` option to track() and set it to
false at the matching client call sites so Amplitude no longer
double-counts them. Firebase + GTM still fire, so web conversion / ad
attribution is preserved.

- 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 (the generic bridge/swap-to-card hooks are not borrows and keep
  firing Amplitude).

trackIdentity calls are kept (they set the Amplitude user id/properties).

https://claude.ai/code/session_011g7dN8ScZ3Yr4U6fhYEsq5
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored Jun 2, 2026 5:14pm
solid-app-staging Ignored Ignored Jun 2, 2026 5:14pm

Request Review

@MusabShakeel576 MusabShakeel576 merged commit 5a75f5f into qa Jun 2, 2026
4 of 5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/clever-gates-lWgca branch June 2, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants