fivebar

Site search

Copy page
View Markdown
Open with
Connect MCP
Cursor VS Code

See what visitors type into your site’s own search, and which searches found nothing.

Tell fivebar where your searches are, with a rule or with the tag, and the dashboard lists each term, how many times it was searched, and how often it found nothing.

Setting it up with a rule

If your search pages put the search in their address, add a rule in the site’s settings, under Site search: the search pages, as a path with * for anything, and the parameter that holds the search. With the pages /search* and the parameter q:

AddressCounted
/search?q=shoesshoes
/search/products?q=red+shoesred shoes
/search?q=shoes&q=bootsshoes, the first
/search?Q=shoesNothing: Q isn’t q

Without the *, /search is that page alone, not /search/products.

A site can have up to 10 rules. Each page is tried against them in the order they were added, and the first that matches and finds a search counts it. A rule starts counting within a few minutes, and can’t count earlier searches. On a page with data-path, match that path.

Searches the address does not show

If the search isn’t in the address, such as results shown after a form is sent, write it into the tag on the results page:

<script async data-domain="example.com" data-search="{{ query }}" src="https://fiveb.ar/js/tally.js"></script>

Leave data-search out on other pages. It counts with or without a rule, and wins where both find a search, unless it isn’t kept (below), when the rules count instead.

Searches that found nothing

Add data-search-results with how many results the page shows. It goes with a search from a rule or data-search, and does nothing on its own.

<script async data-domain="example.com" data-search-results="{{ count }}" src="https://fiveb.ar/js/tally.js"></script>
ValueMeans
0Found nothing
120Found something
3,000, -1, 1.5Ignored: only a whole number of up to 9 digits is read

What is kept

SearchedKept
Red Shoesred shoes
2026-10-032026-10-03
0123456701234567
me@example.comNothing: an email address
+44 (0)20 7946 0958Nothing: a number of 9 digits or more

Terms are kept in lower case with their spaces run together, cut to 100 characters, and are otherwise kept as typed. Only counts are kept: how often each term was searched on each page each day, and never who searched it. See Privacy. With public stats, anyone can read the terms.

On the dashboard

The Site search section shows once the site has a rule or a search. Its Searches pane lists the terms, most searched first, with how often each found nothing. Click its heading for every term, with its searches and No results, the share that found nothing.

Each search counts on the page it was made from. When your searches come from more than one page, each term shows its page, and a term searched from two pages has a row for each:

TermPageSearches
potato/search/addresses12
potato/search/people5
leeks/search/people3

To see one page’s terms alone, click its page in the full view, or filter the dashboard by it. Typing a page into the view’s search box finds its terms too.

Single-page apps

Set data-search and data-search-results before moving to the results with history.pushState. history.replaceState counts no pageview, so a box that rewrites ?q= as the visitor types counts no search. For the back and forward buttons a rule is more reliable, as it reads the address. See Single-page apps.