Bug: Analytics tracking fails for all unauthenticated visitors (401 on REST endpoint)

When analytics is enabled, the tracking script loads on the frontend and POSTs to /wp-json/uixpress/v1/analytics/track on every page view. However, the endpoint returns a 401 ("Sorry, you do not have permission to make REST API requests") for unauthenticated visitors. The result is zero data collected, console errors on every page load, and a hit to Google PageSpeed scores.

Additional note: The script is output via wp_print_script_tag() rather than the WordPress enqueue system, so there's no way to dequeue it as a workaround β€” site admins have to disable the entire analytics feature to stop the errors.

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

πŸ› Bug Reports

Date

4 days ago

Author

aricmb

Subscribe to post

Get notified by email when there are changes.