SiteViews Logo

The Simplest Way to Show Page Views

Track page views and gather visitor information effortlessly with
react-siteviews
. Fully customizable, with zero backend setup required.
React
Next.js
TypeScript
Customizable

Get Started in Minutes

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.

SiteViews Counter Template

You are in Version siteviews@2.1.2

index.html

<!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.1.2/dist/index.js"
      type="application/javascript"
      scriptfor="siteviews"
      project-name="my-project"
      output-element-id="views"
      defer
      refresh="10"
      toast
      suppressLogs
    ></script>
  </body>
</html>

Output

Views:

About siteviews Script

Attributes

AttributePriorityDescription
src*required-highCDN URL pointing to the SiteViews package. Never modify this value.
type*required-highMust be "application/javascript" so the browser executes SiteViews correctly.
scriptfor*required-highMust be set to "siteviews" so the package can locate and initialize itself.
project-name*required-lowUnique project identifier used to track and store view counts per project.
output-element-id*required-highID of the element where the view count will be rendered on the page.
defer*required-lowDefers script execution until the DOM is fully parsed. Highly recommended to ensure the output element exists before SiteViews initializes.
refresh (Second)optionalRe-fetches the view count at a set interval. Minimum value is 10 seconds.
toastoptionalShows a toast notification only on the user's first visit. Omit if unnecessary.
suppressLogsoptionalSilences all SiteViews console logs and warnings. Recommended for production use.
If you do not provide the * marked attributes, the counter will not work correctly.

What’s new in Version 2.1.2?

Why Choose SiteViews?

Built for modern web applications with developer experience in mind

Zero Backend
No server setup required. Just add the script and start tracking.
Privacy First
Respects user privacy while providing essential analytics.
Developer Friendly
TypeScript support, React hooks, and modern API design.

View Your Site Stats

Enter your access key to explore last week's visitor data

Access Key for Last Week Stats
Enter your access key to view stats

Don't have or Expired access key?

Alerts & Updates

Latest updates, issues & upcoming features

Announcement
Jul 2026

New: Authenticated Site Stats (Last Week Data)

Request an access key via email to view your site's last-week visitor data with detailed analytics: daily bar charts, top countries, device breakdowns, and full visitor logs. Keys require sv.json verification and are valid for 30 days. Check the 'Site Stats' link in the header to get started!

Loading...