This is pretty clear what to do -
https://developers.google.com/tag-manager/quickstart
In XC4 you can add this snippet to home.tpl for your skin. This will add Google Tag Manager to the site. You should configure any tracking within your Google Tag Manager account not XC