The Google Analytics component should be added to the
Metadata partial design, which is included by default in sites.
To add the component, in Experience Editor go to the Metadata partial design:
This will give you a view of the current metadata renderings you have selected for your site, and allow you to drag metadata components into the
<body> tags of your site's page layout.
The Google Analytics component can be found in the toolbox under Analytics:
Drag this into the
<head> section of the page. When you add this, the rendering will inform you that you must add a key for this to work:
To add the key, this is set as a rendering parameter on the component, under the Tracking heading:
Once that's done you can save the partial design and your site should start outputting the tracking code.