How to Integrate MS-Clarity in AMP Pages in 2024?

I have developed a website entirely using Accelerated Mobile Pages (AMP).

I recently discovered Microsoft Clarity, but their installation instructions do not cover AMP, even for manual installation.

I tried integrating the JavaScript code provided for manual installation by simply pasting it into the header.

It appears to work in the Clarity interface, but several severe errors are reported by AMP validation tools, including Google Search Console. As a result, my pages are not being served by the AMP cache provided by Google’s proxy-based content delivery network (CDN).

Has anyone else encountered this issue and found a workaround to implement Clarity on AMP without errors?