PHP 8 & 8.1 not tracking

Can you share the console error?
Do you have access to Matomo log file (and check the error server-side)?
Maybe you have this plugin installed:

it may give you some clues…