Overview
GTM4WP describes itself as: “Advanced tag management for WordPress with Google Tag Manager”
It is active on 700,000+ WordPress sites and rated 4.5 out of 5 by 155 users on WordPress.org. Developers can extend it through 1 actions and 41 filters, listed below.
How to install GTM4WP
- Open the plugin installer. In your WordPress dashboard go to Plugins → Add New Plugin.
- Search for it. Type “GTM4WP” and pick the one by Thomas Geiger.
- Install and activate. Click Install Now, then Activate.
Install with a zip file or WP-CLI
Download the zip from the WordPress.org plugin page, then go to Plugins → Add New Plugin → Upload Plugin, choose the file and click Install Now. Or from the command line:
wp plugin install duracelltomi-google-tag-manager --activateRequirements: WordPress 6.3+ · PHP 8.0+ · tested up to WordPress 7.1.4
Hooks & customisation
GTM4WP 2.1.1 fires 1 actions and 41 filters. Use them from your child theme or a snippets plugin to change how it behaves without editing its files.
// Applying WooCommerce's own woocommerce_cart_item_product filter here is essent…
apply_filters( 'woocommerce_cart_item_product', $cart_item_data['data'], $cart_item_data, $cart_item_id );
// Filters the documentation URL of a module or an option, so a third party modul…
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 );
// Filters whether GTM4WP may request a third-party media player SDK.
apply_filters( 'gtm4wp_media_sdk_blocked', false );
// Filters the language code reported for the current page.
apply_filters( 'gtm4wp_page_language', $page_language );
// Filters the list of post author IDs output into the data layer on a post with…
apply_filters( 'gtm4wp_page_post_author_ids', $author_ids, $multiple_authors );Need GTM4WP customised?
Tell us what you want changed, added or fixed and we'll reply with an estimate.
WP EXPERTS is independent and not affiliated with Thomas Geiger. Plugin names and logos belong to their owners. Version, rating and install figures from WordPress.org, checked Nov 17, 2026.