Get started
Quickstart
Register your website, add one script, and check your first pageview. That’s the whole setup.
1. Register your site
Register your hostname before sending traffic. The collector normally drops traffic for unregistered hostnames without returning an error.
- Sign in at /login. For a new account, choose Google.
- Navigate to /app and click Add site.
- Enter your production hostname, such as
example.com.
Do not include URL schemes (https://), paths, or port numbers. Each account can register up to 50 sites. All sites are private by default.
You can also register sites programmatically using POST /api/sites. See the Sites API Reference for request schemas.
2. Add the tracking script
Add this single script tag to your site HTML. Place it in your shared layout, document head, or before the closing body tag:
<script
async
src="https://analytics.bitgate.dev/latest.js"
data-hostname="example.com"
></script>To capture visits from users with JavaScript disabled, add an optional noscript pixel inside the HTML <body>:
<noscript>
<img
src="https://analytics.bitgate.dev/noscript.gif?hostname=example.com"
alt=""
referrerpolicy="no-referrer-when-downgrade"
/>
</noscript>Always specify data-hostname to avoid domain detection mismatches. Subdomains and www prefixes are separate hostnames and are not combined automatically. Set data-hostname to the exact value you registered.
3. Verify incoming traffic
Open your site in a standard desktop or mobile web browser to verify the installation:
- Open your browser Developer Tools and select the Network tab.
- Filter requests by
bitgate.dev. - Verify that
latest.jsloads with HTTP 200. - Find the request to
simple.gif. Check that its query includeshostname=example.comandtype=pageview, and that the response is HTTP 200 with content typeimage/gif. - Navigate away or close the tab. The tracker may send an
/appendengagement beacon; it is not a second pageview.
A collector HTTP 200 is not proof that a row was saved: writes are asynchronous, and requests can be ignored. Check the exact page in /app, or query your site’s pages breakdown. Newly registered sites can take about a minute to reach collector instances that cached an earlier lookup.
When testing, keep these checks in mind:
- Use a real browser. Headless browsers with
navigator.webdriverenabled are marked as automated traffic; bot-marked rows do not count toward normal visitor and pageview totals. - Check browser extensions. Ad blockers and privacy tools can block analytics endpoints.
- Check Do Not Track. The script honors
navigator.doNotTrack === "1"by default and will not record visits.
4. Explore the API
You can query public stats directly without an account using our public demo domain:
curl --fail-with-body -sS --max-time 30 \
'https://analytics.bitgate.dev/api/sites/demo.bitgate.dev/overview?tz=UTC'This endpoint returns JSON containing totals, previous, series, live, and granularity fields. Note that demo traffic is synthetically generated.
Public-site metadata and statistics allow unauthenticated reads. Private reports require the site owner’s token in the Authorization header. Import jobs remain owner-only even for public sites. Read the Stats API Reference for detailed parameter options and the Authentication Guide for bearer token usage.