Custom events let you count the interactions that matter on your site and that a pageview doesn’t show: a brochure download, a newsletter signup, a pricing toggle or a video play. You send the event with one line of JavaScript or PHP and Burst counts it in the Events block on the Engagement page.
This guide explains how to turn custom events on, how to send them and what each plan does with them. Counting events works in the free Burst Statistics plugin. Event properties, event goals and capturing Google Analytics events need Burst Pro.
When to use a custom event
Burst already tracks pageviews, outgoing links, form submissions and site searches without any code. Use a custom event for everything else: an interaction your theme or a plugin handles in the browser or on the server, without loading a new page.
- A visitor opens the size chart on a WooCommerce product
- A visitor switches the pricing table from monthly to yearly
- A visitor plays the intro video on your homepage
- A new user creates an account
Turn on custom events
Custom events are off by default, so Burst doesn’t load the extra script on sites that don’t use them.
- Go to Burst > Settings > Features
- Turn on Track custom events
- Save your settings
While the setting is off, Burst ignores every event your site sends. The Events block on the Engagement page tells you when that’s the case.
Send an event from JavaScript
Call burst.event() with a name. This example counts clicks on a brochure download button:
document.querySelector( '.brochure-download' )?.addEventListener( 'click', () => {
burst.event( 'brochure_download' );
} );
You can also pass a number as the value and an object with properties. Both are optional.
// Name only.
burst.event( 'newsletter_signup' );
// Name and properties.
burst.event( 'pricing_toggle', { billing: 'yearly' } );
// Name, value and properties.
burst.event( 'quote_requested', 1200, { package: 'wedding' } );
Calling burst.event() before the Burst script has loaded is safe. Burst queues the call and records it once the script is ready, so you don’t have to worry about script order.
A plugin or theme that doesn’t want to depend on the burst object can dispatch a browser event instead. Burst picks it up the same way:
document.dispatchEvent(
new CustomEvent( 'burst_event', {
detail: { name: 'video_play', properties: { video: 'homepage-intro' } },
} )
);
Burst doesn’t send a request for every event. It sends the events along with the next request it already makes for that page, for example when the visitor leaves the page or switches tabs. This keeps the number of requests on your server low.
Send an event from PHP
Some interactions only happen on the server, such as creating an account. Fire the burst_event action with a name:
add_action(
'user_register',
function () {
do_action( 'burst_event', 'account_created' );
}
);
Properties and a value work the same as in JavaScript:
// Name and properties.
do_action( 'burst_event', 'account_created', array( 'role' => 'customer' ) );
// Name, value and properties.
do_action( 'burst_event', 'quote_requested', 1200, array( 'package' => 'wedding' ) );
Burst adds a server event to the visitor’s most recent pageview. To find that visitor, the action has to run during a request from the visitor’s own browser, like a form submission or a registration. An action fired from a cron job or from a webhook that a payment provider sends to your site has no visitor attached, so Burst doesn’t record it.
Choose good event names
Burst stores event names in lowercase and keeps only letters, numbers, underscores and hyphens. Other characters, including spaces, are removed, so “Newsletter Signup” becomes newslettersignup. Write names in lowercase with underscores from the start and the name in your code matches the name in your dashboard.
- Use one name per interaction, such as
brochure_download, and put the details in properties - Don’t put changing data in the name, such as an order number or a user ID. Every unique name becomes a new row in your report
- Keep names under 64 characters. Burst cuts off anything longer
See your events
Go to Burst > Statistics > Engagement. The Events block lists your most frequent events with the number of times each one happened in the selected date range. Click the expand button in the block heading to open the full list.
The block follows the filters you set on the dashboard. Filter on a page, a referrer or a device and the block only counts events from visits that match.
Burst stores the value you send with an event, but the dashboard reports how often an event happened, not the total of its values.
What Burst Pro adds
The free plugin counts events by name. Burst Pro adds three things on every plan: Creator, Business and Agency.
Event properties
Properties tell you more about each event. Send { billing: 'yearly' } with a pricing toggle and you see how many visitors switched to yearly and how many to monthly. In the free plugin Burst records the event and leaves the properties out.
To see them, open the full Events list and expand an event row. Burst shows each property with its values and how often each value occurred.
Goals based on an event
A goal turns an event into a conversion, so you can see which pages, sources and campaigns lead to it. Create a goal with the Custom event type and enter the event name.
- Go to Burst > Settings > Goals and add a goal
- Choose Custom event as the goal type
- Under Which event name do you want to track?, enter the name you send, such as
newsletter_signup - Save the goal
Every time Burst records an event with that name, the goal counts a conversion. The goal matches on the name only: properties and the value don’t affect it. Burst cleans up the name in the goal the same way as the event name, so “Newsletter Signup” in the goal still matches newslettersignup.
Events you already send to Google Analytics
Many plugins already send events to Google Analytics or Google Tag Manager. Burst Pro can count those too, without extra code. Turn on Track Google Analytics / Google Tag Manager events under Settings > Features.
Burst then records every event pushed to dataLayer or sent with gtag( 'event', … ) after the Burst script has loaded. A numeric value parameter becomes the event value. Standard Google Analytics parameters, such as currency, item_name and search_term, become properties. To store your own parameters as well, turn on Store your own Google Analytics / Tag Manager parameters.
Privacy and consent
Events follow the same consent rules as the rest of Burst. When your consent setup says a visitor hasn’t agreed to tracking, burst.event() sends nothing. Events are tied to a visit, not to a person, and Burst stores them in your own WordPress database.
Don’t send personal data in an event name or property, such as an email address or a name. Properties are meant for categories like a plan, a package or a video title.
Limits
Burst caps events to keep your database small and to stop a broken script or a bot from flooding your statistics.
- Up to 10 events per pageview. Burst drops events above that until the next request is sent
- Up to 300 events per visitor per hour
- Up to 500 different event names. Burst counts new names above that under
(other) - Up to 10 properties per event, with values of up to 255 characters. Properties are flat: a nested object or array is skipped (Pro)
- Up to 200 different property names and 2,000 different values per property. Burst counts new values above that under
(other)(Pro)
Troubleshooting
If an event doesn’t show up in the Events block, check these in order:
- Track custom events is turned on. With the setting off and debug mode on, your browser console says the event was not recorded
- You visited the page as a visitor Burst tracks. Burst doesn’t track excluded user roles or IP addresses, so log out or use a private window
- You left the page or switched tabs after triggering the event. Burst sends events with the next request, not right away
- The event name in your report is the cleaned-up version of the name you sent. Look for it in lowercase, without spaces
- For a PHP event, the action ran during a request from the visitor’s browser, not from cron or a webhook