Google Tag Manager - Version 1.0.2

Version Description

  • Switch to the new split-format for Google Tag Manager javascript and iframe format.
  • Add support for Genesis and Theme Hook Alliance themes to echo the iframe sooner in the dom.
Download this release

Release Info

Developer georgestephanis
Plugin Icon wp plugin Google Tag Manager
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.2-beta1 to 1.0.2

Files changed (2) hide show
  1. google-tag-manager.php +4 -4
  2. readme.txt +2 -2
google-tag-manager.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Google Tag Manager
4
  Plugin URI: http://wordpress.org/extend/plugins/google-tag-manager/
5
  Description: This is an implementation of the new Tag Management system from Google. It adds a field to the existing General Settings page for the ID, and if specified, outputs the tag management javascript in the page footer.
6
- Version: 1.0.2-beta1
7
  Author: George Stephanis
8
  Author URI: http://stephanis.info
9
  License: GPLv2 or later
@@ -34,8 +34,8 @@ class google_tag_manager {
34
  <?php
35
  }
36
  public static function print_tag() {
37
- if ( ! $id = get_option( 'google_tag_manager_id', '' ) ) return;
38
- ?>
39
  <!-- Google Tag Manager -->
40
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
41
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@@ -43,7 +43,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
43
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
44
  })(window,document,'script','dataLayer','<?php echo esc_js( $id ); ?>');</script>
45
  <!-- End Google Tag Manager -->
46
- <?php
47
  }
48
  public static function print_noscript_tag() {
49
  // Make sure we only print the noscript tag once.
3
  Plugin Name: Google Tag Manager
4
  Plugin URI: http://wordpress.org/extend/plugins/google-tag-manager/
5
  Description: This is an implementation of the new Tag Management system from Google. It adds a field to the existing General Settings page for the ID, and if specified, outputs the tag management javascript in the page footer.
6
+ Version: 1.0.2
7
  Author: George Stephanis
8
  Author URI: http://stephanis.info
9
  License: GPLv2 or later
34
  <?php
35
  }
36
  public static function print_tag() {
37
+ if ( ! $id = get_option( 'google_tag_manager_id', '' ) ) return;
38
+ ?>
39
  <!-- Google Tag Manager -->
40
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
41
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
43
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
44
  })(window,document,'script','dataLayer','<?php echo esc_js( $id ); ?>');</script>
45
  <!-- End Google Tag Manager -->
46
+ <?php
47
  }
48
  public static function print_noscript_tag() {
49
  // Make sure we only print the noscript tag once.
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Google Tag Manager ===
2
  Contributors: georgestephanis
3
  Donate link: http://www.charitywater.org/donate/
4
- Tags: google, tag manager, tag management, analytics
5
  Requires at least: 2.7
6
  Tested up to: 4.7
7
- Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
1
  === Google Tag Manager ===
2
  Contributors: georgestephanis
3
  Donate link: http://www.charitywater.org/donate/
4
+ Tags: google, tag manager, tag management, analytics, theme hook alliance, genesis
5
  Requires at least: 2.7
6
  Tested up to: 4.7
7
+ Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10