How to Connect a Google Site to a Google Analytics Property
If you'd like to connect your Google Site to a Google Analytics property for more detailed statistics on how many visitors your site gets, and how people are using your site, follow these steps to do so.
Creating a Google Analytics Property and Data Stream
First, go to analytics.google.com and click the settings icon at the bottom left. Make sure you have the correct account selected on the left. If you have no accounts click the blue "Create Account" button.
On the right, click the blue "Create Property" button and give it a name, then click on "Next" and "Create". Now choose the "Web" option to create a new Data Stream. Now you will be asked to provide your site URL in the box at the top. Make sure you do not include "https://" in front of it as it will automatically add that protocol for you. On the right, you will also need to give it a name. Next, click "Create stream".
Connecting Google Analytics to Your Google Site
Now that the Google Analytics Property and Data Stream have both been created, you need to connect to the site so that they have access to gather analytics data. To do this, click the "Use existing on-page tag" tab on the next screen, and expand the "Google Analytics" dropdown. Here, just next to "4.", you will see a tracking number. Copy this to your computer's clipboard.
Next, navigate to your Google Sites editor and click the Settings icon at the top right. Click the "Analytics" tab and paste in the tracking number you just copied. After you click the close button you will see a popup at the bottom of the editor to confirm that Google Analytics has been enabled.