Some groups my choose to track user visits to their site. We support two options: Google Analytics (useful for anyone) and Facebook Analytics (useful for those buying paid Facebook ads for their site's content). This page is primarily about setting up Google Analytics; more info about Facebook is at the bottom of this page.
For personal sites, you should use your personal, non-Caltech email address to create a Google Analytics account. Institute policy does not allow you to use Google Analytics with your normal Caltech email address (e.g firstname.lastname@example.org).
For a department site, you will probably want to create a shared mailbox and then use that email address to sign up for a Google Analytics account. This makes it easier to share responsibility for the Google Analytics account. To request a shared mailbox, go to https://help.caltech.edu/ and create a new ticket with request type: IMSS > Accounts > "Shared or Group Access Request Form". Fill in your contact information, and in the section asking what resources you need, select "Shared Mailbox". If you want more than one person to have access to email sent to this new address, list them in the appropriate form field.
No matter what account you use to set up your Google Analytics, you can add additional people as "Viewers" or "Analysts" via the Google web site. This allows them to view your Google Analytics reports without giving them access to change your analytics configuration.
As of March 2023, Caltech Site supports only Google Analytics 4.
Google's old Universal Analytics system is now fully deprecated, and will cease operation entirely come July 2023. If your site is still configured to use Universal Analytics (instructions for which are still provided lower on this page), you should convert it to use Google Analytics 4 right away.
Google Analytics 4
To set up a Google Analytics 4 property to track your site's viewers, follow these instructions from Google. Note that you cannot use your personal Caltech email address for creating an account, so use either a personal gmail account (for a personal site) or a departmental Google account (set up using the description above) for a department site.
Create a "Web" Data Stream for your website's domain. When you get to the "Set up data collection (for websites)" section, click the icon next to the "Measurement ID" near the top-right to copy it into your clipboard (or just select and copy the ID manually).
Then log in to your Caltech Sites admin console. Go to the Settings -> Site Preferences page, choose the Analytics tab, and paste the copied Measurement ID into the "Google Analytics 4 Tracking ID" field. Then click the green Save button. The value that you pasted should look something like G-ABC####XYZ.
Placing your Measurement ID in your site's preferences takes the place of the "Set up data collection (for websites)" section of the Google instructions. Google Analytics will begin tracking visits to your site, which you can view from the Google Analytics homepage. If you click around on your web site a bit, you should be able to see some data in the "real time" section right away. But most of the reports will not have enough data to display until at least a day after you finish setting up Analytics.
Universal Analytics (DEPRECATED)
To collect analytics via Universal Analytics, you will need to create a Google analytics account and follow the instructions on this page to obtain a Universal Analytics tracking id. The id you need will be in the "Property Settings" section of your analytics admin interface and should be formatted as "UA-<7digits>-1". Once you have that tracking id, you can copy it into the "Google Universal Analytics Tracking ID" field in the Universal Analytics section of the Site Preferences Analytics tab.
Google Tag Manager and Facebook Pixel
The Analytics settings tab has fields for you to enter a Google Tag Manager ID and/or a Facebook Pixel ID. These are both advanced analytics tools that require a fair amount of expertise to use effectively. Assistance with these tools is beyond the scope of support IMSS can provide.