Skip to content

[API merging] Creating a CTA fails in RRM express setup #13634

Closed

Description

@nfmohit

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

  1. Ensure Request the new RRM scopes for the express setup #13004 is merged.
  2. Turn on the rrmExpressSetup feature flag.
  3. Set up Site Kit.
  4. 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-signup until the setup-cta step.
  5. Fill out the newsletter sign-up form and submit.
  6. 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.state and validate it against Cta::STATE_ACTIVE and Cta::STATE_DRAFT, throwing Missing_Required_Param_Exception and Invalid_Param_Exception respectively, alongside the existing parameter validation.
    • Set the validated state on the Cta object.
  • In assets/js/modules/reader-revenue-manager/datastore/cta-types/types.ts:
    • Add a CTA_STATES map with ACTIVE and DRAFT members and a CallToActionState type derived from it, and use that type for CallToActionBase's state property in place of string.
  • In assets/js/modules/reader-revenue-manager/datastore/cta-types/index.ts:
    • Re-export the above, add an optional state to CreateCTAData, and add an isCTAState() guard alongside the existing isCTAType().
  • In assets/js/modules/reader-revenue-manager/datastore/ctas.ts:
    • Validate data.state within validateCreateCTAParams(). It remains optional, but is rejected when it is not a supported state.
    • Default data.state to ACTIVE in the createCTA action before the fetch is dispatched, so that existing callers need no change.

Test Coverage

  • Add JS tests covering isCTAState(), the ACTIVE default, an explicit DRAFT state passing through, and the rejection of an unsupported state.
  • Add PHP tests covering a missing state, an invalid state, and an explicit DRAFT state passing through.
  • Update existing tests to account for the state property in the request body.

QA Brief

  1. Turn on the rrmExpressSetup feature flag.
  2. Set up Site Kit.
  3. In the traffic section, click on the "Set up a sign-up form" CTA in the "Collect reader emails directly on your site" notification.
  4. Go through the express setup until the setup-cta step.
  5. Fill out the newsletter sign-up form and submit.
  6. 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.

Activity

  1. added
    Type: BugSomething isn't working
    P0High priority
    Team MIssues for Squad 2
    Module: RRMReader Revenue Manager module related issues
    on Sep 19, 2026
  2. assigned and unassigned on Sep 19, 2026
  3. self-assigned this
    on Sep 21, 2026
  4. hussain-t commented on Sep 21, 2026

    @hussain-t
    Collaborator

    Thanks, @nfmohit!

    IB ✅

  5. removed their assignment
    on Sep 21, 2026
  6. self-assigned this
    on Sep 21, 2026
  7. added a commit that references this issue on Sep 27, 2026
  8. removed their assignment
    on Sep 27, 2026
  9. self-assigned this
    on Sep 28, 2026
  10. added 2 commits that reference this issue on Sep 28, 2026
  11. removed their assignment
    on Sep 28, 2026
  12. self-assigned this
    on Sep 28, 2026
  13. mohitwp commented on Sep 29, 2026

    @mohitwp
    Collaborator

    QA Update ✅

    • Tested on dev environment.
    • Verified the RRM Express Setup CTA creation flow with the rrmExpressSetup feature flag enabled.
    • Validated the flow from Traffic section → "Set up a sign-up form" CTA → RRM express setup → setup-cta step.
    • After completing the newsletter signup form and submitting, the CTA was created successfully without any errors and the flow reached the setup completion step.
    • Also verified the CreateCTA request includes the CTA state value and the CTA creation flow works as expected.
    Details
    Recording.3463.mp4
  14. removed their assignment
    on Sep 29, 2026
  15. mohitwp commented on Sep 30, 2026

    @mohitwp
    Collaborator

    QA Update ❌

    • Tested on main environment,
    • Tested with 'rrmExpressSetup' feature flag enabled and MockAPI disabled.

    @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 Image Image Image Image
    Recording.3468.mp4
  16. hussain-t commented on Oct 1, 2026

    @hussain-t
    Collaborator

    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.

  17. tofumatt commented on Oct 5, 2026

    @tofumatt
    Collaborator

    Due to some API issues this will actually be kept in QA and will target the next release.

  18. mohitwp commented on Oct 11, 2026

    @mohitwp
    Collaborator

    QA Update ✅

    • Tested on dev environment using service staging environment.
    • Verified the RRM Express Setup CTA creation flow with the rrmExpressSetup feature flag enabled.
    • Validated the flow from Traffic section → "Set up a sign-up form" CTA → RRM express setup → setup-cta step.
    • After completing the newsletter signup form and submitting, the CTA was created successfully without any errors and the flow reached the setup completion step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module: RRMReader Revenue Manager module related issuesP0High priorityTeam MIssues for Squad 2Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions