Skip to content

Premium Analytics: align the Ads tab with the design - #52714

Merged
dognose24 merged 3 commits into
trunkfrom
update/premium-analytics-ads-tab-design
Sep 24, 2026
Merged

dognose24 merged 3 commits into
trunkfrom
update/premium-analytics-ads-tab-design

Conversation

@dognose24

@dognose24 dognose24 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes WOOA7S-2160

Proposed changes

The remaining differences between the Ads tab and Eder's design, after the status badges (#52565) and the adjustments badge (#52526) landed. Each one is small; together they finish the card.

Tab title. The Ads section registered no title, so its heading fell back to the tab label, Ads. It is now Ads performance, as in the design, set by both registrants of the section since #52455: the WordAds module for the Jetpack plugin path and jetpack-mu-wpcom for WordPress.com. The other tabs already carry a title this way (Site traffic, Site insights).

Widget tips, reworded to the design copy:

Widget Tip
WordAds earnings What each billing month earned from programmatic ads, and whether it has been paid. Whole months only, so the month in progress isn't listed.
All-time balance What your ads have earned since you started, what has been paid out, and what is still owed. Lifetime totals — these don't follow the date selection. Payments go out once the outstanding amount reaches $100.
Ads summary Impressions, average CPM, and the revenue they earned over the selected period. Learn more → wordpress.com/support/wordads-and-earn/

The design's balance tip has no payout threshold; the last sentence keeps it, because classic Stats states it in its Totals tip and it is the one thing a publisher checks when a payment has not arrived.

Earnings report. Period is the view's titleField, so DataViews draws it as the row's title: bold, in the content colour rather than the table's weak grey, as in the design. ReportRecordsTable seeded every field into view.fields, which would draw a title field twice; it now leaves the primary fields out of that list, with a test. The Ads Served note above the table is gone: no other report carries a note, the design has none, and the support link on the Ads summary tip now explains the figure. The report keeps its Earnings history name (the design's "WordAds earnings" predates the Sponsored and Adjustments tabs) and its August 2026 period format, which every report shares; both are noted on the card.

Not here: the Metrics dropdown on All-time balance, removed in #52700.

Before After
Ads tab before-ads-tab after-ads-tab
Ads summary tip before-tip-summary after-tip-summary
All-time balance tip before-tip-balance after-tip-balance
WordAds earnings tip before-tip-earnings after-tip-earnings
Earnings report before-report after-report

Local Docker site with mocked WordAds data. The before shots predate #52700, so the Metrics dropdown still shows there.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

On a site with WordAds, or the local Docker site with the zz-tmp-pa-wordads-mock.php mu-plugin:

  • Open Stats → Ads. The page heading reads Ads performance.
  • Open each widget's ⓘ. The three tips read as in the table above; the Ads summary tip has a Learn more link to the WordAds support page.
  • Open the Earnings history report. The Period column is bold and dark (the dataviews-title-field styling); there is no note above the table.
  • jp test js packages/premium-analytics, jp test php packages/jetpack-mu-wpcom, and jp docker phpunit jetpack -- --filter WordAds_Premium_Analytics_Test pass.

🤖 Generated with Claude Code

Title the tab "Ads performance" from both registrants of the section,
the WordAds module and jetpack-mu-wpcom, as the other tabs carry a title.

Reword the three WordAds widget tips to the design copy: the earnings
list explains whole billing months, the balance explains lifetime
totals and the $100 payout threshold, and the summary links to the
WordAds support page.

On the Earnings report, the Period column is bold as the row's label,
and the Ads Served note above the table is gone: no other report has
one, and the support link now explains the figure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dognose24
dognose24 requested a review from a team as a code owner September 23, 2026 15:10
@dognose24 dognose24 added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Sep 23, 2026
@dognose24 dognose24 self-assigned this Sep 23, 2026
@dognose24 dognose24 added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Sep 23, 2026
@dognose24

Copy link
Copy Markdown
Contributor Author

@chihsuan the Ads tab design alignment from WOOA7S-2160: tab title, the three widget tips, and the Earnings report table. Screenshots to follow.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/premium-analytics-ads-tab-design branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/premium-analytics-ads-tab-design
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/premium-analytics-ads-tab-design

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 4 files.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/premium-analytics/wordads-section.php 26/27 (96.30%) 0.14% 0 💚
projects/packages/premium-analytics/packages/widgets-toolkit/src/components/report-page/report-records-table.tsx 13/13 (100.00%) 0.00% 0 💚
projects/packages/premium-analytics/routes/reports/earnings/config/tabs.ts 13/13 (100.00%) 0.00% 0 💚
projects/plugins/jetpack/modules/wordads/php/class-wordads-premium-analytics.php 23/27 (85.19%) 0.57% 0 💚

Full summary · PHP report · JS report

/>
) : (
<>
{ showAdsServed && (

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.

Why do you remove this flag?

btw, having hasAdsServed looks excessive to me

/**
 * Whether a tab's rows carry an Ads Served count.
 *
 * Only the WordAds bucket records pageviews; sponsored and adjustment rows are
 * amounts alone.
 *
 * @param tab - The active Earnings report tab.
 * @return Whether to show the Ads Served column and its note.
 */
export function hasAdsServed( tab: EarningsReportTabId ): boolean {
	return tab === 'wordads';
}

You could define the const...

const showAdsServed = tab === 'wordads';

Even more, I'd suggest not creating a const and simply using the tab === 'wordads'.

@dognose24 dognose24 Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The flag is still there: it gates the Ads Served column and the CSV column a few lines up. What went was the note it also guarded, since the design has none and no other report carries one; the Ads summary tip's Learn more link now explains the figure. As it stands after 26ce42a:

const showAdsServed = tab === 'wordads';

const fields = useMemo( () => {
	const all = getWordAdsHistoryFields();
	return showAdsServed ? all : all.filter( field => field.id !== 'pageviews' );
}, [ showAdsServed ] );

const csvColumns = useMemo( () => [
	/* Period, Earnings */
	...( showAdsServed ? [ { label: __( 'Ads Served' ), getValue: row => row.pageviews } ] : [] ),
	/* Status */
], [ showAdsServed ] );

Agreed on the helper, done in 26ce42a: it is now const showAdsServed = tab === 'wordads' in the page, and hasAdsServed is gone from the config, its test and the CSV test's mock. Kept the const because two useMemo deps read it.

The design draws the period as the row's title: bold, in the content
colour. A <strong> only got the weight; the table's cells stay in the
weak colour. DataViews' titleField gives both, so the view names it and
the field renders plain text again.

ReportRecordsTable seeded every field into view.fields, which drew a
title field twice. It now leaves the primary fields out of that list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A one-line helper for `tab === 'wordads'` was more indirection than the
check deserved. The page reads it inline; the helper, its test and the
CSV test's mock of it are gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @dognose24 Looks good and tested well.

Just a thought: I think we should check with @ederrengifo to confirm whether we really want to use the badge as a link in the widget footer. To me, the badge doesn’t look obviously clickable and I believe we're not using similar pattern in other places.

Image

@dognose24

Copy link
Copy Markdown
Contributor Author

Thanks! Agreed on the badge, and that question is already parked as WOOA7S-2194 with the alternatives I tried (plain link plus a count badge, and LinkButton); it goes to Eder and retrofox as a design call rather than in this PR.

@dognose24
dognose24 merged commit 34ef568 into trunk Sep 24, 2026
81 checks passed
@dognose24
dognose24 deleted the update/premium-analytics-ads-tab-design branch September 24, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Ad [mu wpcom Feature] Premium Analytics [Package] Jetpack mu wpcom WordPress.com Features [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Plugin] Wpcomsh [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants