Google Analytics 4 (GA4) on AMP posts

I use Ghost for our company’s blog. AMP is switched on and works really well - over half of the organic traffic is on AMP pages.

The problem is that the AMP integration only supports Google Analytics Universal, but does not support Google Analytics 4. How can I put GA4 tag on AMP pages?