Filters

slimstat_custom_wpdb

Applies to SlimStat 6.0.0 and SlimStat Pro 3.0.0 · checked

This filter receives the analytics database connection, initially WordPress’s $wpdb. Return a compatible wpdb connection. Core table names use the current WordPress prefix; this hook does not provide arbitrary table naming. Pro copies the WordPress prefix and blog context to its external connection. Tracking, reporting, schema work and maintenance must use the same connection. Pro provides a settings-based external database option.

Callback signature

add_filter( 'slimstat_custom_wpdb', function ( $db ) {
    return $db;
} );

Test callbacks on staging with your tracking mode and report context. See the database API and building an add-on.