Skip to content

Conversation

@laurelfulford
Copy link
Contributor

@laurelfulford laurelfulford commented Jan 6, 2026

All Submissions:

Changes proposed in this Pull Request:

This PR, along with Automattic/newspack-plugin#4377 and Automattic/newspack-popups#1508, add the prompt_title to the GA4 data captured by the modal checkout when it's triggered from a campaign prompt, based on feedback.

See NPPM-2486.

How to test the changes in this Pull Request:

  1. Apply this PR, and feat: include prompt_title with newspack_popup_id for data events newspack-plugin#4377 and feat: make prompt_title available to modal checkout data events  newspack-popups#1508
  2. Set up a few products so you have at least one simple product and one product with variations.
  3. Set up donations
  4. Set up a few different campaigns, both inline and overlay. Add checkout button blocks and Donation blocks to your campaigns. For the variable product, set it up so the reader can pick the product variation as part of the checkout.
  5. Using GA4, an extension like this, or by console logging something like console.log( 'Event Info:', eventName, filteredPayload ); before this line, go through some different checkout interactions with the prompts and make sure you confirm all the different events include the prompt_title:

With the Donate Block:

  1. When you click 'Donate Now' confirm both the opened and loaded events include the prompt_title and it matches your prompt
  2. When you enter your information and click 'Continue', confirm the continue event includes the prompt_title and it matches your prompt
  3. When you click 'Edit Billing Information', confirm the back event includes the prompt_title and it matches your prompt
  4. Back on the second screen, when you click 'Complete Transaction', confirm both the form_submission and form_submission_success messages include the prompt_title.
  5. Repeat step a) and then close the modal checkout; confirm the dismissed event includes the prompt_title.

With the Checkout Button block

  1. When you click the Checkout Button, confirm both the opened and loaded events include the prompt_title and it matches your prompt
  2. When you enter your information and click 'Continue', confirm the continue event includes the prompt_title and it matches your prompt
  3. When you click 'Edit Billing Information', confirm the back event includes the prompt_title and it matches your prompt
  4. Back on the second screen, when you click 'Complete Transaction', confirm both the form_submission and form_submission_success messages include the prompt_title.
  5. Repeat step a) and then close the modal checkout; confirm the dismissed event includes the prompt_title.

With the Checkout Button block with Variations

  1. When you click the Checkout Button, confirm the variations modal opens and the opened_variations includes the prompt_title
  2. When you pick a variation and click 'Purchase', confirm the opened and loaded events includes the prompt_title
  3. Complete the transaction, and confirm both the form_submission and form_submission_success messages include the prompt_title.

With a standard Checkout/Donate Block

  1. Just in case, test out a Checkout Button Block or Donate block in a regular post/page (not in a campaign) and double-check that what's being tracked looks okay. The full list of standard modal checkout GA4 events are here.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford marked this pull request as ready for review January 6, 2026 22:34
@laurelfulford laurelfulford requested a review from a team as a code owner January 6, 2026 22:34
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

All works as described!

@laurelfulford
Copy link
Contributor Author

Thanks @dkoo! 🙌

@laurelfulford laurelfulford merged commit 238c7e9 into trunk Jan 9, 2026
8 checks passed
@laurelfulford laurelfulford deleted the feat/add-newspack-popup-title-ga4 branch January 9, 2026 21:12
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Hey @laurelfulford, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants