Premium Analytics: add UTM stats data hook - #49948
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
@claude review plz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3975e92 to
0195fc9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
This comment has been minimized.
This comment has been minimized.
Review-cycle summary —
|
Fixes #
Why
The Premium Analytics data package has Stats hooks for the split endpoint work, but the UTM surface was stranded in closed PR #49773 and was not included in #49780, #49781, or #49782. This adds the missing UTM query, hook, and normalizer so consumers can request campaign performance data through the same typed data package patterns as the other Stats reports.
Proposed changes
statsUtmQueryforstats/utm/{utmParam}with Calypso-aligned request params.useStatsUtmand public exports for the hook and response/item types.top_utm_valuesand optionaltop_postspayloads into the existing normalized Stats report shape.Verification
Focused tests, lint, typecheck, and whitespace checks passed locally.
Output
Related product discussion/links
Does this pull request change what data or activity we track or use?
No. This adds a typed client data hook/query/normalizer for an existing Stats endpoint and does not change what data is tracked or used.
Testing instructions
pnpm --dir projects/packages/premium-analytics test -- packages/data/src/processing/stats/__tests__/utm.test.ts packages/data/src/queries/__tests__/stats-queries.test.ts packages/data/src/hooks/__tests__/stats-exports.test.ts --runInBand.pnpm exec eslint --max-warnings=0 projects/packages/premium-analytics/packages/data/src/hooks/__tests__/stats-exports.test.ts projects/packages/premium-analytics/packages/data/src/hooks/index.ts projects/packages/premium-analytics/packages/data/src/hooks/use-stats-utm.ts projects/packages/premium-analytics/packages/data/src/index.ts projects/packages/premium-analytics/packages/data/src/processing/stats/__fixtures__/utm.ts projects/packages/premium-analytics/packages/data/src/processing/stats/__tests__/utm.test.ts projects/packages/premium-analytics/packages/data/src/processing/stats/index.ts projects/packages/premium-analytics/packages/data/src/processing/stats/types.ts projects/packages/premium-analytics/packages/data/src/processing/stats/utm.ts projects/packages/premium-analytics/packages/data/src/queries/__tests__/stats-queries.test.ts projects/packages/premium-analytics/packages/data/src/queries/index.ts projects/packages/premium-analytics/packages/data/src/queries/stats-query.ts projects/packages/premium-analytics/packages/data/src/queries/stats-utm-query.ts.pnpm --dir projects/packages/premium-analytics run typecheck.git diff --check.