Skip to content

feat(analytics): report the two conversion CTAs that live in shared-uis - #84

Merged
rahul-sinha1908 merged 1 commit into
devfrom
feature/funnel-analytics-events
Oct 28, 2026
Merged

rahul-sinha1908 merged 1 commit into
devfrom
feature/funnel-analytics-events

Conversation

@rahul-sinha1908

Copy link
Copy Markdown
Contributor

Part 3 of 5. Depends on idivarts/shared-constants#11 for both event types — merge that first.

What

Two CTAs in this submodule sit on the monetisation intent ladder and reported nothing:

File CTA Event
components/GlobalErrorFallback.tsx Contact Support support_contact_clicked { channel: "email", intent: "error" }
components/ProfileModal/Profile-Modal.tsx "Upgrade now" upgrade_cta_clicked { source: "profile_modal" }

Two decisions

The crash CTA uses intent: "error", not "upgrade". It belongs on the same event so every support reach-out is countable in one place, and on a distinct intent so it can never inflate the conversion funnel. That is the whole reason intent exists as a field rather than being assumed from the source.

ProfileModal fires upgrade_cta_clicked directly rather than going through the goToBilling() helper that every CTA in trendly-brands now uses — shared-uis cannot import from the host app. The typed UpgradeSource union is what keeps the two in step; a new source is a compile error on both sides rather than a convention someone has to remember.

Note for trendly-users

track() is a no-op until a sink is registered, so this is inert in any host that has not wired analytics. But this is the first analytics call in shared-uis, so bumping its pointer in trendly-users will require shared-constants to be bumped there too, or the typecheck will fail on the unknown event names.

🤖 Generated with Claude Code

Both sit on the monetisation intent ladder and reported nothing:

- GlobalErrorFallback's Contact Support. Fired with intent "error", not
  "upgrade", so a crash-driven support reach-out is countable in the same
  place as the rest without inflating conversion intent.
- ProfileModal's "Upgrade now". shared-uis cannot reach the host app's
  goToBilling() helper, so it fires upgrade_cta_clicked directly; the
  UpgradeSource union is what keeps the two in step rather than convention.

Depends on idivarts/shared-constants#11 for both event types.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant