Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! |
Code Coverage SummaryCoverage changed in 2 files.
4 files are newly checked for coverage.
|
…e Traffic widgets STATS-646 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…aws it Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… card Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e signup page's own parameters Name the product "Parse.ly" wherever a reader sees it. The first close hides the card for 90 days and the second for good; the dismiss event says which. The signup link now sends the site title as `publisher_name` and the host as `site_domain`, the parameters the page reads. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
415e08d to
6b2a7c1
Compare
|
Non-blocking notes on how this will port to the promo slot API in STATS-657, which lets another package register a card into the dashboard rather than Premium Analytics carrying the card itself. The dismissal model here needs no changes at all. One request, and it is worth doing on its own merits rather than for the port: build the signup URL in PHP instead of at render time. Two things the port deletes, mentioned so they are not a surprise rather than as change requests. The larger part is structural. This card is richer than a title, a description and a button, so under the slot API it registers a render module and the component moves to the promoting package, which is the dependency inversion STATS-657 exists for. The frame then owns |
The dashboard ships the finished URL in its script data, with the site title as `publisher_name` and the host as `site_domain`, so the card's link is right on first paint and the client reads no site record for it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks, the port notes are clear. Taken the one request in the latest commit: Good to hear the dismissal model carried over as is. On the port deleting |
chihsuan
left a comment
There was a problem hiding this comment.
Nice work on the two-step snooze! @dognose24 I tested it on a qualifying site and the snooze and final close work nicely. A few inline notes below.
| enabled={ | ||
| ! editMode && ! isSectionLocked && section.slug === 'traffic' | ||
| } |
There was a problem hiding this comment.
Should we also wait for onboarding.phase === 'closed' here, like FeedbackBanner above? On a first visit the card mounts under the welcome modal, so parsely_upgrade_view fires before the reader can see it. The STATS-657 frame may want the same gate.
| enabled={ | |
| ! editMode && ! isSectionLocked && section.slug === 'traffic' | |
| } | |
| enabled={ | |
| ! editMode && | |
| ! isSectionLocked && | |
| section.slug === 'traffic' && | |
| onboarding.phase === 'closed' | |
| } |
| $args = array_filter( | ||
| array( | ||
| 'utm_source' => 'jetpack', | ||
| 'publisher_name' => get_bloginfo( 'name' ), |
There was a problem hiding this comment.
Could we decode the site title here? WordPress stores blogname HTML-escaped, so a site named Tom & Jerry's News sends publisher_name=Tom & Jerry's News to the signup page.
| 'publisher_name' => get_bloginfo( 'name' ), | |
| 'publisher_name' => wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), |
| trackEvent( 'jetpack_premium_analytics_parsely_upgrade_view', { source: TRACKS_SOURCE } ); | ||
| }, [ isVisible, trackEvent ] ); | ||
|
|
||
| const dismiss = useCallback( () => { |
There was a problem hiding this comment.
Heads-up rather than a change request: after closing the card, focus falls back to <body>, so a keyboard user starts over from the top. FeedbackBanner does the same, so maybe a shared follow-up?
| { features.map( feature => ( | ||
| <Text | ||
| key={ feature } | ||
| render={ <li /> } | ||
| variant="body-sm" | ||
| className={ styles.feature } |
There was a problem hiding this comment.
nit: Would it be worth using Badge for these pills instead of the custom .feature style? It's already in externals and would drop the hard-coded 9999px and 2px. It uses an 8px radius and the info color, though, so this may be a design call.
<li key={ feature }>
<Badge intent="informational">{ feature }</Badge>
</li>|
We've been asked to hold this for now, so I'm not sure it makes sense to merge this, given long term it will use the promo slot API. |
Part of STATS-646
Proposed changes
{ count, at }.https://dash.parsely.com/self-servewithutm_source=jetpack, the site title aspublisher_nameand the site's host assite_domain, the parameters the signup page reads. The server builds that URL (parsely_signup_url(), fromget_bloginfo( 'name' )andhome_url()) and ships it in the script data aspremium_analytics.parsely_signup_url, so the link is right on first paint and the client reads no site record for it.premium_analytics.offers_parsely_promptsand the signup URL in the script data. That value comes from Premium Analytics: Decide which sites and users see the Upgrade to Parse.ly prompts #55232 (STATS-645), which is still open, so on trunk this PR shows nothing yet.Screenshots
Open points
jetpack-script-data.d.tsdeclares the sameoffers_parsely_promptsfield as Premium Analytics: Decide which sites and users see the Upgrade to Parse.ly prompts #55232, and both PRs add arequire_onceblock toload_dashboard_components(), so whichever merges second needs a trivial conflict resolution.Related product discussion/links
Does this pull request change what data or activity we track or use?
Yes. It adds three Tracks events, each with
source: traffic_card:jetpack_premium_analytics_parsely_upgrade_view: the card was shown, recorded once per page load.jetpack_premium_analytics_parsely_upgrade_click: the reader clicked "Upgrade to Parse.ly".jetpack_premium_analytics_parsely_upgrade_dismiss: the reader closed the card, withdismissal: snoozethe first time anddismissal: finalthe second.The signup link passes the site title and host to the Parse.ly signup page as query parameters.
Testing instructions
jp build packages/premium-analyticspublisher_nameset to the site title andsite_domainto the site's host.count: 2. Unset the key the same way to start over.jp pnpm -C projects/packages/premium-analytics run test -- parsely stageVerified on this branch
tsc --noEmitand ESLint pass. PHPUnit covers the signup URL (site filled in, no site name, other admin pages); PHPCS is clean.publisher_nameandsite_domain, the first ✕ stores{ count: 1, at }and hides the card across reloads, a back-dated record brings it back, the second ✕ storescount: 2and hides it for good, and removing the record shows it again.🤖 Generated with Claude Code