How to set up Google Tag Manager correctly
Not sure what you want to know: everything you need is in the 
Quick Start Guide. Just copy the two pieces in your layout and you are done.

In Craft you are totally free to do everything you want in your frontend templates. The system won't restrict you at all