Description
Google Tag Manager (GTM) is Google’s free tool for everyone to manage and deploy analytics and marketing tags as well as other code snippets
using an intuitive web UI. To learn more about this tool, visit the official website.
This plugin places the GTM container code snippets onto your WordPress website so that you do not need to add it manually.
Multiple containers are also supported!
The plugin complements your GTM setup by pushing page meta data and user information into the so called data layer.
Google’s official help pages includes more details about the data layer.
PHP 7.4 is required to use this plugin.
GTM container code placement
The original GTM container code is divided into two parts:
The first part is a javascript code snippet that is added to the <head> section of every page of the website.
This part is critical to enable all features of GTM, and this plugin helps to place this part
correctly on your site.
The second part is an iframe snippet that acts as a failsafe/fallback should users’ JavaScript be disabled.
Google recommends – for best performance – to place this code snippet directly after the opening <body> tag on each page.
Albeit not ideal, it will work when placed lower in the code. This plugin provides a code placement option for the second code snippet.
If your WordPress theme is compatible with the additions of WordPress 5.2 then this plugin will place this second code to the right place.
Users of the Genisis theme, GeneratePress theme, Elementor, Oxygen Builder and Beaver Builder Theme will also have this placed correctly.
To utilize this, set the compatibili... [truncated]
Installation
- Upload
duracelltomi-google-tag-manager-for-wordpressto the/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- Go to Settings / Google Tag Manager and enter your Google Tag Manager container ID and set additional options
wp plugin install duracelltomi-google-tag-manager --activateFrequently Asked Questions
Tutorials for various Google Tag Manager settings and implementation are available on the plugin’s website:
https://gtm4wp.com/setup-gtm4wp-features
PayPal and some other 3rd party payment gateways do not redirect users back to your website upon successful transaction by default.
It offers the route back for your customer but it can happen that users close the browser before arriving at your thankyou page
(aka. order received page). This means that neither Google Analytics tags or any other tags have the chance to fire.
Enable auto-return in your payment gateway settings. This will instruct them to show a quick info page afte... [truncated]
Changelog
1.22.1
- Fixed: yet another fix to the purchase tracking. Thanks Khnaz35
1.22
- Added: new WooCommerce option to change the event timeout of the select_item event. Could help some UX issues when a user has an ad blocker installed.
- Added: new WordPress filter GTM4WP_WPFILTER_OVERWRITE_COMO_FLAG / gtm4wp_overwrite_consent_mode_flag to overwrite Consent Mode flags in the default command. Can be used by consent banner plugins to mitigate support issues.
- Fixed: Unwanted content on frontend when container placement set to off and gtm4wp_the_gtm_tag() called manually. Thanks Michael Bourne
- Fixed: Add to cart tracking broken with Bricks template and WooCommerce
- Updated: bundled WhichBrowser library updated to the latest version. This is a short term solution to solve PHP erros, on th... [truncated]
