Version Description
Release Date: September 4th, 2014
- Bugfixes:
- Fixed bug with outbound link tracking not properly escaping attributes.
- Fixed bug that broke tracking with ga.js.
Download this release
Release Info
| Developer | joostdevalk |
| Plugin | |
| Version | 5.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 5.0.1 to 5.0.2
- admin/pages/settings.php +2 -2
- frontend/class-ga-js.php +8 -8
- frontend/class-universal.php +5 -5
- googleanalytics.php +2 -2
- readme.txt +9 -4
admin/pages/settings.php
CHANGED
|
@@ -71,8 +71,8 @@ echo $yoast_ga_admin->create_form( 'settings' );
|
|
| 71 |
<div id="universal" class="gatab">
|
| 72 |
<?php
|
| 73 |
echo '<h2>' . __( 'Universal settings', 'google-analytics-for-wordpress' ) . '</h2>';
|
| 74 |
-
echo $yoast_ga_admin->input( 'checkbox', __( 'Enable Universal tracking', 'google-analytics-for-wordpress' ), 'enable_universal', null, __( 'First enable Universal tracking in your Google Analytics account. How to do that, please read <a href="
|
| 75 |
-
echo $yoast_ga_admin->input( 'checkbox', __( 'Enable Demographics and Interest Reports', 'google-analytics-for-wordpress' ), 'demographics', null, __( 'You have to enable the Demographics in Google Analytics before you can see the tracking data. We have a doc in our <a href="http://kb.yoast.com/article/154-enable-demographics-and-interests-report-in-google-analytics
|
| 76 |
?>
|
| 77 |
</div>
|
| 78 |
<div id="advanced" class="gatab">
|
| 71 |
<div id="universal" class="gatab">
|
| 72 |
<?php
|
| 73 |
echo '<h2>' . __( 'Universal settings', 'google-analytics-for-wordpress' ) . '</h2>';
|
| 74 |
+
echo $yoast_ga_admin->input( 'checkbox', __( 'Enable Universal tracking', 'google-analytics-for-wordpress' ), 'enable_universal', null, __( 'First enable Universal tracking in your Google Analytics account. How to do that, please read <a href="http://kb.yoast.com/article/125-universal-analytics#utm_medium=kb-link&utm_source=gawp-config&utm_campaign=wpgaplugin" target="_blank">this guide</a> to learn how to do that.', 'google-analytics-for-wordpress' ) );
|
| 75 |
+
echo $yoast_ga_admin->input( 'checkbox', __( 'Enable Demographics and Interest Reports', 'google-analytics-for-wordpress' ), 'demographics', null, __( 'You have to enable the Demographics in Google Analytics before you can see the tracking data. We have a doc in our <a href="http://kb.yoast.com/article/154-enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&utm_source=gawp-config&utm_campaign=wpgaplugin" target="_blank">knowlegde base</a> about this feature.', 'google-analytics-for-wordpress' ) );
|
| 76 |
?>
|
| 77 |
</div>
|
| 78 |
<div id="advanced" class="gatab">
|
frontend/class-ga-js.php
CHANGED
|
@@ -85,10 +85,10 @@ if ( ! class_exists( 'Yoast_GA_JS' ) ) {
|
|
| 85 |
}
|
| 86 |
|
| 87 |
if ( is_404() ) {
|
| 88 |
-
$gaq_push[] = "'
|
| 89 |
} else {
|
| 90 |
if ( $wp_query->is_search ) {
|
| 91 |
-
$pushstr = "'
|
| 92 |
if ( $wp_query->found_posts == 0 ) {
|
| 93 |
$gaq_push[] = $pushstr . "no-results:" . rawurlencode( $wp_query->query_vars['s'] ) . "&cat=no-results'";
|
| 94 |
} else {
|
|
@@ -103,7 +103,7 @@ if ( ! class_exists( 'Yoast_GA_JS' ) ) {
|
|
| 103 |
}
|
| 104 |
}
|
| 105 |
} else {
|
| 106 |
-
$gaq_push[] = "'
|
| 107 |
}
|
| 108 |
}
|
| 109 |
|
|
@@ -147,14 +147,14 @@ if ( ! class_exists( 'Yoast_GA_JS' ) ) {
|
|
| 147 |
switch ( $link['type'] ) {
|
| 148 |
case 'download':
|
| 149 |
if ( $options['track_download_as'] == 'pageview' ) {
|
| 150 |
-
$onclick = "_gaq.push(['_trackPageview','download/" .
|
| 151 |
} else {
|
| 152 |
-
$onclick = "_gaq.push(['_trackEvent','download/" .
|
| 153 |
}
|
| 154 |
|
| 155 |
break;
|
| 156 |
case 'email':
|
| 157 |
-
$onclick = "_gaq.push(['_trackEvent','mailto','" .
|
| 158 |
|
| 159 |
break;
|
| 160 |
case 'internal-as-outbound':
|
|
@@ -164,7 +164,7 @@ if ( ! class_exists( 'Yoast_GA_JS' ) ) {
|
|
| 164 |
$label = 'int';
|
| 165 |
}
|
| 166 |
|
| 167 |
-
$onclick = "_gaq.push(['_trackEvent', '" . $link['category'] . "-" . $label . "', '" . $full_url . "', '" . $link['link_text'] . "']);";
|
| 168 |
|
| 169 |
break;
|
| 170 |
case 'internal':
|
|
@@ -173,7 +173,7 @@ if ( ! class_exists( 'Yoast_GA_JS' ) ) {
|
|
| 173 |
break;
|
| 174 |
case 'outbound':
|
| 175 |
if ( $options['track_outbound'] == 1 ) {
|
| 176 |
-
$onclick = "_gaq.push(['_trackEvent', '" . $link['category'] . "', '" . $full_url . "', '" . $link['link_text'] . "']);";
|
| 177 |
}
|
| 178 |
|
| 179 |
break;
|
| 85 |
}
|
| 86 |
|
| 87 |
if ( is_404() ) {
|
| 88 |
+
$gaq_push[] = "'_trackPageview,'/404.html?page=' + document.location.pathname + document.location.search + '&from=' + document.referrer";
|
| 89 |
} else {
|
| 90 |
if ( $wp_query->is_search ) {
|
| 91 |
+
$pushstr = "'_trackPageview','/?s=";
|
| 92 |
if ( $wp_query->found_posts == 0 ) {
|
| 93 |
$gaq_push[] = $pushstr . "no-results:" . rawurlencode( $wp_query->query_vars['s'] ) . "&cat=no-results'";
|
| 94 |
} else {
|
| 103 |
}
|
| 104 |
}
|
| 105 |
} else {
|
| 106 |
+
$gaq_push[] = "'_trackPageview'";
|
| 107 |
}
|
| 108 |
}
|
| 109 |
|
| 147 |
switch ( $link['type'] ) {
|
| 148 |
case 'download':
|
| 149 |
if ( $options['track_download_as'] == 'pageview' ) {
|
| 150 |
+
$onclick = "_gaq.push(['_trackPageview','download/" . esc_attr( $full_url ) . "']);";
|
| 151 |
} else {
|
| 152 |
+
$onclick = "_gaq.push(['_trackEvent','download/" . esc_attr( $full_url ) . "']);";
|
| 153 |
}
|
| 154 |
|
| 155 |
break;
|
| 156 |
case 'email':
|
| 157 |
+
$onclick = "_gaq.push(['_trackEvent','mailto','" . esc_attr( $link['original_url'] ) . "']);";
|
| 158 |
|
| 159 |
break;
|
| 160 |
case 'internal-as-outbound':
|
| 164 |
$label = 'int';
|
| 165 |
}
|
| 166 |
|
| 167 |
+
$onclick = "_gaq.push(['_trackEvent', '" . esc_attr ( $link['category'] ) . "-" . esc_attr ( $label ) . "', '" . esc_attr ( $full_url ) . "', '" . esc_attr ( strip_tags( $link['link_text'] ) ) . "']);";
|
| 168 |
|
| 169 |
break;
|
| 170 |
case 'internal':
|
| 173 |
break;
|
| 174 |
case 'outbound':
|
| 175 |
if ( $options['track_outbound'] == 1 ) {
|
| 176 |
+
$onclick = "_gaq.push(['_trackEvent', '" . esc_attr ( $link['category'] ) . "', '" . esc_attr ( $full_url ) . "', '" . esc_attr ( strip_tags( $link['link_text'] ) ) . "']);";
|
| 177 |
}
|
| 178 |
|
| 179 |
break;
|
frontend/class-universal.php
CHANGED
|
@@ -147,14 +147,14 @@ if ( ! class_exists( 'Yoast_GA_Universal' ) ) {
|
|
| 147 |
switch ( $link['type'] ) {
|
| 148 |
case 'download':
|
| 149 |
if ( $options['track_download_as'] == 'pageview' ) {
|
| 150 |
-
$onclick = "ga('send', 'pageview', '" .
|
| 151 |
} else {
|
| 152 |
-
$onclick = "ga('send', 'event', 'download', '" .
|
| 153 |
}
|
| 154 |
|
| 155 |
break;
|
| 156 |
case 'email':
|
| 157 |
-
$onclick = "ga('send', 'event', 'mailto', '" .
|
| 158 |
|
| 159 |
break;
|
| 160 |
case 'internal-as-outbound':
|
|
@@ -164,7 +164,7 @@ if ( ! class_exists( 'Yoast_GA_Universal' ) ) {
|
|
| 164 |
$label = 'int';
|
| 165 |
}
|
| 166 |
|
| 167 |
-
$onclick = "ga('send', 'event', '" . $link['category'] . "-" . $label . "', '" .
|
| 168 |
|
| 169 |
break;
|
| 170 |
case 'internal':
|
|
@@ -173,7 +173,7 @@ if ( ! class_exists( 'Yoast_GA_Universal' ) ) {
|
|
| 173 |
break;
|
| 174 |
case 'outbound':
|
| 175 |
if ( $options['track_outbound'] == 1 ) {
|
| 176 |
-
$onclick = "ga('send', 'event', '" . $link['category'] . "', '" .
|
| 177 |
}
|
| 178 |
|
| 179 |
break;
|
| 147 |
switch ( $link['type'] ) {
|
| 148 |
case 'download':
|
| 149 |
if ( $options['track_download_as'] == 'pageview' ) {
|
| 150 |
+
$onclick = "ga('send', 'pageview', '" . esc_attr( $full_url ) . "');";
|
| 151 |
} else {
|
| 152 |
+
$onclick = "ga('send', 'event', 'download', '" . esc_attr( $full_url ) . "');";
|
| 153 |
}
|
| 154 |
|
| 155 |
break;
|
| 156 |
case 'email':
|
| 157 |
+
$onclick = "ga('send', 'event', 'mailto', '" . esc_attr( $link['original_url'] ) . "');";
|
| 158 |
|
| 159 |
break;
|
| 160 |
case 'internal-as-outbound':
|
| 164 |
$label = 'int';
|
| 165 |
}
|
| 166 |
|
| 167 |
+
$onclick = "ga('send', 'event', '" . esc_attr( $link['category'] ) . "-" .esc_attr ( $label ) . "', '" . esc_attr( $full_url ) . "', '" . esc_attr ( strip_tags( $link['link_text'] ) ) . "');";
|
| 168 |
|
| 169 |
break;
|
| 170 |
case 'internal':
|
| 173 |
break;
|
| 174 |
case 'outbound':
|
| 175 |
if ( $options['track_outbound'] == 1 ) {
|
| 176 |
+
$onclick = "ga('send', 'event', '" . esc_attr ( $link['category'] ) . "', '" . esc_attr( $full_url ) . "', '" . esc_attr( strip_tags( $link['link_text'] ) ) . "');";
|
| 177 |
}
|
| 178 |
|
| 179 |
break;
|
googleanalytics.php
CHANGED
|
@@ -4,7 +4,7 @@ Plugin Name: Google Analytics by Yoast
|
|
| 4 |
Plugin URI: http://yoast.com/wordpress/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v500
|
| 5 |
Description: This plugin makes it simple to add Google Analytics to your WordPress blog, adding lots of features, eg. custom variables and automatic clickout and download tracking.
|
| 6 |
Author: Joost de Valk
|
| 7 |
-
Version: 5.0.
|
| 8 |
Requires at least: 3.8
|
| 9 |
Author URI: http://yoast.com/
|
| 10 |
License: GPL v3
|
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
| 30 |
|
| 31 |
// This plugin was originally based on Rich Boakes' Analytics plugin: http://boakes.org/analytics, but has since been rewritten and refactored multiple times.
|
| 32 |
|
| 33 |
-
define( "GAWP_VERSION", '5.0.
|
| 34 |
|
| 35 |
define( "GAWP_FILE", __FILE__ );
|
| 36 |
|
| 4 |
Plugin URI: http://yoast.com/wordpress/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v500
|
| 5 |
Description: This plugin makes it simple to add Google Analytics to your WordPress blog, adding lots of features, eg. custom variables and automatic clickout and download tracking.
|
| 6 |
Author: Joost de Valk
|
| 7 |
+
Version: 5.0.2
|
| 8 |
Requires at least: 3.8
|
| 9 |
Author URI: http://yoast.com/
|
| 10 |
License: GPL v3
|
| 30 |
|
| 31 |
// This plugin was originally based on Rich Boakes' Analytics plugin: http://boakes.org/analytics, but has since been rewritten and refactored multiple times.
|
| 32 |
|
| 33 |
+
define( "GAWP_VERSION", '5.0.2' );
|
| 34 |
|
| 35 |
define( "GAWP_FILE", __FILE__ );
|
| 36 |
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://yoast.com/donate/
|
|
| 4 |
Tags: analytics, google analytics, statistics, tracking, stats, google, yoast
|
| 5 |
Requires at least: 3.8
|
| 6 |
Tested up to: 4.0
|
| 7 |
-
Stable tag: 5.0.
|
| 8 |
|
| 9 |
Track your WordPress site easily with the latest tracking codes and lots added data for search result pages and error pages.
|
| 10 |
|
|
@@ -49,6 +49,13 @@ This section describes how to install the plugin and get it working.
|
|
| 49 |
|
| 50 |
== Changelog ==
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
= 5.0.1 =
|
| 53 |
Release Date: September 4th, 2014
|
| 54 |
|
|
@@ -382,6 +389,4 @@ For all frequently asked questions, and their answers, check the [Yoast Knowledg
|
|
| 382 |
|
| 383 |
1. Screenshot of the general settings panel for this plugin.
|
| 384 |
2. Screenshot of the universal settings panel.
|
| 385 |
-
3. Screenshot of the advanced settings panel.
|
| 386 |
-
|
| 387 |
-
== Upgrade Notice ==
|
| 4 |
Tags: analytics, google analytics, statistics, tracking, stats, google, yoast
|
| 5 |
Requires at least: 3.8
|
| 6 |
Tested up to: 4.0
|
| 7 |
+
Stable tag: 5.0.2
|
| 8 |
|
| 9 |
Track your WordPress site easily with the latest tracking codes and lots added data for search result pages and error pages.
|
| 10 |
|
| 49 |
|
| 50 |
== Changelog ==
|
| 51 |
|
| 52 |
+
= 5.0.2 =
|
| 53 |
+
Release Date: September 4th, 2014
|
| 54 |
+
|
| 55 |
+
* Bugfixes:
|
| 56 |
+
* Fixed bug with outbound link tracking not properly escaping attributes.
|
| 57 |
+
* Fixed bug that broke tracking with ga.js.
|
| 58 |
+
|
| 59 |
= 5.0.1 =
|
| 60 |
Release Date: September 4th, 2014
|
| 61 |
|
| 389 |
|
| 390 |
1. Screenshot of the general settings panel for this plugin.
|
| 391 |
2. Screenshot of the universal settings panel.
|
| 392 |
+
3. Screenshot of the advanced settings panel.
|
|
|
|
|
|
