@María Luz Micozzi The APIM Developer Portal has built-in support for Google Tag Manager for both managed and self-hosted portals. The official doc for the same covers step required for setting things up for both.
For more customized integration, you would have to self-host with your own implementation as required.