Skip to content

Clicktag for GitHub Pages

GitHub Pages analytics: free visitor stats for static sites

Clicktag is a free web analytics tool that adds visitor tracking to GitHub Pages with one 4 KB script, no cookies and no credit card. Track up to 50 websites, set up to 50 goals per site, and backfill up to 16 months of Google Search Console data.

GitHub Pages does not have built-in visitor analytics for your published website. The Traffic graph inside your GitHub repository only counts people who view or clone the repository on github.com over the past 14 days, not visitors to your live Pages URL. To get a GitHub Pages visitor count, you add an analytics script to your site's HTML or Jekyll layout. Clicktag does this for free with a single 4 KB script tag and no cookies.

Why the GitHub Traffic graph is not website analytics

If you open Insights > Traffic in your repository, GitHub shows you clones, visitors from the past 14 days, referring sites and popular content. As documented on GitHub's official traffic page, that report only measures traffic to the repository itself on github.com, and only people with push access can view it.

When someone visits your username.github.io address or your custom domain, GitHub's repository Traffic graph does not record the visit. You do not see which blog posts or documentation pages people read, where they came from, or how long they stayed.

The GitHub repository Traffic graph counts visits to your code on github.com over the past 14 days, not visitors to your published GitHub Pages site.

GitHub Traffic graph vs Clicktag

Here is how the built-in repository Traffic tab compares with installing Clicktag on your published site.

Feature Clicktag on GitHub Pages GitHub repository Traffic graph
What it tracks Visitors and pageviews on your published Pages site Visits and full clones on the github.com repository
Time window Date ranges you choose; Stats API queries up to 400 days at once Past 14 days
Real-time view Hits appear within about a second (last 5 minutes feed) None
Custom events and goals Up to 50 goals and funnels (2 to 6 steps) per site None
Search Console integration Up to 16 months backfilled, refreshed every 6 hours None
Price Free, no credit card, up to 50 websites per account Included with GitHub (push access required)

Prices and limits checked on October 29, 2026, on each vendor's official pricing or help pages.

How to add analytics to GitHub Pages

Adding cookieless analytics to a GitHub Pages site takes one commit. Because GitHub Pages serves static HTML files, you paste the script tag once into your shared head template, or into each HTML file if you don't use one.

1. Get your script tag

Sign in at clicktag.app with your Google account and add your site hostname (your username.github.io hostname or your custom domain). Go to Site settings > Installation, step 1, and copy your <script> tag. Keep both the data-hostname and data-verify attributes.

2. Add the tag to your HTML or Jekyll layout

If you build your site with plain HTML, or with Jekyll using a shared layout file (such as _includes/head.html or _layouts/default.html), paste the script inside <head>:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My Site</title>
    <script
      async
      src="https://clicktag.io/latest.js"
      data-hostname="example.com"
      data-verify="YOUR_SITE_VERIFY_TOKEN"
    ></script>
  </head>
  <body>
    <main></main>
  </body>
</html>

The tag you copied already carries your registered hostname and your site's verify_token; the installation docs list the optional attributes. If your GitHub Pages site is a single-page app built with React and Vite, place the same tag in your root index.html; latest.js tracks pushState and popstate route changes automatically. If your site uses hash routing (such as example.com/#/docs), add data-mode="hash" to the script tag.

For visitors without JavaScript enabled, you can also place the optional noscript pixel inside <body>.

3. Push to GitHub and verify ownership

Commit and push your changes so GitHub Pages builds and publishes the updated HTML.

Clicktag requires site verification before it stores data. On GitHub Pages, automatic verification is straightforward because GitHub serves static HTML with the data-verify token already in your homepage source. Once the build finishes, open your site: the first visit makes Clicktag fetch your homepage and verify the tag. Run setup check in Site settings > Installation, step 3, shows whether Clicktag finds it.

If the tag isn't in your homepage HTML, for example because you load it with client-side JavaScript, verify another way. Add a DNS TXT record on your custom domain, or commit a .well-known/totallytics-verify.txt file whose entire content is your verify token. Jekyll skips dot folders by default, so add include: [".well-known"] to _config.yml to publish that file.

When you test your site locally before pushing (for example on localhost:4000 or localhost:3000), remember that an explicit production data-hostname attribute on the script tag will send your local test pageviews to your live site's stats. Either omit data-hostname while running locally (so the collector ignores the local hostname) or only render the tag in production builds.

What you see in your dashboard

Once your site is verified, Clicktag starts recording visits right away. You can inspect a live demo dashboard with synthetic sample data to see the interface before you sign up. On your own site, you get:

  • Visitors and pages: Distinct daily visitors (counted with a daily salted SHA-256 hash, no cookies, no stored IP addresses), total pageviews, top pages, entry pages, median time on page for pageviews of 5 seconds or more, and average scroll depth.
  • Traffic sources and UTMs: Referrers, utm_source, utm_medium and utm_campaign, with up to 12 report filters at once. Same-site clicks are excluded, and bots are filtered out.
  • Countries and devices: Country (derived from the browser's time zone), browsers, operating systems and device types.
  • AI referrals: Traffic from ChatGPT, Perplexity, Claude, Gemini and Copilot broken out as separate sources. ChatGPT adds utm_source=chatgpt.com to links it displays, and Clicktag reads utm_source first, so those visits show up cleanly under AI traffic analytics.
  • Google Search Console: Connect your account to see search queries, clicks, impressions, CTR and position right next to your traffic. Clicktag backfills up to 16 months of Search Console analytics, refreshes the trailing 10 days every 6 hours, and overlays Search Console clicks on the Google visits it measured.
  • AI crawler tracking (with Cloudflare): JavaScript tags never see bots like GPTBot, ClaudeBot or PerplexityBot because crawlers fetch raw HTML without running scripts. If you put a custom domain on your GitHub Pages site and proxy it through Cloudflare (including the Cloudflare Free plan), you can connect a read-only Cloudflare token to see verified vs unverified bot hits per page in the Crawlers tab.

Tracking file downloads and outbound clicks on a static site

Clicktag's latest.js script does not automatically record clicks on outbound links, file downloads or form submissions. If you host a resume PDF, a release binary or project documentation links on GitHub Pages, you can track them by calling window.tt_event(name, metadata, callback) in the browser.

Event names are cut at 256 characters and metadata at 4,096 characters. Because metadata is stored but cannot be grouped or filtered in reports, put the value you want to compare directly into the event name (such as download_resume_pdf). Any event or pageview can then be turned into one of your 50 goals per site, which retroactively calculates conversions and conversion rates from the data you have already collected.

FAQ

Does GitHub Pages have built-in visitor analytics?

No. GitHub Pages hosts static files from your repository with a 1 GB site size limit and a 100 GB monthly soft bandwidth limit, but it includes no analytics for the published website. The repository Traffic tab only shows views and clones of the code repository on github.com over the past 14 days.

Is Clicktag really free for GitHub Pages sites?

Yes. Every Clicktag feature is free with no credit card required and no paid plan today. One Google account can track up to 50 websites, with up to 50 goals per site and scheduled email reports for up to 25 recipients per site.

Does Clicktag use cookies or slow down a Jekyll site?

Clicktag sets no cookies, writes nothing to local storage, and never stores IP addresses. The latest.js script is loaded asynchronously and is about 4 KB compressed, so it does not block page rendering.

Can I track a username.github.io project subdirectory?

Clicktag registers sites by hostname (such as username.github.io or a custom domain), so project sites at username.github.io/project-a and username.github.io/project-b share one site in Clicktag. The Pages report lists each path, and page filters narrow a report to exact paths. Verification still reads https://username.github.io/, so the tag or the .well-known file has to be in your username.github.io user site.

What does Clicktag not include?

Clicktag does not report bounce rate, and it has no session recordings, heatmaps, A/B testing, ecommerce revenue tracking, or Google Analytics history import (only Simple Analytics imports are supported). It is a hosted service and cannot be self-hosted.

Updated October 30, 2026