Plugin / Metronet Tag Manager

Ronald Huereca

Description

Description

Integrate Google Tag Manager into your website.

The great thing about Google Tag Manager (GTM) is that you are able to gather most of your tracking scripts in one place. You can then fire these scripts whenever you want, specified by the rules you set up. This sounds great, right? Well it is. The only problem is that sometimes it takes a bit of implementing to set these rules up. This implementation can either be setting a dataLayer variable in the dataLayer before the tag manager script is loaded, or pushing a HTML event handler with the variable “event” to the dataLayer when a button is clicked. The problem is that this isn’t always that easy to do when you don’t have the ability/access to add the code to your site.

This is where the Metronet Tag Manager plugin shines. It really unlocks the power of the dataLayer so you can easily set macros and firing rules on almost any element.

This plugin lets you:

  • Easily add as many dataLayer variables on a per-post and per-page basis as you need.
  • The plugin already gives you 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 that’s it.

Note, if you are using WordPress 5.2. and up, contact your theme developer and ask them to insert <?php wp_body_open(); ?> just after the opening body tag of their theme. Here is some code to show the theme developer to make it compatible with Metronet Tag Manager.

Please let us know if you have any feature requests or if you have any issues with this plugin.

Below are a couple of resources you might find valuable if you are new to Google Tag Manager

Official Google Tag Manager website
https://developers.google.com/tag-manager/

Tracking Google Analytics Events with Google Tag Manager
http://moz.com/ugc/tracking-google-analytics-events-with-google-tag-manager

Make Analytics Better with Tag Management and a Data Layer
http://cutroni.com/blog/2012/05/14/make-analytics-better-with-tag-management-and-a-data-layer/

Filtering Variables

If you choose to place variable values inside percentage signs (e.g., %replace_test%), you can filter these as necessary.

Here’s an example:

add_filter( 'gtm_replace_test', 'gtm_replace_test', 10, 3 );
function gtm_replace_test( $total_match, $match, $post_id ) {
    return "replaced with content";
}

The filter name is gtm_ with the suffix of replace_test, since that content is inbetween the percentage signs.

Ratings

4.7
6 reviews

Rating breakdown

Details Information

Version

1.5.4

First Released

18 Jul, 2013

Total Downloads

134,364

Wordpress Version

4.2 or higher

Tested up to:

5.3

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.