Alpha Insights 2.2.0 has 19 actions and 76 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Alpha Insights fires an action
add_action( 'wpd_ai_before_render_dashboard', function( $dashboard_id, $dashboard_config ) {
// Your code runs here.
}, 10, 2 );
// Change a value Alpha Insights is about to use
add_filter( 'wpd_ai_custom_product_cost_default_value', function( $default_calculated_value, $custom_cost_slug, $arg3, $item ) {
// Change $default_calculated_value here.
return $default_calculated_value;
}, 10, 4 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Sets the default custom cost value for a custom product cost. This will be * overriden by the meta field input */ apply_filters( 'wpd_ai_custom_product_cost_default_value', $default_calculated_value, $custom_cost_slug, $item->get_order(), $item ); -
/** * Filters the line item meta keys checked for per-unit COGS when * _wpd_ai_product_cogs is not set. */ apply_filters( '_wpd_ai_line_item_cost_per_unit_meta_keys', array(), $this->order, $item ); -
/** * Overrides the total product COGS for the order after line items are summed. */ apply_filters( '_wpd_ai_override_total_product_cost', $total_product_cogs, $this->order ); -
/** * Query the analytics data from the DB with batching */ apply_filters( 'wpd_ai_analytics_data_fetch_batch_size', 10000 ); -
/** * Action: wpd_ai_before_render_dashboard */ do_action( 'wpd_ai_before_render_dashboard', $dashboard_id, $dashboard_config ); -
/** * Filters all the calculation values after the function is complete but before * it has been returned or saved to meta */ apply_filters( 'wpd_ai_calculate_cost_profit_by_order', $this->results, $this->order ); -
/** * Allow filtering the cost price This is useful for customizing the cost price * for a product */ apply_filters( 'wpd_ai_cost_price_per_unit', $cost_price_per_unit, $product_id ); -
/** * Allow filtering of the custom order cost value, takes preference over the * default settings but is overriden by the stored meta value. */ apply_filters( 'wpd_ai_custom_order_cost_default_value', $custom_cost_value, $cost_slug, $this->order ); -
/** * Generate a list of custom product cost options for use by Alpha Insights * Expects an associative array in format array( unique_slug => array(key => * 'Value') ) in key value pairs. The available keys are: label, description, * placeholder, static_fee, percent_of_sell_price */ apply_filters( 'wpd_ai_custom_product_cost_options', $custom_product_costs, $product_id ); -
/** * Allow setting a default custom cost price meta key */ apply_filters( 'wpd_ai_default_product_cost_price_meta_keys', array( '_cogs_total_value', '_wc_cog_cost', '_alg_wc_cog_cost', '_purchase_price', '_cost_of_goods' ) ); -
/** * Filter: wpd_ai_localized_report_builder_variables */ apply_filters( 'wpd_ai_localized_report_builder_variables', $localized_variables ); -
/** * Filter event types shown in the order browsing history modal. */ apply_filters( 'wpd_ai_order_browsing_history_event_types', $types ); -
/** * Filters the default payment gateway cost of an order */ apply_filters( 'wpd_ai_order_payment_gateway_cost_default_value', $payment_gateway_cost, $this->order ); -
/** * Filters the default shipping cost of an order (this is an expense, not the * amount charged to the customer) */ apply_filters( 'wpd_ai_order_shipping_cost_default_value', $shipping_cost, $this->order ); -
/** * Also, lets call any other notices we want at this point */ do_action( 'wpd_ai_output_additional_notices' ); -
/** * Default -1 matches no WooCommerce post ID when used in queries. Override via * {@see 'wpd_ai_product_filter_unresolved_sentinel_id'}. */ apply_filters( 'wpd_ai_product_filter_unresolved_sentinel_id', -1 ); -
/** * Hook in for custom settings */ do_action( 'wpd_ai_register_settings' ); -
/** * Filter to register custom data sources */ apply_filters( 'wpd_alpha_insights_register_data_sources', array() ); -
/** * Filter reserved entity names for the data source registry */ apply_filters( 'wpd_alpha_insights_reserved_entity_names', $default ); -
/** * Action hook to schedule recurring events. */ do_action( 'wpd_schedule_recurring_events', $this ); -
/** * Hook in for custom settings pages */ do_action( 'wpd_settings_page_content', $subpage, $wpd_action ); -
/** * Filter email template styles */ apply_filters( 'wpdai_email_template_styles', $email_styles ); -
apply_filters( 'wpd_session_timeout_seconds', 30 * MINUTE_IN_SECONDS ); -
do_action( 'wpd_before_content' ); -
do_action( 'wpd_before_heading' ); -
apply_filters( 'wpd_ai_event_data_before_insertion', $data ); -
apply_filters( 'wpd_ai_event_tracking_block_request_by_data', $block_request, $data ); -
apply_filters( 'wpd_ai_event_tracking_enable_logging', false ); -
apply_filters( 'wpd_ai_report_filters_query_parameter_picker_max_keys', 20 ); -
wpd_ai_report_filters_query_parameter_picker_max_values_per_key
filter Copy link Customise this hookapply_filters( 'wpd_ai_report_filters_query_parameter_picker_max_values_per_key', 50 ); -
apply_filters( 'wpd_alpha_insights_data_source_refunds', $refunds_data, $data_warehouse ); -
apply_filters( 'wpd_attribution_timeout_seconds', $seconds ); -
do_action( 'litespeed_control_set_nocache', 'alpha-insights-experiment' ); -
do_action( 'litespeed_purge_all', 'alpha-insights-experiment' ); -
do_action( 'litespeed_purge_url', $url ); -
do_action( 'qm/debug', $debug ); -
apply_filters( 'woocommerce_currency_symbols', array( 'AED' => 'د.إ', 'AFN' => '؋', 'ALL' => 'L', 'AMD' => 'AMD', 'ANG' => 'ƒ', 'AOA' => 'Kz', 'ARS' => '$', 'AUD' => '$', 'AWG' => 'ƒ', 'AZN' => 'AZN', 'BAM' => 'KM', 'BBD' => '$', 'BDT' => '৳ ', 'BGN' => 'лв.', 'BHD' => '.د.ب', 'BIF' => 'Fr', 'BMD' => '$', 'BND' => '$', 'BOB' => 'Bs.', 'BRL' => 'R$', 'BSD' => '$', 'BTC' => '฿', 'BTN' => 'Nu.', 'BWP' => 'P', 'BYR' => 'Br', 'BZD' ... ); -
apply_filters( 'wpd_ai_all_integrations_for_display', $merged ); -
apply_filters( 'wpd_ai_cache_safe_tracking_enabled', true ); -
apply_filters( 'wpd_ai_child_page_register', $child_pages ); -
apply_filters( 'wpd_ai_cookie_domain', $host ); -
apply_filters( 'wpd_ai_cookie_storage_mode', $mode ); -
apply_filters( 'wpd_ai_debug_sessions_batch_size', 500 ); -
apply_filters( 'wpd_ai_debug_sessions_export_limit', 25000 ); -
apply_filters( 'wpd_ai_debug_sessions_per_page', 100 ); -
apply_filters( 'wpd_ai_event_table_columns', $columns ); -
apply_filters( 'wpd_ai_event_tracking_prevent_foreign_referrals', false ); -
do_action( 'wpd_ai_experiment_bypass_cache' ); -
do_action( 'wpd_ai_experiment_run_php_snippet', $variant['php'], $experiment, $variant ); -
apply_filters( 'wpd_ai_experiments_variant_stats', array_values( $variant_rows ), $data_warehouse ); -
apply_filters( 'wpd_ai_find_product_ids_by_string_search_per_query_limit', 100 ); -
apply_filters( 'wpd_ai_find_product_ids_by_string_search_results', $ids, $search_value ); -
apply_filters( 'wpd_ai_find_product_ids_by_string_search_total_limit', 250 ); -
apply_filters( 'wpd_ai_integration_metadata', $this->integration_metadata ); -
apply_filters( 'wpd_ai_is_valid_reporting_utm_key', $is_valid, $key ); -
apply_filters( 'wpd_ai_is_valid_reporting_utm_key_value_pair', $valid, $key, $value ); -
apply_filters( 'wpd_ai_is_valid_reporting_utm_value', $valid, $value ); -
apply_filters( 'wpd_ai_is_wpd_page', $bool ); -
apply_filters( 'wpd_ai_native_support_plugins', $items ); -
do_action( 'wpd_ai_order_attribution_table_rows', $order ); -
apply_filters( 'wpd_ai_order_browsing_history_session_limit', 80 ); -
do_action( 'wpd_ai_order_dashboard_before_content', $order ); -
do_action( 'wpd_ai_output_plugin_activity_notices' ); -
apply_filters( 'wpd_ai_override_attribution_on_new_utm', $enabled ); -
apply_filters( 'wpd_ai_payment_gateway_fee_meta_keys', $payment_gateway_fee_meta_keys ); -
apply_filters( 'wpd_ai_ppom_cost_input_types', $types ); -
do_action( 'wpd_ai_product_cost_of_goods_tab_content_before_content', $product ); -
do_action( 'wpd_ai_register_integration_metadata', $this ); -
do_action( 'wpd_ai_register_integrations', $this ); -
apply_filters( 'wpd_ai_registered_integrations', $this->integrations ); -
apply_filters( 'wpd_ai_report_filters_batch_size', $this->batch_size ); -
apply_filters( 'wpd_ai_report_filters_is_transient_enabled', $this->is_transient_enabled ); -
apply_filters( 'wpd_ai_report_filters_products_picker_limit', 100 ); -
apply_filters( 'wpd_ai_report_filters_query_parameter_search_max_batches', 25 ); -
apply_filters( 'wpd_ai_report_filters_short_circuit_products_picker', true ); -
apply_filters( 'wpd_ai_report_filters_users_should_sort', false ); -
apply_filters( 'wpd_ai_review_min_days_active', self::MIN_DAYS_ACTIVE ); -
apply_filters( 'wpd_ai_review_min_report_views', self::MIN_REPORT_VIEWS ); -
apply_filters( 'wpd_ai_save_settings', $saved ); -
apply_filters( 'wpd_ai_session_data_chunk_size', $base_chunk_size ); -
apply_filters( 'wpd_ai_session_heartbeat_seconds', 15 ); -
apply_filters( 'wpd_ai_session_tracking_enable_logging', false ); -
apply_filters( 'wpd_ai_show_product_variations', true ); -
apply_filters( 'wpd_ai_valid_reporting_utm_keys', $valid_utm_keys ); -
apply_filters( 'wpd_ai_webhooks_enable_logging', ! empty( $option_value ) ); -
apply_filters( 'wpd_alpha_insights_data_source_analytics', $analytics_data, $data_warehouse ); -
apply_filters( 'wpd_alpha_insights_data_source_sales', $sales_data, $data_warehouse ); -
apply_filters( 'wpd_alpha_insights_data_source_store_profit', $store_profit_data, $data_warehouse ); -
apply_filters( 'wpd_alpha_insights_refund_ids_to_skip', array(), $refund, $data_warehouse ); -
apply_filters( 'wpd_alpha_insights_skip_refunds_without_parent', true, $refund, $data_warehouse ); -
apply_filters( 'wpd_woocommerce_currency_symbol', $currency_symbol, $currency );
Generated from Alpha Insights's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: