New Feature - Universal Button Click Tracking in WordPress React Components
Introduced enforceable, automated analytics tagging and unified reporting through the /reportAnalytics endpoint for all frontend user interaction events.
1. Code sample of listener + fetch
Example React component (developer-only responsibility = add the tag)

Global analytics listener (runs once)





2. Visual of API call in Network tab
When clicking the button above, DevTools → Network shows:
Request

3. Overview of test enforcement strategy
This test suite enforces the correctness of the analytics utility layer at build time. It validates that analytics event names are parsed consistently, human-readable values are normalized into URL-safe path segments, and analytics URLs are constructed according to the expected contract and global configuration. Malformed event names are explicitly rejected, ensuring analytics requests are only generated from valid, predictable inputs and preventing silent regressions in tracking behavior.
Unit test: scan rendered components



