Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
188f09b6 Added gift_link dimension to the web analytics data files
ref https://linear.app/ghost/issue/BER-3746/integrate-gift-link-usage-tracking-with-analytics
- gift-link usage is moving onto the existing analytics pipeline; this is the Tinybird side
- _mv_hits gains a `gift_link` column (the gift-link token, extracted from the page_hit payload, kept in step with the materialised output ordering)
- a `gift_link` segment is threaded through filtered_sessions_v2 and the v2 endpoints that filter _mv_hits directly, mirroring the existing post_uuid plumbing: omit it for all traffic, `gift_link=true` (or any truthy value) for gift-only, `gift_link=false`/`0` to exclude gift traffic
- in api_kpis_v2, route gift-segmented queries through the hit-level pathname_pageviews node (defined(gift_link)) so gift pageviews count gift-link hits, not every pageview in a session that used a gift link
- _mv_daily_pages (the daily rollup behind api_top_pages_v3) also gains `gift_link` as a dimension, so the segment works on the top-pages historical path instead of erroring on a missing column; non-gift queries merge across the gift_link split via uniqExactMerge and are unchanged
- new api_gift_link_visits endpoint groups by gift_link for per-link visits / views / last_seen, registered in the tinybird-service JWT scope allowlist (TINYBIRD_PIPES) so authenticated Ghost calls to it are permitted
- depends on the proxy passing gift_link through to Tinybird (separate PR); until then the column is empty and the segment matches nothing
- endpoint tests: tag gift-link rows in fixtures/analytics_events.ndjson and add include (`gift_link=true`) and exclude (`gift_link=false`) cases to api_kpis_v2 / api_top_pages_v3 / api_top_locations_v2 / api_active_visitors_v2, plus a new tests/api_gift_link_visits.yaml. The kpis include case asserts gift pageviews count gift-link hits (2), not every pageview in a session that used a gift link (3) 1fbc554e Added gift_link dimension to the web analytics data files
ref https://linear.app/ghost/issue/BER-3746/integrate-gift-link-usage-tracking-with-analytics
- gift-link usage is moving onto the existing analytics pipeline; this is the Tinybird side
- _mv_hits gains a `gift_link` column (the gift-link token, extracted from the page_hit payload, kept in step with the materialised output ordering)
- a `gift_link` boolean segment is threaded through filtered_sessions_v2 and the v2 endpoints that filter _mv_hits directly, mirroring the existing post_uuid plumbing, so gift traffic can be filtered in the normal reports
- in api_kpis_v2, route gift-only queries through the hit-level pathname_pageviews node (defined(gift_link)) so gift pageviews count gift-link hits, not every pageview in a session that used a gift link
- _mv_daily_pages (the daily rollup behind api_top_pages_v3) also gains `gift_link` as a dimension, so the segment works on the top-pages historical path instead of erroring on a missing column; non-gift queries merge across the gift_link split via uniqExactMerge and are unchanged
- new api_gift_link_visits endpoint groups by gift_link for per-link visits / views / last_seen, registered in the tinybird-service JWT scope allowlist (TINYBIRD_PIPES) so authenticated Ghost calls to it are permitted
- depends on the proxy passing gift_link through to Tinybird (separate PR); until then the column is empty and the segment matches nothing
- endpoint tests: tag gift-link rows in fixtures/analytics_events.ndjson and add a gift_link-filter case to api_kpis_v2 / api_top_pages_v3 / api_top_locations_v2 / api_active_visitors_v2, plus a new tests/api_gift_link_visits.yaml. The kpis case asserts gift pageviews count gift-link hits (2), not every pageview in a session that used a gift link (3)