Skip to content

feat: track announcement bar clicks with their source and page - #3468

Open
juanmahidalgo wants to merge 1 commit into
masterfrom
feat/shop-announcement-bar-tracking
Open

feat: track announcement bar clicks with their source and page#3468
juanmahidalgo wants to merge 1 commit into
masterfrom
feat/shop-announcement-bar-tracking

Conversation

@juanmahidalgo

Copy link
Copy Markdown
Contributor

Follow-up to #3467. Same change as decentraland/marketplace#2684, minus the layout part, which was already handled here.

Changes

Makes the click measurable. The events fired with no properties, and the Marketplace fires the same event names, so clicks from the two apps were indistinguishable in Segment. Both events now carry source and the path they happened on.

Tags the call to action with campaign params. utm_source / utm_medium / utm_campaign are appended to the shop URL. The click event alone stops at the click — the params are what let the shop attribute what these visitors do after they land, which is the actual question behind "is the bar working". They are also needed because the link carries rel="noreferrer", so no referrer reaches the shop.

Test plan

  • Check on the preview that the call to action lands on the shop with the campaign params attached
  • Confirm both events show up in Segment with source: builder

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
builder Ready Ready Preview Aug 18, 2026 4:56pm

Request Review

@decentraland-bot decentraland-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Verdict: Approve

Clean, focused change that adds analytics tracking properties (source, path) to announcement bar events and appends UTM campaign parameters to the shop URL. The implementation is correct and mirrors the marketplace counterpart (#2684) exactly.

What was checked

Area Result
Correctness useMemo with [] is correct — all inputs are static module-level constants. useCallback deps correctly include pathname.
Security ✅ No vulnerabilities. UTM values are hardcoded constants, pathname is router-controlled (not raw user input), no secrets or injection vectors.
React patterns ✅ Proper use of useMemo, useCallback, optional chaining on getAnalytics()?.track().
Cross-app consistency ✅ Event property shape ({ source, path }) and UTM params (utm_source, utm_medium=announcement_bar, utm_campaign=shop_launch) match the marketplace implementation.
Consumer impact ✅ No public API surface changes — purely internal UI/analytics.
Git conventions ✅ Title follows feat: ... format, branch follows feat/... convention.

Observations (P2 — non-blocking)

[P2] No test coverage for this component. The marketplace's AnnouncementBar has a spec file that was updated alongside these same changes, but the builder's component has no tests. This is a pre-existing gap — not introduced by this PR — but it would be a good opportunity to add basic tests (event properties, UTM params in the href) similar to the marketplace's AnnouncementBar.spec.tsx.

No P0 or P1 findings — safe to merge.


Reviewed by Jarvis 🤖 · Requested by juanmahidalgo via GitHub

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 32162690324

Coverage remained the same at 52.979%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 13019
Covered Lines: 7516
Line Coverage: 57.73%
Relevant Branches: 5781
Covered Branches: 2444
Branch Coverage: 42.28%
Branches in Coverage %: Yes
Coverage Strength: 35.52 hits per line

💛 - Coveralls

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.

3 participants