Google Analytics for WordPress by MonsterInsights - Version 3.2.2

Version Description

  • Fix to the hashtag redirect so it actually works in all cases.
Download this release

Release Info

Developer joostdevalk
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 3.2.2
Comparing to
See all releases

Code changes from version 3.2.1 to 3.2.2

Files changed (2) hide show
  1. googleanalytics.php +19 -19
  2. readme.txt +5 -2
googleanalytics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Analytics for WordPress
4
  Plugin URI: http://yoast.com/wordpress/analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=google-analytics-for-wordpress
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
- Version: 3.2.1
8
  Requires at least: 2.7
9
  Author URI: http://yoast.com/
10
  License: GPL
@@ -564,27 +564,23 @@ if ( ! class_exists( 'GA_Filter' ) ) {
564
  * to one tagged with a hash. Needs some work as it also needs to do that when the first utm_ var is actually not the
565
  * first GET variable in the URL.
566
  */
567
- if ( $options['allowanchor'] ) {
568
- function ga_utm_hastag_redirect() {
569
- if (isset($_SERVER['REQUEST_URI'])) {
570
- if (strpos($_SERVER['REQUEST_URI'], "utm_") !== false) {
571
- $url = 'http://';
572
- if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "") {
573
- $url = 'https://';
574
- }
575
- $url .= $_SERVER['SERVER_NAME'];
576
- if ( strpos($_SERVER['REQUEST_URI'], "?utm_") !== false ) {
577
- $url .= str_replace("?utm_","#utm_",$_SERVER['REQUEST_URI']);
578
- }
579
- else if ( strpos($_SERVER['REQUEST_URI'], "&utm_") !== false ) {
580
- $url .= substr_replace($_SERVER['REQUEST_URI'], "#utm_", strpos($_SERVER['REQUEST_URI'], "&utm_"), 5);
581
- }
582
- wp_redirect($url, 301);
583
- exit;
584
  }
 
 
585
  }
586
  }
587
- add_action('init','ga_utm_hastag_redirect',1);
588
  }
589
 
590
  $gaf = new GA_Filter();
@@ -593,6 +589,10 @@ $options = get_option('GoogleAnalyticsPP');
593
  if (!is_array($options))
594
  $ga_admin->set_defaults();
595
 
 
 
 
 
596
  if ($options['trackoutbound']) {
597
  // filters alter the existing content
598
  add_filter('the_content', array('GA_Filter','the_content'), 99);
4
  Plugin URI: http://yoast.com/wordpress/analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=google-analytics-for-wordpress
5
  Description: This plugin makes it simple to add Google Analytics with extra search engines and automatic clickout and download tracking to your WordPress blog.
6
  Author: Joost de Valk
7
+ Version: 3.2.2
8
  Requires at least: 2.7
9
  Author URI: http://yoast.com/
10
  License: GPL
564
  * to one tagged with a hash. Needs some work as it also needs to do that when the first utm_ var is actually not the
565
  * first GET variable in the URL.
566
  */
567
+ function ga_utm_hashtag_redirect() {
568
+ if (isset($_SERVER['REQUEST_URI'])) {
569
+ if (strpos($_SERVER['REQUEST_URI'], "utm_") !== false) {
570
+ $url = 'http://';
571
+ if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "") {
572
+ $url = 'https://';
573
+ }
574
+ $url .= $_SERVER['SERVER_NAME'];
575
+ if ( strpos($_SERVER['REQUEST_URI'], "?utm_") !== false ) {
576
+ $url .= str_replace("?utm_","#utm_",$_SERVER['REQUEST_URI']);
577
+ } else if ( strpos($_SERVER['REQUEST_URI'], "&utm_") !== false ) {
578
+ $url .= substr_replace($_SERVER['REQUEST_URI'], "#utm_", strpos($_SERVER['REQUEST_URI'], "&utm_"), 5);
 
 
 
 
 
579
  }
580
+ wp_redirect($url, 301);
581
+ exit;
582
  }
583
  }
 
584
  }
585
 
586
  $gaf = new GA_Filter();
589
  if (!is_array($options))
590
  $ga_admin->set_defaults();
591
 
592
+ if ( $options['allowanchor'] ) {
593
+ add_action('init','ga_utm_hashtag_redirect',1);
594
+ }
595
+
596
  if ($options['trackoutbound']) {
597
  // filters alter the existing content
598
  add_filter('the_content', array('GA_Filter','the_content'), 99);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: joostdevalk
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.7
6
- Tested up to: 2.8.2
7
- Stable tag: 3.2.1
8
 
9
  The Google Analytics for WordPress plugin automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
@@ -29,6 +29,9 @@ This section describes how to install the plugin and get it working.
29
 
30
  == Changelog ==
31
 
 
 
 
32
  = 3.2.1 =
33
  * Slight change to RSS URL tagging, now setting campaign to post name, and behaving better when not using rewritten URL's.
34
  * Two patches by [Lee Willis](http://www.leewillis.co.uk):
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, google analytics, statistics
5
  Requires at least: 2.7
6
+ Tested up to: 2.8.3
7
+ Stable tag: 3.2.2
8
 
9
  The Google Analytics for WordPress plugin automatically tracks and segments all outbound links from within posts, comment author links, links within comments, blogroll links and downloads. It also allows you to track AdSense clicks, add extra search engines, track image search queries and it will even work together with Urchin.
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 3.2.2 =
33
+ * Fix to the hashtag redirect so it actually works in all cases.
34
+
35
  = 3.2.1 =
36
  * Slight change to RSS URL tagging, now setting campaign to post name, and behaving better when not using rewritten URL's.
37
  * Two patches by [Lee Willis](http://www.leewillis.co.uk):