Preview widgets on your local site

This guide is for anyone building or redesigning a site on their own machine who wants to see their widgets there. The embed script normally loads only on the address you entered when you added the site, so on localhost the kudos button, hit counter, and the rest stay empty. Developer mode lets the script load on local addresses and keeps everything that happens there out of your numbers.

Turn on Developer mode

Open the site, go to Settings → Tracking, and switch on Developer mode under What gets counted. It saves as soon as you flip it.

Then reload your local page. Use the same embed tag as your live site, with the same parameters; nothing in it needs to change.

<script defer src="https://tinylytics.app/embed/YOUR_EMBED_CODE.js?hits&kudos"></script>

Your widgets now show your live site’s figures: the lifetime hit count, the kudos for each path, uptime, countries, and the webring.

What counts as a local address

Developer mode applies when the page is served from one of these:

Address Examples
localhost and names under it localhost:4000, blog.localhost
Loopback and unspecified addresses 127.0.0.1:8080, [::1]:3000, 0.0.0.0:1313
Private network addresses 192.168.1.20, 10.0.0.5
Names ending in .test or .local blog.test (Laravel Herd, Valet), mysite.local (LocalWP)

A private network address is useful for checking the page on a phone connected to the same Wi-Fi.

Every other address is treated as a live site. That includes tunnels such as ngrok or Cloudflare Tunnel, and names you have pointed at your own machine in /etc/hosts that end in a real domain. To see widgets there, add the address as a separate site, or turn on Accept hits from any domain if you are happy for those visits to count.

What happens on a local page

While Developer mode is on, a local page behaves like this:

  • Page views and events are not sent, so nothing shows up in your stats.
  • Kudos buttons respond and play their effect, but the click is not recorded. The button is not remembered either, so you can press it again after a reload.
  • Hit counters, uptime, countries, the webring, and stat cards load as usual.

Your live site keeps counting normally the whole time.

The tracking pixel is not covered. A pixel on a local page is still counted.

If kudos still count locally

Tinylytics recognises a local page from the referrer your browser sends when it fetches the script. Browsers send it by default. If your local site sets Referrer-Policy: no-referrer, through a header or a <meta name="referrer"> tag, the script cannot tell the page is local. Page views and events are still dropped because they carry the page address, but kudos you press are recorded. Relax the policy to strict-origin-when-cross-origin while you develop, or avoid pressing kudos locally.

If the widgets stay empty

Check the address against the table above. A hostname outside that list gets an empty script, the same as before.

The stat card in Iframe mode does not depend on Developer mode at all. It loads anywhere you paste it.

Turn it off

When you have finished, switch Developer mode off in the same place. Local pages get an empty script again. Leaving it on does not change what your live site counts.