Skip to content

Show Blaze Traffic card for coming-soon sites - #112463

Merged
chriskmnds merged 1 commit into
trunkfrom
fix/ads-1379-blaze-traffic-card
Jul 13, 2026
Merged

Show Blaze Traffic card for coming-soon sites#112463
chriskmnds merged 1 commit into
trunkfrom
fix/ads-1379-blaze-traffic-card

Conversation

@chriskmnds

@chriskmnds chriskmnds commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/a8c/issue/ADS-1379/jetpack-traffic-inconsistent-blaze-module

Proposed Changes

  • Show the Blaze promo card on the Traffic page when a site is coming soon, even when can_blaze is false.
  • Route the Traffic page Blaze CTA through Calypso's /advertising/{site} route when a site slug is available, so coming-soon sites land on the existing "Site is not published" Blaze gate instead of a generic wp-admin missing-page error.
  • Add focused tests for the Traffic page Blaze visibility and CTA URL helpers.

Why are these changes being made?

  • Coming-soon sites currently hide the Blaze card because WPCOM sets can_blaze: false for unlaunched sites, and the Traffic page used that campaign eligibility flag as the card visibility flag.
  • ADS-1379 asks us to keep Blaze discoverable for unlaunched sites and nudge users to launch before they can run campaigns.
  • Campaign setup remains gated by the existing Advertising route. The Traffic page only changes discoverability and the CTA destination.

Media

Before After
Production Traffic page for a coming-soon site. The Blaze card is hidden. Local branch Traffic page for the same coming-soon site. The Blaze card is visible.
Before After
CTA behavior
Clicking Get started opens the Calypso Advertising route and shows the existing Site is not published gate with launch guidance.
Launch gate

Testing Instructions

  • Automated checks run locally:
    • corepack yarn test-client client/sites/marketing/traffic --runInBand
    • corepack yarn eslint --ext .js,.jsx,.ts,.tsx,.mjs,.json client/sites/marketing/traffic/traffic.jsx client/sites/marketing/traffic/test/traffic.jsx
    • git diff --check
    • corepack yarn typecheck-client
  • Production before check:
    • Open /marketing/traffic/:site.
    • Confirm the coming-soon simple site Traffic page loads without the Blaze card.
  • Local after check:
    • Start Calypso locally with Node v24.15.0.
    • Open the local Calypso route /marketing/traffic/:site.
    • Confirm the Blaze card appears with the heading "Reach new readers and customers" and the "Get started" CTA.
    • Click "Get started".
    • Confirm it opens /advertising/:site, shows "Site is not published", includes the launch guidance, and does not show the generic wp-admin missing-page error.
  • Launched-site regression:
    • Open the local Calypso route /marketing/traffic/:site.
    • Confirm the Blaze card still appears.
    • Click "Get started".
    • Confirm it opens /advertising/:site and shows the Blaze Advertising dashboard with campaign content.
  • Browser console check:
    • No console errors observed on the production before page, the local coming-soon Traffic page, or the local coming-soon Advertising launch gate.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@chriskmnds chriskmnds self-assigned this Jul 9, 2026
@chriskmnds
chriskmnds marked this pull request as ready for review July 9, 2026 09:58
@chriskmnds
chriskmnds requested a review from Copilot July 9, 2026 09:58
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 9, 2026

Copilot AI left a comment

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.

Pull request overview

This PR updates the Marketing → Traffic settings page to keep the Blaze promo card discoverable for “coming soon” sites and ensures the CTA routes through Calypso’s Advertising flow (so users hit the existing “Site is not published” gate instead of a wp-admin missing-page error).

Changes:

  • Loosen Blaze card visibility so it can show for coming-soon sites even when can_blaze is false.
  • Route the Blaze CTA to /advertising/:site when a site slug is available, falling back to the wp-admin URL otherwise.
  • Add unit tests for the Blaze visibility and URL helper functions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
client/sites/marketing/traffic/traffic.jsx Adds Blaze visibility/URL helpers; uses site slug to route CTA through Calypso Advertising.
client/sites/marketing/traffic/test/traffic.jsx Adds focused tests for the new helper functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to +43
export const shouldShowBlazeAdvertisingOption = ( state, siteId ) => {
const site = getRawSite( state, siteId );

return isBlazeEnabled( state, siteId ) || Boolean( site?.is_coming_soon );
};
Comment on lines +21 to +39
describe( 'shouldShowBlazeAdvertisingOption', () => {
test( 'returns true when the site can use Blaze', () => {
const state = getState( { canBlaze: true } );

expect( shouldShowBlazeAdvertisingOption( state, siteId ) ).toBe( true );
} );

test( 'returns true when the site is coming soon', () => {
const state = getState( { canBlaze: false, isComingSoon: true } );

expect( shouldShowBlazeAdvertisingOption( state, siteId ) ).toBe( true );
} );

test( 'returns false when the site cannot use Blaze and is not coming soon', () => {
const state = getState( { canBlaze: false } );

expect( shouldShowBlazeAdvertisingOption( state, siteId ) ).toBe( false );
} );
} );
@matticbot

matticbot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~114 bytes added 📈 [gzipped])

Details
name       parsed_size           gzip_size
marketing       +522 B  (+0.1%)     +114 B  (+0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~73 bytes removed 📉 [gzipped])

Details
name                                                         parsed_size           gzip_size
async-load-calypso-my-sites-site-settings-seo-settings-form       -288 B  (-0.1%)      -73 B  (-0.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@chriskmnds
chriskmnds force-pushed the fix/ads-1379-blaze-traffic-card branch from c7aab1c to fd53392 Compare July 13, 2026 08:59
@chriskmnds
chriskmnds added this pull request to the merge queue Jul 13, 2026
Merged via the queue into trunk with commit 02173c6 Jul 13, 2026
12 checks passed
@chriskmnds
chriskmnds deleted the fix/ads-1379-blaze-traffic-card branch July 13, 2026 09:21
@github-actions github-actions Bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants