Toolcounter – a privacy-friendly hit counter for Toolforge tools

Suyash Dwivedi via Wikitech-l <[email protected]> Thu, 21 May 2026 11:14:31 +0530
Newsgroups gmane.science.linguistics.wikipedia.technical
Message-ID <CAPmt5nd2=7=w81W2kBB81ixF21UcuTpULVpmeaN6C5hctkdfNw@mail.gmail.com>
--===============5760953521401124294==
Content-Type: multipart/alternative; boundary="0000000000004358fa06524d6a40"

--0000000000004358fa06524d6a40
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi everyone,

I've always been curious about how many people actually visit my Toolforge
tools - and I suspect I'm not alone. So I built Toolcounter (
https://toolcounter.toolforge.org/), a lightweight, privacy-friendly hit
counter designed specifically for Toolforge-hosted tools.

*What it tracks*

=F0=9F=93=84 Page views - counted on every page load (including refreshes).=
 Good for
total traffic.
=F0=9F=91=A4 Sessions (unique visit approximation) =E2=80=94 uses sessionSt=
orage in the
visitor's browser. First open in a tab =3D 1 session. Refresh =3D not count=
ed
again. New tab =3D counted again. No cookies, no IP, no personal data store=
d.

Both counts appear separately on the dashboard with a per-day bar chart.

*Quick integration (replace YOUR_TOOL and PAGE)*

Option 1 - SVG badge (no JS, image only, shows page views):
<img src=3D"
https://toolcounter.toolforge.org/badge.php?tool=3DYOUR_TOOL&page=3DPAGE"
alt=3D"Page views">

Option 2 - JS embed (shows both views + unique sessions):
=F0=9F=91=81 Views: <span id=3D"tc-views"></span>
=F0=9F=91=A4 Unique: <span id=3D"tc-sessions"></span>
<script src=3D"
https://toolcounter.toolforge.org/embed.js.php?tool=3DYOUR_TOOL&page=3DPAGE
"></script>

An embed code generator is available on the homepage.

*Privacy*
The database stores zero personal data, only anonymous counters per (tool,
page) pair. No cookies are set. No IP addresses, User-Agent strings, or
usernames are ever written to the database. Full privacy policy:
https://toolcounter.toolforge.org/privacy.php

Source code is publicly available and open for audit.

Feedback and contributions are very welcome. Happy to answer questions here
or on my talk page: https://meta.wikimedia.org/wiki/User_talk:Suyash.dwived=
i

Cheers,
Suyash Dwivedi
https://toolcounter.toolforge.org/

https://meta.wikimedia.org/wiki/Wikis_Lazy_Coders

--0000000000004358fa06524d6a40
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi everyone,<br><br>I&#39;ve always been curious abou=
t how many people actually visit my Toolforge tools - and I suspect I&#39;m=
 not alone. So I built Toolcounter (<a href=3D"https://toolcounter.toolforg=
e.org/">https://toolcounter.toolforge.org/</a>), a lightweight, privacy-fri=
endly hit counter designed specifically for Toolforge-hosted tools.<br><br>=
<b>What it tracks</b><br><br>=F0=9F=93=84 Page views - counted on every pag=
e load (including refreshes). Good for total traffic.<br>=F0=9F=91=A4 Sessi=
ons (unique visit approximation) =E2=80=94 uses sessionStorage in the visit=
or&#39;s browser. First open in a tab =3D 1 session. Refresh =3D not counte=
d again. New tab =3D counted again. No cookies, no IP, no personal data sto=
red.<br><br>Both counts appear separately on the dashboard with a per-day b=
ar chart.<br><br><b>Quick integration (replace YOUR_TOOL and PAGE)</b><br><=
br>Option 1 - SVG badge (no JS, image only, shows page views):<br>&lt;img s=
rc=3D&quot;<a href=3D"https://toolcounter.toolforge.org/badge.php?tool=3DYO=
UR_TOOL&amp;page=3DPAGE">https://toolcounter.toolforge.org/badge.php?tool=
=3DYOUR_TOOL&amp;page=3DPAGE</a>&quot; alt=3D&quot;Page views&quot;&gt;<br>=
<br>Option 2 - JS embed (shows both views + unique sessions):<br>=F0=9F=91=
=81 Views: &lt;span id=3D&quot;tc-views&quot;&gt;&lt;/span&gt;<br>=F0=9F=91=
=A4 Unique: &lt;span id=3D&quot;tc-sessions&quot;&gt;&lt;/span&gt;<br>&lt;s=
cript src=3D&quot;<a href=3D"https://toolcounter.toolforge.org/embed.js.php=
?tool=3DYOUR_TOOL&amp;page=3DPAGE">https://toolcounter.toolforge.org/embed.=
js.php?tool=3DYOUR_TOOL&amp;page=3DPAGE</a>&quot;&gt;&lt;/script&gt;<br><br=
>An embed code generator is available on the homepage.<br><br><b>Privacy</b=
><br>The database stores zero personal data, only anonymous counters per (t=
ool, page) pair. No cookies are set. No IP addresses, User-Agent strings, o=
r usernames are ever written to the database. Full privacy policy: <a href=
=3D"https://toolcounter.toolforge.org/privacy.php">https://toolcounter.tool=
forge.org/privacy.php</a><br><br>Source code is publicly available and open=
 for audit.<br><br>Feedback and contributions are very welcome. Happy to an=
swer questions here or on my talk page: <a href=3D"https://meta.wikimedia.o=
rg/wiki/User_talk:Suyash.dwivedi">https://meta.wikimedia.org/wiki/User_talk=
:Suyash.dwivedi</a><br><br>Cheers,<br>Suyash Dwivedi<br><a href=3D"https://=
toolcounter.toolforge.org/">https://toolcounter.toolforge.org/</a></div><di=
v><img src=3D"https://upload.wikimedia.org/wikipedia/commons/5/53/Wiki_s_La=
zy_Coders_logo_small_transparent.png?utm_source=3Dmeta.wikimedia.org&amp;ut=
m_campaign=3Dindex&amp;utm_content=3Doriginal" width=3D"180" height=3D"180"=
 style=3D"margin-right: 0px;"><br></div><div><a href=3D"https://meta.wikime=
dia.org/wiki/Wikis_Lazy_Coders">https://meta.wikimedia.org/wiki/Wikis_Lazy_=
Coders</a></div><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartm=
ail=3D"gmail_signature"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">=
<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div dir=3D"ltr"><div style=3D"color:rgb(136,136,136)"><div><div =
dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"=
ltr"></div></div></div></div></div></div></div></div></div></div></div></di=
v></div></div></div></div></div></div></div>

--0000000000004358fa06524d6a40--

--===============5760953521401124294==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
--===============5760953521401124294==--