By default all of our templates have options for Google Analytics.
Go to the template's parameters (Extensions → Template Manager → Your Template) and enter your Google ID and domain (without www.) on the Google Analytics section.
If you wish to use another service, like Quantcast or comScore you need to publish a new K2 Tools module (custom code funtionality) with your code in the TEMPLATENAMEHERE_statistics position.
This position will render directly above the closing <body> tag.
DOCUMENTATION
Customization
Content
Published in Customization