Fixed gift-link usage count wiring and display#29004
Open
jonatansberg wants to merge 1 commit into
Open
Conversation
ref https://linear.app/ghost/issue/BER-3746/integrate-gift-link-usage-tracking-with-analytics - the usage hook matched rows on `gift` but the Tinybird pipe returns `gift_link`, so the lookup never found its row and the count was always zero; matched on `gift_link` and added a unit test pinning the pipe->hook column contract, since the Tinybird response is untyped and a rename can't be caught by the compiler - gated the hook on web_analytics_enabled and hid the whole gift-link card when web analytics is off, since the count is web-analytics-derived and meaningless without it - surfaced `loading`/`error` from the hook so the card hides the count while loading or on error instead of rendering a misleading "0"; a resolved zero (no link yet, or a link with no visits) is a valid count and still shows
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 1s | View ↗ |
nx run-many -t test:unit -p @tryghost/posts,@tr... |
✅ Succeeded | 2m 52s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 1m 48s | View ↗ |
nx run-many -t lint -p @tryghost/posts,@tryghos... |
✅ Succeeded | 19s | View ↗ |
nx run ghost:build:assets |
✅ Succeeded | 2s | View ↗ |
nx run ghost:build:tsc |
✅ Succeeded | 7s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-30 15:41:54 UTC
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.

ref https://linear.app/ghost/issue/BER-3746/integrate-gift-link-usage-tracking-with-analytics
Fixes the gift-link usage count surface in post analytics, found during end-to-end integration of the gift-link analytics stack. These are corrections to code merged in #28897.
What
gift, but the pipe returnsgift_link(renamed in Added gift dimension to the web analytics data files #28854), so the lookup never found its row and the count was always0. Now matches ongift_link.data as unknown as …), so a dimension rename can't be caught by the compiler — the test is the guard.web_analytics_enabledand the whole gift-link card is hidden when web analytics is off.loading/errorso the card hides the count while loading or on error instead of rendering a misleading0. A resolved zero (no link yet, or a link with no visits) is a valid count and still shows.Dependency
Depends on #28854 (datafiles) for the
gift_linkcolumn and theapi_gift_link_visits_v2pipe — merge after that lands.