StatJolt WordPress plugin
The StatJolt WordPress plugin adds your tracking code to every page of your site. You paste the code once. The plugin works out where it belongs, checks that data is really arriving and clears your cache so your visitors get the new page right away.
Install it in four steps
- Download the plugin. Keep the zip file as it is. Do not unpack it.
- In your WordPress admin open Plugins, then Add New Plugin, then Upload Plugin. Choose the zip, install it, then activate it. The plugin takes you straight to its settings screen.
- Open your StatJolt account, press the copy button under your code, then paste it into the field and save.
- Open your site in a private window. The status turns green once the first visit arrives.
You can paste the whole snippet, only the script line or only the number. All three work.
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.
- 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.
- Grey. I could not reach statjolt.com just now. Try again in a minute.
Where the badge goes
StatJolt shows a small badge on your site. You choose its position in your StatJolt account, not in the plugin.
If your badge floats, its position is fixed to a corner of the screen so the plugin does not ask you anything. It puts the code at the bottom of the page, where it interferes with nothing.
If your badge sits in the page flow, the plugin asks where you want it and offers whatever your theme actually has:
- A sidebar or a footer widget column. The plugin lists the widget areas your theme registers, by name. Each footer column is its own area so you pick the exact column.
- The bottom of the page. This always works but the badge lands outside your layout, at full width. On most themes that looks wrong so treat it as a fallback.
- The
[statjolt_badge]shortcode. Put it exactly where you want the badge. On a block theme, drag the Shortcode block into your footer template part in the Site Editor.
Whichever you pick, pages that do not render that container still get the code at the bottom. Nothing goes unmeasured.
What if your theme is unusual
Nothing to do. The plugin tries three places in order and stops at the first one that works.
- Your theme calls
wp_footer, which nearly every theme does so the code goes there. - Your theme never calls it so the code goes before the closing body tag.
- Your theme does not even have a closing body tag so the code goes at the very end of the page.
There is no setting for this and no mode to switch on. The plugin decides while the page is being built, when it already knows what the theme did.
Caching
The code the plugin adds is the same for every visitor so you do not need to exclude anything from your cache.
After you save your ID, the plugin clears the whole cache for you. It knows WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, WP Fastest Cache, SiteGround Optimizer, Hummingbird, Breeze, Cache Enabler, Autoptimize and WP Engine. If you use something else or a CDN, clear it yourself once.
One limit worth knowing. Skipping logged in users works only while your cache serves them uncached pages. Every common caching plugin does that by default.
Who is not counted
One checkbox, ticked by default: Do not measure logged in users. That keeps your own visits out of your numbers. Untick it if you do want to count people who are signed in.
Feeds, REST responses, previews, the customizer and the login page never get the code.
Multisite
The network settings screen sets one StatJolt ID for every site in the network. Each site can override it with its own ID.
One thing to plan around: on a subdirectory network all subsites share a single domain. StatJolt identifies a site by its domain so it merges those subsites into one site with one set of numbers. A subdomain network does not have this limit.
No data is arriving
Work through these in order.
- Open your site in a private window, then press Check again on the settings screen.
- Look at the page source and search for
c.min.js. If it is not there, check that the ID on the settings screen is not empty. - Clear your cache, including your CDN.
- Check that the number on the settings screen matches the one in your StatJolt account.
- Turn off any ad blocker in the browser you test with.
StatJolt on other platforms
Running Joomla, Drupal or Webflow somewhere too? There is a Joomla plugin, a Drupal module and a Webflow guide as well. The same account and the same snippet cover every site you own.
Questions
Write to me from the contact page.