Drupal analytics module

The StatJolt Drupal analytics module adds your tracking code to every page of your site.

The statistics are cookieless. So you don't need a cookie banner, because there is no personal data. Nothing is written to your Drupal database either. So your table sizes stay unchanged. That helps if you have heavy traffic, or if you take backups often.

Install it in four steps

  1. Download the module from StatJolt's website and unpack it into your site's modules folder.
  2. Open Administration, then Extend. Search for StatJolt, tick it and install it.
  3. Open Administration, then Configuration, then System, then StatJolt Analytics. Open your StatJolt account, press the copy button under your code, then paste it into the field and save.
  4. Open your site in a private window. The status turns green once your first visitor arrives and you press Check again.

The download is a zip file. Unpack it so that the statjolt folder itself lands in modules, with the file statjolt.info.yml inside it.

What the status colours mean

  • Green. Data is arriving. Nothing to do.
  • Amber, waiting for your first visitor. The code is in place but nobody has loaded a page yet. Open your site in a private window.
  • Amber, no visit seen from your domain. The code is saved but StatJolt has not received anything from this address. Check that you pasted your own code, then clear your cache.
  • Amber, StatJolt could not be reached. Your server could not call statjolt.com just now. Tracking still runs. Press Check again in a minute.
  • Red, the ID does not exist. The number you pasted belongs to no StatJolt account. Copy your code again.
  • Red, the domain is switched off. You marked this domain as not yours in your StatJolt account. Turn it back on in your site list.

The screen also warns you on the status report while no code is pasted so an unfinished setup does not go unnoticed.

Which Drupal versions it works on

Drupal 10 and Drupal 11. The module is written against the current APIs so it needs no compatibility layer.

The module ships with its interface in nine languages: English, Hungarian, German, Spanish, French, Portuguese, Italian, Dutch and Polish.

Where the code goes

Nothing to configure. The module writes the code into the finished response, immediately before the closing body tag, on every front end page.

You cannot break it by placing the badge twice either. The tracking code goes in from one place only so double counting is not possible.

Where the badge goes

StatJolt shows a small badge on your site. By default it places itself in a corner of the screen and the module asks you nothing.

When you want it somewhere specific, you have two ways. Place the StatJolt badge block in any region from Block layout, the same way you place any other block. Or put the {statjolt_badge} token in your text and enable the StatJolt badge filter on that text format.

Give the filter a high weight so it runs after the filter that limits allowed HTML.

Caching

The code the module adds is the same for every visitor.

Saving your ID clears the cached pages that hold the old code. Drupal does this on its own. There is nothing to purge by hand. If you also run a CDN or a reverse proxy in front of Drupal, clear that one too.

Skipping logged in users is safe under caching too.

Who is not counted

Logged in users are skipped. You can turn that off with a single checkbox if you want to see your own visits.

Likewise it does not measure anything that is not an HTML page, such as JSON responses, ajax calls, feeds and file downloads.

What the module stores

Your settings and nothing else. They live in one configuration object, the same place every other module keeps its settings.

There are no custom tables and no per visit writes. That is exactly the point. Many analytics extensions log to your own database, so every page view turns into a database write. All of that ends up in your backups too, and it can slow your website down.

Raw IP addresses never reach disk on the StatJolt side either. The visitor identifier is a hash that is regenerated with a new salt every midnight so yesterday's visitor cannot be matched to today's. The full detail is in the privacy policy.

If you are coming from Google Analytics

You do not need to keep both running. StatJolt replaces the page view, source, page and device reporting you were using GA4 for. It adds Core Web Vitals, funnels and user journeys that GA4 either buries or does not have. There is a fuller comparison in the GA4 alternative guide.

StatJolt sets no cookies and collects no personal data so most sites need no consent banner at all. The legal side is in Google Analytics and the GDPR.

Running WordPress, Joomla or Webflow somewhere too? There is a StatJolt WordPress plugin, a Joomla plugin and a Webflow guide as well. The same account and the same snippet cover every site you own.

Replace GA4 in 2 minutes

Just paste the code and see how much clearer it gets. No cookies, no banner, no consent tool. 0 EUR until 2027, at any traffic level.

Or keep the other path: maintaining a consent tool, modelled data and half an hour a month spent digging through reports.

Get my free account