Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporting - Have unique screen ID for pages within WooPayments in Admin #10439

Open
nagpai opened this issue Feb 25, 2025 · 0 comments
Open

Reporting - Have unique screen ID for pages within WooPayments in Admin #10439

nagpai opened this issue Feb 25, 2025 · 0 comments
Labels
category: core WC Payments core related issues, where it’s obvious. focus: reporting

Comments

@nagpai
Copy link
Contributor

nagpai commented Feb 25, 2025

A unique screen ID for each admin page is very important for various use cases notably:

  • To conditionally execute code for a specific screen
  • To accurately track it using tools such as track tickets, or any similar analytics tool.

WordPress core and WooCommerce have a unique screen ID for each admin page that can be sought using the get_current_screen() function. However, we have a discrepancy within almost all WooPayments admin pages.

Running get_current_screen()->id within any of the inner admin pages of WooPayments ( e.g. Payments -> Transactions , Payments -> Payouts , and Payments->Disputes) , does not give a unique screen ID, but rather returns - woocommerce_page_wc-admin . This is not unique and does not give us an accurate depiction of where the function was called.

Notes

  • The usage of unique screen ID instead of extrapolating it with query parameters came up in a review on another PR, where we were implementing a track event.
  • Related internal discussion - p1740360862997249-slack-C04MVBQC0MS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. focus: reporting
Projects
None yet
Development

No branches or pull requests

1 participant