Where do I insert Google Tag Manager

Where do I put this, please?

If I place it in the custom code section it will not save because of a code error.

Do I just put a container at the top of “Body” and paste it in?

Please advise.

Allan