A static ZIP site can use analytics because the tracking code runs in the visitor’s browser. You do not need a server integration: add the provider’s approved snippet to your HTML, redeploy, and verify that the browser makes the expected request.
1. Choose what you need to measure
Start with a small question: do you need page views, sign-ups, button clicks, or campaign attribution? Collecting every possible event makes reports noisy and can create unnecessary privacy obligations.
2. Put the provider snippet in every page
Most providers give you a script similar to this. Use the exact snippet from your analytics account; replace the placeholder only with your own measurement ID.
<head>
...
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
</head>
For a multi-page site, add it to every HTML file or to the shared template used to generate them. Keep it in <head> unless your provider’s instructions say otherwise.
3. Publish and verify
- Rebuild the publish folder and ZIP it with the changed HTML.
- Deploy the new ZIP.
- Open the live site in a private window.
- Open DevTools → Network and search for the analytics provider domain.
- Use the provider’s real-time report or debug view to confirm your visit.
Privacy and performance
Read your jurisdiction’s consent requirements before tracking visitors. If consent is required, do not load non-essential analytics until the visitor has agreed. Avoid installing several competing tags “just in case”; each script can affect performance and may duplicate page views.