Burst Statistics can also be used headless: you don’t install Burst Statistics on your main website, but set up a separate WordPress website with Burst Statistics. This offloads the data base and tracking processing to a separate webserver, much like Google Analytics does. This offers the advantage that the main site does not have to handle the additional hits, and you can separate the database from the main website.
Using this method, you can even use Burst Statistics on a website without WordPress!
This guide walks you through the full setup. Please note: these instructions apply to Burst versions of 3.3.0 and higher. In 3.3.0, it is only available in beta. To install it, go to settings, advanced, and enable the “beta versions” setting. Within 24 hours you should now see the update available to the latest beta version.
How it works
In a headless setup, the Burst tracking script is loaded by your frontend, not by WordPress. The script sends pageview and event data to the REST API endpoint on your WordPress installation. Because the request originates from a different domain, you need to explicitly allow that domain via CORS headers.
Burst handles this through two constants you define in wp-config.php.
Note: it is not possible to use hook goal tracking with a headless setup without WordPress on the client.
Step 1: Install Burst Statistics
Install and activate the Burst Statistics plugin on the WordPress installation that will act as your analytics backend. This does not need to be the same server as your frontend.
Step 2: Configure wp-config.php
Add the following constants to your wp-config.php, above the line that reads /* That's all, stop editing! */.
BURST_HEADLESS
This constant tells Burst that it is running in headless mode. When enabled, Burst combines all tracking variables and the tracking script into a single minified file that is easy to embed externally.
define( 'BURST_HEADLESS', true );
BURST_HEADLESS_DOMAIN
This constant defines which domains are allowed to send tracking data to your WordPress backend. Burst uses this to set the correct Access-Control-Allow-Origin CORS headers. Without this, the browser will block cross-origin requests from your frontend.
define( 'BURST_HEADLESS_DOMAIN', 'https://my-frontend.com' );
Security note: Burst operates in strict mode when BURST_ALLOWED_ORIGINS is defined. Any request that comes from an origin not on this list will be rejected with a 403 response. Only add domains you control.
Step 3: configure settings
You can now configure the plugin to your liking. The setting turbo mode will be embedded in the zip plugin, so if you want to change this later, you’ll need to download the client plugin zip again.
You can use cookieless tracking, but because of technical limitations you can’t use hook goals when cookieless tracking is enabled. With cookies, or other goal types this will work without issues.
Step 4: Choose your setup
If you have WordPress on your client website, go to step 5. If you have a non WordPress client website, go to step 5, non WordPress website.
Step 5a, WordPress website: Download the client plugin
In the Burst Settings, go to Advanced and click “Download” next to “Download Burst Client plugin”.
Step 5b: Install the Client plugin on your front-end website
The downloaded zip file contains the configuration for your front-end website that you have entered in BURST_HEADLESS_DOMAIN. You can install it like any other WordPress plugin.
Step 5, non WordPress: embed the snippet
Embed these snippets in your website’s html:
<script async src="https://your-domain.com/wp-content/plugins/burst-pro/assets/js/timeme/timeme.min.js"></script>
<script defer src="https://your-domain.com/wp-content/uploads/burst/js/burst.min.js"></script>