The script's own origin is the default collect address; if the console snippet sets a separate collect address, use the snippet as is and do not change the hostname yourself. If you turn chat on later, keep this same snippet.
Prerequisites
You can create a project and edit the site template. localhost does not send by default.
Steps
Create a project
Create it in the console and note the time zone. Reports cut "today" on that zone.
Register the hostname
Open ConsoleWeb analyticsConfigurationSDK code and add the hostname without a scheme or path. Subdomains are allowed. Unregistered hosts are dropped.
Install the script
Put this in the head of every page. Replace
YOUR_ORIGINwith the origin from the console andYOUR_SITE_KEYwith the site key on that page.html<script async src="https://YOUR_ORIGIN/w.js" data-site="YOUR_SITE_KEY"></script>Open the site
Visit a page on the registered hostname. Do not open a local file with the file protocol.
Verify
Open ConsoleWeb analyticsRealtime. The pageview should show within a few seconds. The collect endpoint returns 202 whether or not the hit was stored; see Verify your installation. Pageview rules are in Pageviews & SPAs.
Common failures
The hostname is not registered, the browser sent Do Not Track, a policy blocked the script, or the page includes two copies (only the first runs; the later one exits). None of these throw on the page.
Next steps
To add chat, read Live chat quickstart. To skip admin paths or change the time zone, read Project settings.