Skip to main content

Ecommerce Tracking

Pro

All features on this page require Burst Statistics Pro. Learn more about WooCommerce Funnel Analytics.

Burst Statistics Pro includes ecommerce tracking for WooCommerce and Easy Digital Downloads. It records cart activity, order data, and visitor behaviour, then surfaces that data through four dashboards: Sales, Funnel, Quick Wins, and Top Performers.


Overview

When ecommerce tracking is active the plugin adds a should_load_ecommerce flag to the frontend tracking options, which instructs the JavaScript tracker to listen for cart and order events. Backend integrations (WooCommerce, EDD) fire two WordPress actions — burst_order_created and burst_cart_updated — which write to dedicated database tables.

Database tables

TablePurpose
{prefix}burst_ordersOne row per completed order
{prefix}burst_order_itemsOne row per line item in an order
{prefix}burst_cartOne active cart per visitor
{prefix}burst_cart_itemsItems currently in a cart

All monetary values stored in burst_orders and burst_order_items carry a conversion_rate column so that multi-currency stores can be normalised to the store's base currency in reports.


Actions

burst_order_created

Fired when a completed order should be recorded. The ecommerce integration (WooCommerce, EDD, or a custom integration) fires this action and passes the full order payload. Burst uses it to write rows to burst_orders and burst_order_items, then marks the visitor's active cart as converted.

Parameters:

ParameterTypeDescription
$dataarrayOrder data (see fields below)

$data fields:

KeyTypeRequiredDescription
currencystringYesISO 4217 currency code (e.g. 'USD')
totalfloatYesOrder total before tax
taxfloatNoTax amount (default 0.0)
platformstringYesIntegration identifier (e.g. 'WooCommerce', 'EDD')
conversion_ratefloatYesExchange rate relative to the store base currency (use 1.0 for single-currency stores)
productsarrayYesArray of product line items (see below)

Each item in products:

KeyTypeRequiredDescription
product_idintYesWordPress post ID of the product
amountintYesQuantity purchased
pricefloatYesUnit price of the product

Example:

do_action( 'burst_order_created', [
'currency' => 'USD',
'total' => 49.99,
'tax' => 4.50,
'platform' => 'WooCommerce',
'conversion_rate' => 1.0,
'products' => [
[
'product_id' => 42,
'amount' => 1,
'price' => 49.99,
],
],
] );
caution

The action silently returns without recording if platform, total, currency, or conversion_rate are empty, or if any product item is missing product_id, amount, or price. Check your integration logs if orders are not appearing in reports.


burst_cart_updated

Fired whenever the visitor's cart changes (items added, removed, or quantity changed). Pass an empty items array to delete the cart. Burst reconciles the full item list on every call — it replaces all existing cart items with the supplied array.

Parameters:

ParameterTypeDescription
$dataarrayCart data (see fields below)

$data fields:

KeyTypeDescription
itemsarrayFull current contents of the cart. Pass an empty array to clear the cart.

Each item in items:

KeyTypeRequiredDescription
product_idintYesWordPress post ID of the product
quantityintYesItem quantity (must be > 0)
pricefloatYesUnit price excluding tax (must be >= 0)

Example:

// Add or update items in the cart.
do_action( 'burst_cart_updated', [
'items' => [
[
'product_id' => 42,
'quantity' => 2,
'price' => 24.99,
],
],
] );

// Clear the cart (e.g. after order is placed through a custom flow).
do_action( 'burst_cart_updated', [ 'items' => [] ] );

Filters

burst_tracking_options

Burst adds a should_load_ecommerce key (value true) to the tracking options array passed to the frontend JavaScript tracker. You can inspect or override this behaviour using the existing burst_tracking_options filter.

Parameters:

ParameterTypeDescription
$optionsarrayTracking options passed to the frontend tracker

Example:

add_filter( 'burst_tracking_options', function( array $options ): array {
if ( is_page( 'staging-preview' ) ) {
$options['should_load_ecommerce'] = false;
}
return $options;
} );

burst_quick_wins_configs

Filters the full array of Quick Wins rule configurations before they are evaluated. Use this to add custom rules, modify thresholds, or remove built-in rules.

Parameters:

ParameterTypeDescription
$quick_winsarrayAssociative array of Quick Wins configs keyed by a unique string identifier

Each config entry supports the following keys:

KeyTypeDescription
typestringPriority level: 'critical', 'recommended', or 'opportunity'
datacallable|mixedCallable that receives $args (date_start, date_end, filters) and returns a numeric value, or a static value
conditionsarrayCondition definition with keys compare (>, >=, <, <=, ==, !=) and value (float threshold)
titlestringTranslated title shown in the dashboard. Use %d or %f as a placeholder for the actual metric value
messagestringTranslated description of the issue
recommendationstringTranslated recommended action
urlstring|nullOptional URL to related documentation or article

Example:

add_filter( 'burst_quick_wins_configs', function( array $configs ): array {
$configs['high_homepage_bounce'] = [
'type' => 'critical',
'data' => function( array $args ): ?float {
return my_plugin_get_homepage_bounce_rate( $args );
},
'conditions' => [
'compare' => '>',
'value' => 80.0,
],
'title' => __( 'Homepage bounce rate is %f%%', 'my-plugin' ),
'message' => __( 'A high homepage bounce rate may indicate a poor first impression.', 'my-plugin' ),
'recommendation' => __( 'Review your homepage hero section and calls to action.', 'my-plugin' ),
'url' => null,
];
return $configs;
} );
Breaking change

Changed in v3.3.0: All built-in Quick Wins queries now JOIN burst_sessions to resolve device_id, browser_id, and first_time_visit. Custom data callables that reference statistics.first_time_visit directly in SQL must be updated to sessions.first_time_visit. Similarly, any direct references to statistics.device_id or statistics.browser_id must be updated to sessions.device_id / sessions.browser_id.

caution

Quick Wins are only evaluated after ecommerce tracking has been active for at least 7 days. Rules with a data callable that throws an exception are skipped and logged, but do not halt other rules.


Sales analytics

The Sales dashboard shows four key metrics for the selected date range, each compared to the equivalent previous period of the same length.

MetricDescription
Conversion RatePercentage of unique visitors who completed a purchase (converted / visitors × 100)
Abandoned CartsPercentage of carts that were not converted and have been inactive for more than 30 minutes (abandoned / total_carts × 100)
Average Order ValueMean revenue per order in the store's base currency, normalised using each order's conversion_rate
RevenueTotal revenue across all orders in the base currency, normalised using each order's conversion_rate

Each metric is returned with current, previous, and rate_change keys. rate_change is null when either period has no data.

A cart is classified as abandoned only when its updated_at timestamp is more than 30 minutes in the past and converted = 0. Carts updated within the last 30 minutes are still considered active and excluded from the abandonment count.

The data layer functions that assemble Sales and Top Performers payloads (modify_product_data() and get_ecommerce_data()) both guard with user_can_view_sales() and return the unmodified data array immediately if the check fails. Changed in v3.3.0: this capability check is enforced at the data layer in addition to the REST API permission callback.

Breaking change

Changed in v3.3.0: view_sales_burst_statistics is no longer automatically granted to burst_viewer on share-link access. Share-link visitors can only see ecommerce/sales data if the share link was created with the Sales tab explicitly included in its shared tabs. Existing share links that were generated before v3.3.0 will silently block sales data unless they are regenerated with the Sales tab enabled.


Funnel tracking

The Funnel dashboard visualises the five stages of the purchase journey. Each stage returns the count of unique visitors (uid) who reached that stage within the selected date range.

StageIDDescription
Visitors started sessionvisitsAll unique visitors in the date range
Viewed a productproduct_page_viewsVisitors who viewed a page with page_type = 'product' or page_type = 'download', or the configured product archive page
Added to cartadd_to_cartVisitors who have at least one burst_cart_items row with added_at within the range
Started checkoutcheckout_visitsVisitors who viewed the configured WooCommerce/EDD checkout page
PurchasedconversionsVisitors who have at least one row in burst_orders linked to their statistics record

Drop-off between stages is calculated on the frontend from the raw counts.


Quick Wins

Quick Wins are automated insights that surface when a metric crosses a configured threshold. They are calculated once per day via a WordPress cron chain and cached in the burst_quick_wins option.

Each rule examines data from the last 31 days (31 days ago 00:00:00 through yesterday 23:59:59). If the ecommerce activation date falls within that window, the window is trimmed to start at the activation date.

Built-in metrics evaluated by Quick Wins

The following metrics are computed internally and can also be re-used in custom rules via the burst_quick_wins_configs filter. All methods accept an $args array with date_start (int, Unix timestamp), date_end (int, Unix timestamp), and filters (array).

Changed in v3.3.0: all underlying queries for these metrics JOIN burst_sessions on statistics.session_id = sessions.ID to resolve device_id, browser_id, and first_time_visit. The first_time_visit condition is now evaluated against sessions.first_time_visit rather than statistics.first_time_visit.

MethodReturn typeDescription
get_cart_abandonment_rate( $args )float|nullCart abandonment rate as a percentage
get_checkout_completion_rate( $args )float|nullPercentage of checkout page visitors who converted
get_avg_checkout_completion_time( $args )int|nullAverage time spent on the checkout page in seconds
get_safari_checkout_abandonment_delta( $args )float|nullDifference in abandonment rate between Safari and all browsers combined (percentage points)
get_cart_drop_off_rate( $args )float|nullPercentage of visitors who did not add anything to their cart
get_cart_to_checkout_rate( $args )float|nullPercentage of cart starters who did not convert (cart exit rate)
get_average_order_value( $args )float|nullAverage order value in the store currency (not normalised)
get_email_campaign_conversion_rate( $args )float|nullConversion rate of visitors arriving via email campaigns
get_returning_customer_rate( $args )float|nullPercentage of orders from customers who had a prior converted cart
get_new_visitor_conversion_rate( $args )float|nullConversion rate of first-time visitors
get_returning_vs_new_visitor_cr_ratio( $args )float|nullRatio of returning-visitor CR to new-visitor CR
get_home_page_bounce_rate( $args )float|nullBounce rate on the homepage (/)
get_product_page_exit_without_add_to_cart_rate( $args )float|nullPercentage of product/download page visitors who left without adding to cart
get_single_product_exit_rate( $args )float|nullPercentage of visitors who viewed exactly one product/download page and left without adding to cart
get_avg_session_duration( $args )float|nullAverage session duration in seconds
get_mobile_vs_desktop_conversion_ratio( $args )float|nullRatio of mobile+tablet CR to desktop CR

Dismissing and snoozing Quick Wins

Users can dismiss or snooze individual Quick Wins from the dashboard. Dismissed IDs are stored permanently in burst_quick_win_dismissed_wins. Snoozed IDs are stored in burst_quick_win_snoozed_wins as a map of id => unix_expiry_timestamp. The default snooze period is 30 days.


Top Performers

The Top Performers dashboard shows the single highest-revenue entry in four dimensions for the selected period, with a comparison to the previous period of the same length.

DimensionIDFields returned
Top producttop-productproduct_id, product_name, total_quantity_sold, total_revenue, currency
Top campaigntop-campaigncampaign_id, campaign_name, total_quantity_sold, total_revenue, currency
Top countrytop-countrycountry_code, total_quantity_sold, total_revenue, currency
Top devicetop-devicedevice_name, total_quantity_sold, total_revenue, currency

Each dimension returns current, previous, and revenue_change keys. revenue_change is null when either period has no orders. Revenue figures are normalised to the store's base currency using each order's conversion_rate.

For product variations, the product name is formatted as Parent Product Name (Variation Description).

Changed in v3.3.0: the top-device query (and all Top Performers dimension queries) now JOIN burst_sessions on sessions.ID = statistics.session_id and resolve device_id via sessions.device_id rather than statistics.device_id.


WordPress cron events

Event hookTriggerDescription
burst_dailyDailySchedules the Quick Wins processing chain
burst_process_quick_wins_single_eventChained, 1 minute apartEvaluates one Quick Win rule per invocation; schedules the next index until all rules are processed