
Choose your preferred technology stack and start tracking page views
⚠️ SiteViews only works in production deployments — it will not track views in a local development environment.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SiteViews Template</title>
</head>
<body>
<div>
<p>Views: <span id="views">Loading...</span></p>
</div>
<!-- include siteviews script tags -->
<script
src="https://unpkg.com/siteviews@2.0.5/dist/index.js"
type="application/javascript"
scriptfor="siteviews"
project-name="my-project"
output-element-id="views"
refresh="10"
toast
suppressLogs
></script>
</body>
</html>Views:
| Attribute | Priority | Description |
|---|---|---|
| src* | required-high | CDN URL pointing to the SiteViews package. Never modify this value. |
| type* | required-high | Must be "application/javascript" so the browser executes SiteViews correctly. |
| scriptfor* | required-high | Must be set to "siteviews" so the package can locate and initialize itself. |
| project-name* | required-low | Unique project identifier used to track and store view counts per project. |
| output-element-id* | required-high | ID of the element where the view count will be rendered on the page. |
| refresh (Second) | optional | Re-fetches the view count at a set interval. Minimum value is 10 seconds. |
| toast | optional | Shows a toast notification only on the user's first visit. Omit if unnecessary. |
| suppressLogs | optional | Silences all SiteViews console logs and warnings. Recommended for production use. |
Built for modern web applications with developer experience in mind
Enter your hostname to explore page view activity, visitor locations, and device breakdown
Latest updates, issues & upcoming features