CAOS icon
Analytics & Tracking

CAOS hooks reference

  • By Daan van den Bergh
  • v5.0.3
  • Updated

CAOS 5.0.3 has 14 actions and 34 filters, read directly from its source code on Nov 17, 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.

functions.phpyour child theme
// Run your own code when CAOS fires an action
add_action( 'caos_add_script_after_tracking_code', function( $handle, $arg2 ) {
	// Your code runs here.
}, 10, 2 );

// Change a value CAOS is about to use
add_filter( 'caos_cloudflare_compatibility', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

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

  • includes/frontend/class-tracking.php line 504
    /**
     * Allow WP DEVs to add additional JS after Gtag tracking code.
     */
    do_action( 'caos_add_script_after_tracking_code', $this->handle, CAOS::get( CAOS_Admin_Settings::CAOS_BASIC_SETTING_MEASUREMENT_ID ) );
  • includes/class-compatibility.php line 41
    /**
     * Always run Cloudflare compatibility, because it shouldn't do any harm.
     */
    apply_filters( 'caos_cloudflare_compatibility', true );
  • includes/frontend/class-tracking.php line 299
    /**
     * Allow WP Dev's to halt the rendering of the tracking code, effectively
     * excluding the page from tracking. Example:
     * add_filter('caos_exclude_from_tracking', '__return_true');
     */
    apply_filters( 'caos_exclude_from_tracking', false );
  • includes/frontend/class-tracking.php line 491
    /**
     * Allow WP DEVs to add additional JS before Gtag tracking code.
     */
    do_action( 'caos_inline_scripts_before_tracking_code', $this->handle, CAOS::get( CAOS_Admin_Settings::CAOS_BASIC_SETTING_MEASUREMENT_ID ) );
  • includes/frontend/class-tracking.php line 326
    /**
     * Allows WP DEV's to modify the output of the tracking code. E.g.
     * add_action('caos_process_settings', 'your_function_name');
     */
    do_action( 'caos_process_settings' );
  • includes/class-caos.php line 470
    /**
     * Additional update actions can be added here.
     */
    do_action( 'caos_update_settings' );
  • includes/class-caos.php line 449
    /**
     * Any options that're better off in their own DB row (e.g. due to size) can be
     * added using this filter.
     */
    apply_filters( 'caos_update_settings_serialized', [ 'caos_settings', ] );
  • includes/admin/class-settings.php line 159 · used in 5 places
    apply_filters( 'caos_settings_page_title', 'CAOS' );
  • includes/admin/settings/class-advanced.php line 201 · used in 4 places
    apply_filters( "{$name}_setting_description", __( 'Send an event to Google Analytics whenever a Cloaked Affiliate Link is clicked. An event with the configured <strong>Event Category</strong> is sent to Google Analytics whenever a link containing the <strong>Path</strong> value is clicked. The <strong>Event Label</strong> will be the URL of the link. Depending on your server\'s capacity, this might not work properly with Stealth Mode enabl... );
  • includes/admin/settings/class-builder.php line 201 · used in 3 places
    apply_filters( "{$name}_setting_label", $label );
  • includes/admin/settings/class-basic.php line 259 · used in 2 places
    apply_filters( 'caos_frontend_tracking_promo_message', true );
  • includes/admin/settings/class-builder.php line 248
    apply_filters( "{$name}setting_description", $description, $label, $name );
  • includes/admin/settings/class-builder.php line 178
    apply_filters( "{$select}_setting_description", $description, $label, $select );
  • includes/admin/settings/class-builder.php line 160
    apply_filters( "{$select}_setting_label", $label );
  • includes/admin/settings/class-builder.php line 166
    apply_filters( "{$select}_setting_options", $options );
  • includes/admin/class-settings.php line 221
    apply_filters( "{str_replace('-','_',$this->active_tab)}_content", '' );
  • includes/admin/class-settings.php line 466
    do_action( "after_{$current_section}" );
  • includes/class-file-manager.php line 123
    do_action( 'caos_admin_update_after' );
  • includes/class-file-manager.php line 32
    do_action( 'caos_admin_update_before' );
  • includes/class-caos.php line 34
    do_action( 'caos_before_admin' );
  • includes/class-caos.php line 41
    do_action( 'caos_before_frontend' );
  • includes/frontend/class-tracking.php line 426
    apply_filters( 'caos_buffer_output', $html );
  • includes/class-cron.php line 27
    do_action( 'caos_cron_update' );
  • includes/class-cron.php line 83
    apply_filters( 'caos_cron_update_gtag', $downloaded_file );
  • includes/db/migrate/class-v460.php line 27
    apply_filters( 'caos_db_migration_v460', [ 'service_provider', CAOS_Admin_Settings::CAOS_BASIC_SETTING_TRACK_ADMIN, 'domain_name', 'tracking_id', 'dual_tracking', 'ga4_measurement_id', CAOS_Admin_Settings::CAOS_BASIC_SETTING_ALLOW_TRACKING, 'snippet_type', 'anonymize_ip_mode', CAOS_Admin_Settings::CAOS_BASIC_SETTING_SCRIPT_POSITION, 'adjusted_bounce_rate', CAOS_Admin_Settings::CAOS_ADV_SETTING_COMPATIBILITY_MODE, 'analytics_js_file', ... );
  • includes/db/migrate/class-v470.php line 28
    apply_filters( 'caos_db_migration_v470', [ 'service_provider', 'tracking_id', 'domain_name', 'dual_tracking', 'ga4_measurement_id', 'snippet_type', 'adjusted_bounce_rate', 'analytics_js_file', 'ga_cookie_expiry_days', 'site_speed_sample_rate', 'extension_track_ad_blockers', 'extension_linkid', 'capture_outbound_links', ] );
  • includes/class-file-manager.php line 62
    apply_filters( 'caos_file_alias', $file_aliases[ $file ] ?? '' );
  • includes/frontend/class-functions.php line 31
    apply_filters( 'caos_frontend_add_dns_prefetch', true );
  • includes/class-cron.php line 77
    apply_filters( 'caos_gtag_hit_type', '"page_view"' );
  • includes/class-caos.php line 156
    apply_filters( 'caos_local_dir', WP_CONTENT_DIR . self::get( CAOS_Admin_Settings::CAOS_ADV_SETTING_CACHE_DIR, '/uploads/caos/' ) );
  • includes/class-caos.php line 267
    apply_filters( 'caos_local_file_url', $url );
  • includes/admin/class-settings.php line 375
    apply_filters( 'caos_register_settings', $reflection->getConstants() );
  • includes/admin/class-settings.php line 388
    apply_filters( 'caos_register_settings_needle', 'CAOS_BASIC_SETTING' );
  • includes/class-caos.php line 188
    apply_filters( "caos_setting_{$name}", $value );
  • caos_settings

    filter
    includes/class-caos.php line 204
    apply_filters( 'caos_settings', $settings );
  • includes/admin/class-settings.php line 462
    do_action( 'caos_settings_content' );
  • includes/admin/settings/class-help.php line 44
    apply_filters( 'caos_settings_help_quick_start', 'https://daan.dev/docs/caos/quick-start-caos/' );
  • includes/admin/settings/class-help.php line 48
    apply_filters( 'caos_settings_help_user_manual', 'https://daan.dev/docs/caos/?collection_id=6171c32112c07c18afddfcce' );
  • includes/admin/class-settings.php line 444
    do_action( 'caos_settings_tab' );

Generated from CAOS's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: