GTM4WP 2.1.1 has 1 actions and 41 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.
// Run your own code when GTM4WP fires an action
add_action( 'gtm4wp_register_modules', function( $registry ) {
// Your code runs here.
}, 10, 1 );
// Change a value GTM4WP is about to use
add_filter( 'woocommerce_cart_item_product', function( $cart_item_data, $cart_item_data2, $cart_item_id ) {
// Change $cart_item_data here.
return $cart_item_data;
}, 10, 3 );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
-
/** * Applying WooCommerce's own woocommerce_cart_item_product filter here is * essential in order to hide everything from tracking codes that is not * visible to the user as well. */ apply_filters( 'woocommerce_cart_item_product', $cart_item_data['data'], $cart_item_data, $cart_item_id ); -
gtm4wp_admin_doc_url
filter/** * Filters the documentation URL of a module or an option, so a third party * module can resolve against its own site. Returning '' removes the help link. * Validated afterwards: only http(s) survives. */ apply_filters( 'gtm4wp_admin_doc_url', $url, $path, $anchor ); -
/** * Filters the order statuses whose orders are eligible for the purchase event. */ apply_filters( 'gtm4wp_edd_purchase_trackable_statuses', $statuses, $order ); -
gtm4wp_media_sdk_blocked
filter/** * Filters whether GTM4WP may request a third-party media player SDK. */ apply_filters( 'gtm4wp_media_sdk_blocked', false ); -
gtm4wp_page_language
filter/** * Filters the language code reported for the current page. */ apply_filters( 'gtm4wp_page_language', $page_language ); -
gtm4wp_page_post_author_ids
filter/** * Filters the list of post author IDs output into the data layer on a post * with multiple authors (PublishPress Authors). */ apply_filters( 'gtm4wp_page_post_author_ids', $author_ids, $multiple_authors ); -
gtm4wp_page_post_authors
filter/** * Filters the list of post author display names output into the data layer on * a post with multiple authors (PublishPress Authors). */ apply_filters( 'gtm4wp_page_post_authors', $author_names, $multiple_authors ); -
/** * Filters whether a post meta key is included in the data layer. */ apply_filters( 'gtm4wp_post_meta_in_datalayer', true, $post_meta_key ); -
/** * Filters the term id used as the primary category of the current post (e.g. * for another SEO plugin or a custom taxonomy). */ apply_filters( 'gtm4wp_primary_category_term_id', $primary_category_id, get_the_ID() ); -
/** * Filters the order statuses whose orders are eligible for the purchase event. */ apply_filters( 'gtm4wp_purchase_trackable_statuses', $statuses, $order ); -
gtm4wp_reading_time_wpm
filter/** * Filters the words-per-minute reading speed used to estimate the reading time * of the current post. */ apply_filters( 'gtm4wp_reading_time_wpm', 200 ); -
gtm4wp_register_modules
action/** * Fires after the built-in modules have been registered. */ do_action( 'gtm4wp_register_modules', $registry ); -
gtm4wp_site_health_info
filter/** * Filters the rows of the plugin's Site Health Info section. */ apply_filters( 'gtm4wp_site_health_info', $fields, $this->options ); -
/** * The site's own grace period. All three arguments are passed because * WooCommerce passes three (RI-25): WP_Hook never pads the list, so a callback * written to the documented signature would raise an ArgumentCountError. * Residual 3: 7.9.x has no grace period, so for ten minutes the mirror * publishes where 7.9.x demands verification - bounded by the order max-age * gate, and the behaviour 8.0.0 adopted. */ apply_filters( 'woocommerce_order_email_verification_grace_period', 10 * MINUTE_IN_SECONDS, $order, 'order-received' ); -
/** * Upstream's final say, honoured so a store that disabled verification keeps a * complete data layer; three arguments per RI-25. The value passed in is true * where upstream may have computed false (unmodelled request-identity terms), * so a passthrough changes nothing and only an explicit false publishes. * Residual 4: a strictly value-inverting callback would publish in exactly * those states. Applied af... */ apply_filters( 'woocommerce_order_email_verification_required', true, $order, 'order-received' ); -
/** * Whether known (non-guest) shoppers must be logged in to see the order. The * gate is unconditional from 7.9.0 and filterable from 8.4.0; a false from a * site callback is honoured on 7.9.0-8.3.x too (residual 2: the admin asked * for the gate to be off, the mirror follows the admin). */ apply_filters( 'woocommerce_order_received_verify_known_shoppers', true ); -
/** * This filter allows 3rd party code to exclude specific products from * reporting. */ apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item_data, $cart_item_id ); -
the_permalink
filterapply_filters( 'the_permalink', $product instanceof \WC_Product ? $product->get_permalink() : '', 0 ); -
apply_filters( "gtm4wp_{GTM4WP_OPTION_EVENTS_FORMMOVE}", true ); -
apply_filters( "gtm4wp_{GTM4WP_OPTION_INTEGRATE_EDDTRACKECOMMERCE}", true ); -
apply_filters( "gtm4wp_{GTM4WP_OPTION_INTEGRATE_WCTRACKECOMMERCE}", true ); -
apply_filters( "gtm4wp_{GTM4WP_OPTION_INTEGRATE_WPCF7}", true ); -
gtm4wp_cloudflarestream
filterapply_filters( 'gtm4wp_cloudflarestream', true ); -
gtm4wp_dailymotion
filterapply_filters( 'gtm4wp_dailymotion', true ); -
gtm4wp_html5media
filterapply_filters( 'gtm4wp_html5media', true ); -
gtm4wp_jwplayer
filterapply_filters( 'gtm4wp_jwplayer', true ); -
gtm4wp_mixcloud
filterapply_filters( 'gtm4wp_mixcloud', true ); -
gtm4wp_soundcloud
filterapply_filters( 'gtm4wp_soundcloud', true ); -
gtm4wp_spotify
filterapply_filters( 'gtm4wp_spotify', true ); -
gtm4wp_twitch
filterapply_filters( 'gtm4wp_twitch', true ); -
gtm4wp_videopress
filterapply_filters( 'gtm4wp_videopress', true ); -
gtm4wp_vimeo
filterapply_filters( 'gtm4wp_vimeo', true ); -
gtm4wp_wistia
filterapply_filters( 'gtm4wp_wistia', true ); -
single_post_title
filterapply_filters( 'single_post_title', $_master_post->post_title, $_master_post ); -
apply_filters( 'woocommerce_cart_item_visible', true, $cart_item_data, $cart_item_id ); -
apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item_data, $cart_item_id ); -
apply_filters( 'woocommerce_order_item_visible', true, $order_item ); -
apply_filters( 'woocommerce_thankyou_order_id', $order_id ); -
apply_filters( 'woocommerce_thankyou_order_key', $order_key ); -
wpml_current_language
filterapply_filters( 'wpml_current_language', null ); -
wpml_default_language
filterapply_filters( 'wpml_default_language', null ); -
wpml_object_id
filterapply_filters( 'wpml_object_id', $id, $type, true, $default_lang );
Generated from GTM4WP'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: