Last updated 26 November 2026. By Paul Badarau.
The snippet is one tag: <script defer src="…/script.js" data-site="your-project-id"></script>. Copy the exact tag from the Project's tracking setup in Analytics. The data-site value tells the script which Project it counts for, and without it the script sends nothing.
A fictional developer has a portfolio built with a static site generator and served at example.com and www.example.com.
- In Accounts, create a Project with the hostname most visitors use, example.com. Then add www.example.com as an alias in the Project's tracking settings in Analytics. A Project takes up to 20 aliases, and pageviews from hostnames it does not list are refused.
- In Analytics, open the Project's tracking setup and copy the snippet. Any Member can copy it, Viewers included.
- Paste it once into the template that renders the head of every page. With a static site generator or a framework, that is the base layout or root document.
- Deploy, then open the live site. A visit from localhost does not count, because events must come from the Project's hostname or one of its aliases.
- Run the collection check in the tracking setup. When it reports a received event, the install works.
The PostDeploy Analytics script sets no cookies and keeps only in-page memory. It sends a pageview on load and on each single-page navigation. While a page is visible it also sends an activity signal every 30 seconds to measure visible time, and those signals never count as pageviews.
Your own test visit can be dropped on purpose. New Projects respect Do Not Track and Global Privacy Control, so if your browser or an extension sends either signal, the check shows nothing even though the snippet is fine. Test from a browser without those signals.
If your site sends a Content Security Policy, allow the script's host in script-src and in connect-src. The script loads from that host and sends its events back to it.
The product page for this is Analytics.