Repository navigation
[API merging] Creating a CTA fails in RRM express setup #13634
Copy link
Copy link
Closed
Labels
Module: RRMReader Revenue Manager module related issuesReader Revenue Manager module related issuesP0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: BugSomething isn't workingSomething isn't working
Description
Bug Description
The request to create a CTA in RRM express setup fails. The CreateCTA request body omits the CTA state, which the API requires.
Steps to reproduce
- Ensure Request the new RRM scopes for the express setup #13004 is merged.
- Turn on the
rrmExpressSetupfeature flag. - Set up Site Kit.
- Go through the RRM express setup at
yoursite.com/wp-admin/admin.php?page=googlesitekit-dashboard&slug=reader-revenue-manager&reAuth=true&expressSetup=true&cta=newsletter-signupuntil thesetup-ctastep. - Fill out the newsletter sign-up form and submit.
- Observe the error encountered.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Creating a CTA in the Reader Revenue Manager express setup flow no longer fails due to the reason mentioned in the issue description.
Implementation Brief
- In
includes/Modules/Reader_Revenue_Manager/Datapoints/Create_CTA.php:- Require
data.stateand validate it againstCta::STATE_ACTIVEandCta::STATE_DRAFT, throwingMissing_Required_Param_ExceptionandInvalid_Param_Exceptionrespectively, alongside the existing parameter validation. - Set the validated state on the
Ctaobject.
- Require
- In
assets/js/modules/reader-revenue-manager/datastore/cta-types/types.ts:- Add a
CTA_STATESmap withACTIVEandDRAFTmembers and aCallToActionStatetype derived from it, and use that type forCallToActionBase'sstateproperty in place ofstring.
- Add a
- In
assets/js/modules/reader-revenue-manager/datastore/cta-types/index.ts:- Re-export the above, add an optional
statetoCreateCTAData, and add anisCTAState()guard alongside the existingisCTAType().
- Re-export the above, add an optional
- In
assets/js/modules/reader-revenue-manager/datastore/ctas.ts:- Validate
data.statewithinvalidateCreateCTAParams(). It remains optional, but is rejected when it is not a supported state. - Default
data.statetoACTIVEin thecreateCTAaction before the fetch is dispatched, so that existing callers need no change.
- Validate
Test Coverage
- Add JS tests covering
isCTAState(), theACTIVEdefault, an explicitDRAFTstate passing through, and the rejection of an unsupported state. - Add PHP tests covering a missing state, an invalid state, and an explicit
DRAFTstate passing through. - Update existing tests to account for the
stateproperty in the request body.
QA Brief
- Turn on the
rrmExpressSetupfeature flag. - Set up Site Kit.
- In the traffic section, click on the "Set up a sign-up form" CTA in the "Collect reader emails directly on your site" notification.
- Go through the express setup until the
setup-ctastep. - Fill out the newsletter sign-up form and submit.
- Verify that your CTA is created correctly without errors and that you land on the setup completion step.
Changelog entry
- Fix creating a CTA in the Reader Revenue Manager express setup flow.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Module: RRMReader Revenue Manager module related issuesReader Revenue Manager module related issuesP0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: BugSomething isn't workingSomething isn't working
Activity
hussain-t commentedon Sep 21, 2026
Thanks, @nfmohit!
IB ✅
Merge branch 'develop' into fix/#13634-create-cta-state.
Merge branch 'develop' into fix/#13634-create-cta-state.
Merge pull request #13636 from google/fix/#13634-create-cta-state
mohitwp commentedon Sep 29, 2026
QA Update ✅
Details
Recording.3463.mp4
mohitwp commentedon Sep 30, 2026
QA Update ❌
@hussain-t
Issue observed
While setting up the sign-up form, clicking "Publish to your site" triggers an internal error, and the user is unable to complete the CTA setup flow.
Details
Recording.3468.mp4
hussain-t commentedon Oct 1, 2026
Thanks, @mohitwp! This one's on the RRM API side. The write endpoints are returning intermittent 500s and 503s, and in the case of create publication the write actually succeeds while still returning an error. So let's hold this in QA until they've fixed it.
tofumatt commentedon Oct 5, 2026
Due to some API issues this will actually be kept in QA and will target the next release.
mohitwp commentedon Oct 11, 2026
QA Update ✅