Yandex Metrica icon
Analytics & Tracking

Yandex Metrica hooks reference

  • By Mustafa Uysal
  • v2.0.3
  • Updated

Yandex Metrica 2.0.3 has 1 actions and 5 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 Yandex Metrica fires an action
add_action( 'yandex_metrica_db_upgraded', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Yandex Metrica is about to use
add_filter( 'yandex_metrica_ecommerce_container_name', 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

  • templates/tracker-js-new.php line 6 · used in 2 places
    apply_filters( 'yandex_metrica_ecommerce_container_name', $this->options['ecommerce_container_name'] );
  • templates/tracker-js-new.php line 7 · used in 2 places
    apply_filters( 'yandex_metrica_noscript_img_base', "https://mc.yandex.ru/watch/" );
  • widget_title

    filter
    includes/widget.php line 33
    apply_filters( 'widget_title', $instance['title'] );
  • yandex-metrica.php line 292
    apply_filters( 'yandex_metrica_app_id', YandexMetrica\Constants\YANDEX_APP_ID );
  • yandex-metrica.php line 301
    apply_filters( 'yandex_metrica_app_secret', YandexMetrica\Constants\YANDEX_APP_SECRET );
  • yandex-metrica.php line 324
    do_action( 'yandex_metrica_db_upgraded' );

Generated from Yandex Metrica'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: