You have to use Universal Analytics. GA4 is not yet supported in AMP
You can follow the issue: https://github.com/ampproject/amphtml/issues/24621
Read comment: https://github.com/ampproject/amphtml/issues/24621#issuecomment-824336265
CLICK HERE to find out more related problems solutions.