Simple Website Analytics for Trilium

Get simple website analytics for Trilium with one snippet. It counts the visitors of your shared notes. No sampling, no delays. Just the numbers you need.

Add it once. It reaches every page under your shared note automatically.

StatJolt is €0 to use until 11 April 2027 23:59:59, at any amount of traffic. After 11 April 2027 it stays €0 for low-traffic sites.

Before you start

  1. Sign up and copy your snippet. Under a minute. No credit card.
  2. In Trilium, open the note that is the top of your public site. Turn on the Shared switch. Trilium then shows the public link. Every note under this note is shared too.

If you share more than one separate note, do the last step of your option on each of them.

Option 1: HTML snippet (easiest)

You paste your StatJolt code exactly as you got it. This option needs Trilium 0.99.2 or newer.

  1. Make a new note under your shared note. Give it a name, for example "StatJolt".
  2. Click Note type. Go to the Code section and choose HTML.
  3. Paste your full StatJolt code into the note. It has two lines: a <div> and a <script>. Keep both.
  4. In Owned Attributes of this note, type #shareHiddenFromTree. Your visitors then won't see this note in the menu.
  5. In Owned Attributes of this note, add the label that matches your badge position. You set the position in your StatJolt account, on the Badge tab of your site settings:
    • Floating, bottom right or Floating, bottom left: type #shareHtmlLocation=body:end.
    • Next to icon row or New row, centered: type #shareHtmlLocation=content:end. The badge then shows under the note text.
  6. Open your shared top note again. In Owned Attributes, type ~shareHtml(inheritable)=@. Start to type "StatJolt" and pick the note from the list. Every page under this note now gets the code.

Option 2: JavaScript note

You can also add the code as a script. Use this option only if you can't use Option 1.

  1. Make a new note under your shared note. Give it a name, for example "StatJolt JS".

  2. Click Note type. Go to the Code section and choose JavaScript (Trilium frontend).

  3. Paste this code. Put the number from data-user="…" in your StatJolt code in place of YOUR-ID:

    var box = document.createElement('div');
    box.id = 'statjolt-badge';
    (document.getElementById('content') || document.body).appendChild(box);
    
    var s = document.createElement('script');
    s.async = true;
    s.src = 'https://statjolt.com/measure/c.min.js';
    s.setAttribute('data-user', 'YOUR-ID');
    document.head.appendChild(s);
  4. In Owned Attributes of this note, type #shareHiddenFromTree. Your visitors then won't see this note in the menu.

  5. Open your shared top note. In Owned Attributes, type ~shareJs(inheritable)=@. Start to type "StatJolt JS" and pick the note from the list.

The badge shows as you set it in your StatJolt account, on the Badge tab of your site settings. A floating badge stays in its corner. Next to icon row and New row, centered show the badge under the note text.

Check that it works

Open your public share link in a private window. You see the StatJolt badge on the page. Visit a few pages. Refresh your StatJolt dashboard and see your first visitor without waiting for the data.

If you don't see the badge

Work through these steps in order.

1. Check your Trilium version. Option 1 needs Trilium 0.99.2 or newer. Older versions ignore ~shareHtml without any error.

  • In Trilium, click the main menu (the Trilium logo button at the top left).
  • Click About Trilium Notes.
  • Look at Version. If it is lower than 0.99.2, update Trilium first.

2. Restart your Trilium server. Use the command that matches your install.

Docker Compose. Run this in the folder that has your docker-compose.yml:

docker compose restart

Plain Docker. First find the container name:

docker ps

Then restart it, using the name from the list:

docker restart <container-name>

Installed as a service (systemd). Use your service name, for example:

sudo systemctl restart trilium

3. Clear the Cloudflare cache, if your domain uses Cloudflare.

  • Log in at https://dash.cloudflare.com
  • Click your domain.
  • In the left menu, open Caching, then Configuration.
  • Under Purge Cache, click Purge Everything.
  • Confirm with Purge Everything in the warning window.

If you run another cache on your server, for example nginx caching, clear that one too.

4. Check the page again. Open one of your shared pages in a private window. You see the StatJolt badge on the page.

What your dashboard looks like

Once you log in, everything is clickable. There are more tabs if you want to dig deeper. You can also click on a page to see which channels brought the most visitors there. Combine these with mobile, country or almost anything. You can easily delete any of these filters with simple close buttons on them.

yourwebsite.com Last 7 days
Unique Users 3,562 +8.2%
Pageviews 8,644 +11.4%
Sessions 4,691 +6.7%
Bounce Rate 39.8% -3.1%
Visit Duration 2:54 +19s
Conversions 139 +14.9%

Acquisition

NameVisitsShareChange
Google2,331+12.4%
direct1,140+4.1%
pinterest.com596+31.8%
facebook.com371-6.2%
bing.com169+2.9%
duckduckgo.com840.0%

Pages

NameVisitsShareChange
/2,732+9.7%
/recipes1,495+18.2%
/blog/starter-care1,167+6.4%
/blog/sourdough-starter1,020+44.1%
/recipes/bread787-2.3%
/recipes/pizza-dough545+7.8%

Everything you need, not just the basics

StatJolt covers the basics on Trilium: visitors, sources, pages and devices.

Plus! Included too:

  • User journeys: the path a visitor takes through your notes.
  • Core Web Vitals: the same speed score Google uses to rank you. The difference is real measurement, not a simulation. It catches it if one of your pages slows down.
  • JS error tracking: catch broken code without a separate tool.
  • Funnels: free, not locked behind a paid plan.

Simple web analytics for Trilium

StatJolt is a simple web analytics tool for Trilium. The statistics are cookieless. So you don't need a cookie banner, because there is no personal data. You still get every number.

FAQ for Trilium website analytics

How do I install StatJolt on Trilium?

Paste your snippet into an HTML code note under your shared note. Then add the ~shareHtml(inheritable) relation to your shared top note and point it to that note.

Which pages does it count?

Every shared page under the note that has the relation.

Which Trilium version do I need?

Trilium 0.99.2 or newer for Option 1. Older versions ignore ~shareHtml without any error.

Do I need a cookie banner?

No. StatJolt sets no cookies. It collects no personal data.

Does it slow my site down?

No. The script is small. It never blocks the page from loading.

Replace GA4 in 2 minutes

Just paste the code and see how much clearer it gets. No cookies, no consent tool. €0 until 11 April 2027, at any traffic level. Later, for small sites it still costs €0.

Get my free account