Google Sites (the "new" version, sites.google.com) is a free, no-code website builder within Google Workspace. It is one of the most restrictive platforms for analytics integration. There is no custom code injection, no theme editor, no plugin system, and no API. The only built-in analytics integration is a native Google Analytics connection.
Integration Architecture
Google Sites provides exactly one integration path:
- Built-in Google Analytics -- Navigate to Settings (gear icon) > Analytics and enter a GA4 Measurement ID (
G-XXXXXXXXXX). Google Sites injects the gtag.js snippet automatically.
That is the entirety of Google Sites' analytics integration surface. There are no other options.
Available Integrations
Analytics Platforms
- Built-in Settings > Analytics (Measurement ID only)
- Basic pageview tracking with automatic enhanced measurement
- No custom event configuration within Google Sites
Tag Management
- Not supported. Google Sites does not allow custom JavaScript injection. GTM cannot be installed on Google Sites.
Marketing Pixels
- Not supported. Google Sites does not allow custom JavaScript. Meta Pixel cannot be installed natively.
Setting Up GA4 (The Only Option)
Open your Google Site in the editor. Click the Settings gear icon in the right sidebar, then select Analytics:
- Enter your GA4 Measurement ID (format:
G-XXXXXXXXXX) - Click Done
- Publish the site
Google Sites will automatically inject the gtag.js script on all pages. You can verify it is working by checking the GA4 Realtime report or using the Google Tag Assistant Chrome extension.
Settings > Analytics > Google Analytics Measurement ID: G-XXXXXXXXXX
This provides:
- Automatic pageview tracking
- Enhanced measurement events (scroll, outbound clicks, site search if configured in GA4)
- No custom event configuration -- GA4's enhanced measurement settings (configured in the GA4 admin, not in Google Sites) control what gets tracked
Workarounds for Additional Tracking
Since Google Sites blocks all custom JavaScript, the only workarounds involve external tools:
Embed method (limited). Google Sites supports embedding external content via Insert > Embed > Embed code or Insert > Embed > By URL. Some users attempt to embed an iframe containing tracking scripts. However, iframes run in a sandboxed origin and cannot access the parent Google Sites page, so tracking data (page URL, title, scroll depth) will be incorrect or unavailable.
Google Analytics Measurement Protocol. For server-side tracking of specific actions (form submissions via Google Forms embedded in the site), you can use the GA4 Measurement Protocol to send events from a server. This does not replace client-side tracking but can supplement it for form completion events.
Google Tag Manager via GA4. While GTM itself cannot run on Google Sites, you can configure GA4's built-in enhanced measurement and connected site tags within the GA4 admin interface to expand tracking without needing GTM.
Platform Limitations
No custom JavaScript. Google Sites strips all <script> tags from embedded content. There is no workaround for injecting GTM, Meta Pixel, or any custom tracking script.
No data layer. Since no custom JavaScript can run, there is no way to create or push to a window.dataLayer object. All tracking is limited to what GA4's automatic collection provides.
No ecommerce. Google Sites has no cart, checkout, or product functionality. Ecommerce tracking is not applicable.
No page-level analytics configuration. The GA4 Measurement ID applies to the entire site. You cannot use different tracking IDs for different pages.
No consent management. Google Sites has no built-in cookie consent banner. GA4 tracking fires unconditionally on all page loads. For GDPR compliance, you must rely on GA4's data retention and consent mode settings configured in the GA4 admin.
Limited URL structure. Google Sites generates URLs based on page titles with no control over URL slugs. Analytics reports may show inconsistent page paths if page titles are changed after publication.
No server-side access. There is no backend, no hosting configuration, and no way to implement server-side tracking of any kind.
Performance Considerations
- Google-hosted CDN. Google Sites pages are served from Google's CDN with aggressive caching. Performance is typically excellent without any tracking scripts.
- GA4 is the only overhead. With only gtag.js running (no GTM, no additional pixels), the analytics overhead is minimal -- approximately 30-50KB of JavaScript.
- No optimization control. You cannot add
asyncordeferattributes, configure resource hints, or control script loading order. Google Sites manages all of this internally.
Recommended Integration Priority
- Add GA4 Measurement ID in Settings > Analytics -- the only available option
- Configure Enhanced Measurement in the GA4 admin (not in Google Sites) to maximize automatic event collection
- Accept limitations -- If you need GTM, Meta Pixel, or custom event tracking, Google Sites is not the right platform. Consider migrating to a platform with full code access.
Next Steps
- Install Google Analytics 4
- Google Tag Manager (limitations documented)
- Meta Pixel (limitations documented)
For general integration concepts, see the integrations overview.