With Metronet Tag Manager you can set macros and firing rules on almost any element.
This plugin lets you:
Securely install Google Tag Manger into your WordPress site. Trusted by 200,000+ WordPress & WordPress VIP Sites.
User-friendly interface. Quickly add and manage what tags, categories, and other data are being passed to Tag Manager.
Support for WordPress Multisite installs by providing an easy way to add and manage tags across your network. Allows you to control tags across all sites on the network.
Support for WordPress Block Editor. This block allows you to manage your unique ID and class directly from within the editor.
With Metronet Tag Manager you can set macros and firing rules on any element.
This plugin lets you:
Easily add as many dataLayer variables on a per-post and per-page basis as you need.
Six predefined dataLayer variables that you can change/remove or test the system with. These will be loaded on all pages and posts.
Set up separate dataLayer variables for pages that aren’t posts or pages (like archives etc).
Lets you easily add a HTML event handler to any content link with the GTM TinyMCE button in the WYSIWYG.
Lets you add your own unique ID or a class to each content link with the GTM TinyMCE button in the WYSIWYG.
Please note that for this plugin to work, there is a slight customization that is needed. WordPress doesn’t let you load scripts straight after the opening tag which is where the GTM script needs to be placed to work correctly. To fix this, you need to add <?php do_action(‘body_open’); ?> just after the <body> tag and thats it.
If you choose to place variable values inside percentage signs (e.g., %replace_test%), you can filter these as necassary.
The filter name is gtm_ with the suffix of replace_test, since that content is inbetween the percentage signs.