It's really as simple as:
- Create a partial view named GoogleAnalytics
- Copy & Paste the Analytics tracking JavaScript code from Google
- Use
@{ Html.RenderPartial("GoogleAnalytics"); }
in a template which is used by all pages - Publish the site
- Wait 24 hours for statistics to appear
This is my organised approach however you can put it in any location as long as the code is visible on every page you want to track.