feat(insights): epic branch for all Insights features#315
Draft
dkoo wants to merge 220 commits into
Draft
Conversation
…cribers feat(insights): subscribers tab (NPPD-1616)
feat(insights): gates tab phase 1 (NPPD-1604)
…igence-ga4-client-into-newspack-plugin feat(insights): extract GA4 Data API client (NPPD-1647)
…ment-metric-orchestrators-with-ga4-dispatch feat(insights): audience + engagement metric orchestrators (NPPD-1648)
…ce-and-engagement-ui-implementation feat(insights): audience and engagement UI with fixture mode (NPPD-1649)
…y-and-review-fixes fix(insights): re-land orphaned wizard-chrome a11y + review fixes (NPPD-1602)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* feat(insights): add BigQuery proxy client and Gates_Metric injection seam * fix(insights): normalize proxy client dates to UTC and modernize JSON validation * feat(insights): wire Section 1 scorecards to BigQuery proxy * fix(insights): reject non-integer values for count metrics in proxy helper * feat(insights): wire Section 2 regwall conversion to BigQuery proxy * feat(insights): add Woo_Order_Resolver for paywall completion joins * chore(insights): harden Woo_Order_Resolver tests and docs * feat(insights): wire Section 3 paywall conversion + revenue * perf(insights): memoize paywall-direct join to avoid duplicate proxy calls * feat(insights): wire Section 4 funnel and exposures distribution * feat(insights): wire Section 5 performance-by-gate with title enrichment * feat(insights): compute tab_pending from metric outcomes * docs(insights): clarify is_window_all_pending semantics for unrecognized payloads * feat(insights): log BigQuery proxy failures via newspack_log action
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 1 UI scaffold for the Insights Prompts tab: seven sections, tab-local viz (funnel, distribution, three sortable performance tables), REST endpoint, and an orchestrator returning pending:true placeholders. Mirrors the Tab 4 (Gates) Phase 1 pattern; Phase 2 swaps the orchestrator stubs to BigQuery dispatch without touching the UI or method signatures. Part of NPPD-1607. Phase 2 (BigQuery wiring): NPPD-1682. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Port the applicable Tab 4 (Gates) optimizations from #267 to the Prompts tab: the SVG trapezoid conversion funnel (responsive side/compact layouts, clamped drop-off, contrast-aware in-band counts, '% of {top stage}' + 'drop-off' labels), and the shared __table-num / __table-na chrome so numeric cells right-align (the #267 specificity fix) and non-applicable cells render a muted em-dash. The state-model / error-empty-populated changes from #267 are Phase 2 (NPPD-1682) and are intentionally not adopted here. Part of NPPD-1607. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Performance by prompt table now renders only the top 10 rows (by the active sort) with a 'See more (N)' / 'See less' toggle that reveals the rest, instead of a flat 50-row list. Implemented as an optional initialRowLimit on the tab-local SortableTable primitive, so the intent and placement tables are unaffected. No orchestrator change — the backend still caps at 50; the UI collapses to 10. Part of NPPD-1607. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the donation_attempts / subscription_attempts columns on the Performance by prompt table with four conversion columns — donation_conversions, donation_conversion_rate, subscription_conversions, subscription_conversion_rate — so the per-prompt breakdown reports Woo-completed outcomes rather than engagement intent. Aligns with the Gates v1.1 decision (NPPD-1684); locks the final column set before Phase 2 (NPPD-1682) wires the BigQuery + Woo join. Phase 1 values remain placeholder zeros. Also brings the Tab 5 spec into the monorepo docs (specs/prompts.md) and updates the spec + formula docs to describe the conversion columns and resolve open question #2. Part of NPPD-1607. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tion core) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…al-registered-users-on-the-audience-tab feat(insights): registered readers on the Audience tab (NPPD-1733)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(insights): add timestamp-window Source_Matcher (Woo-join remediation core) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(insights): deterministic Source_Matcher + align test conventions Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d-ts-test-files-not-collected-by-npm-test test(insights): rename format.test.js back to .ts (NPPD-1683)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ability-gate fix(insights): gate Donors tab on donation activity in last 365 days
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pine feat(insights): tier-1 publisher feedback spine (NPPD-1728)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ayers feat(insights): tier-2 feedback modal (NPPD-1728)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-pdf-tweaks fix(insights): prompt cards full width, landscape PDF, relabel export
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rder-dates feat(insights): first-conversion-date storage helpers for Tab 3
Mirror the Paid empty-state pattern (NPPD-1694) for the Gates Free (regwall) section. Detection distinguishes three cases, not two: hub count fields absent (graceful degradation to today's percentages), present-but-zero impressions (no_opportunity), and zero registrations (no_conversions). An absent field is not a zero. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code-review follow-up: the fields-absent envelope guard hand-built the Influenced operand instead of calling get_regwall_conversion_influenced_7d, so its "end-to-end through the public method" claim overstated coverage. Drive both regwall methods from a per-query mock so the Influenced rate_key and null-count path are genuinely exercised. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ymetricsection-pattern-to-gates-free feat(insights): Gates Free section empty states (NPPD-1702)
…PPD-1742) Apply the empty-state pattern to the Conversion Journeys subscription and donation legs. A per-leg visibility gate hides a conversion endpoint when the publisher doesn't run that reader-revenue stream (config matrix); configured- but-quiet legs get funnel-shaped no_opportunity / no_conversions treatments. The registration leg is left as-is (NPPD-1743). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…PPD-1742) Code-review follow-up: the subscription/donation no_conversions note fired on conversion===0 alone, so a leg with registered readers but zero prior-stage base (e.g. no prompt shown) rendered "{0} saw a prompt, but none converted" next to a funnel showing readers entering — self-contradicting, and counter to the ticket's "prior stage HAS a base" definition. Guard on priorStage > 0; that case now falls through to the normal funnel. Adds an edge-case test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…D-1742) PHPCS (workspace-root standard, stricter than the plugin lint) flagged the $donation_leg_configured property's @var-only docblock as missing a short description. Add one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-journeys-empty-states-config-matrix feat(insights): Conversion Journeys config matrix + leg empty states (NPPD-1742)
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.
All Submissions:
Changes proposed in this Pull Request:
Epic branch for all Newspack Insights features. This is so we can quickly create and merge PRs for Insights without going through our usual human code review process, while also not affecting production code on
main. This branch will be kept up-to-date withmainso it remains in a state where it can be cleanly merged once we've performed enough QA to consider Insights production-ready.Companion PR to https://github.com/Automattic/newspack-manager-admin/pull/462. Both branches are required for Insights to work end-to-end.
How to test the changes in this Pull Request:
TK.
Other information: