Version Description
- Enhancements:
- adds support for Google AMP Client ID API
- adds support for Force SSL option
- Bug Fixes:
- fixes a telephone tracking issue
Download this release
Release Info
Developer | deconf |
Plugin | Google Analytics Dashboard for WP (GADWP) |
Version | 5.1.2 |
Comparing to | |
See all releases |
Code changes from version 5.1.1.3 to 5.1.2
- admin/settings.php +26 -0
- config.php +3 -0
- front/js/tracking-analytics-events.js +1 -1
- front/tracking-analytics.php +20 -1
- front/views/analytics-amp-clientidapi.php +11 -0
- front/views/analytics-code.php +1 -1
- gadwp.php +2 -2
- install/install.php +4 -0
- readme.txt +8 -1
- tools/gapi.php +8 -8
admin/settings.php
CHANGED
@@ -31,9 +31,11 @@ final class GADWP_Settings {
|
|
31 |
$options['ga_aff_tracking'] = 0;
|
32 |
$options['ga_hash_tracking'] = 0;
|
33 |
$options['ga_formsubmit_tracking'] = 0;
|
|
|
34 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
35 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
36 |
$options['amp_tracking_analytics'] = 0;
|
|
|
37 |
$options['amp_tracking_tagmanager'] = 0;
|
38 |
$options['optimize_pagehiding'] = 0;
|
39 |
$options['optimize_tracking'] = 0;
|
@@ -770,6 +772,18 @@ final class GADWP_Settings {
|
|
770 |
<div class="switch-desc"><?php echo " ".__("use hitCallback to increase event tracking accuracy", 'google-analytics-dashboard-for-wp' );?></div>
|
771 |
</td>
|
772 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
<tr>
|
774 |
<td colspan="2"><?php echo "<h2>" . __( "Cross-domain Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
|
775 |
</tr>
|
@@ -844,6 +858,18 @@ final class GADWP_Settings {
|
|
844 |
<div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
|
845 |
</td>
|
846 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
847 |
<tr>
|
848 |
<td colspan="2"><?php echo "<h2>" . __( "Ecommerce", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
|
849 |
</tr>
|
31 |
$options['ga_aff_tracking'] = 0;
|
32 |
$options['ga_hash_tracking'] = 0;
|
33 |
$options['ga_formsubmit_tracking'] = 0;
|
34 |
+
$options['ga_force_ssl'] = 0;
|
35 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
36 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
37 |
$options['amp_tracking_analytics'] = 0;
|
38 |
+
$options['amp_tracking_clientidapi'] = 0;
|
39 |
$options['amp_tracking_tagmanager'] = 0;
|
40 |
$options['optimize_pagehiding'] = 0;
|
41 |
$options['optimize_tracking'] = 0;
|
772 |
<div class="switch-desc"><?php echo " ".__("use hitCallback to increase event tracking accuracy", 'google-analytics-dashboard-for-wp' );?></div>
|
773 |
</td>
|
774 |
</tr>
|
775 |
+
<tr>
|
776 |
+
<td colspan="2" class="gadwp-settings-title">
|
777 |
+
<div class="button-primary gadwp-settings-switchoo">
|
778 |
+
<input type="checkbox" name="options[ga_force_ssl]" value="1" class="gadwp-settings-switchoo-checkbox" id="ga_force_ssl" <?php checked( $options['ga_force_ssl'], 1 ); ?>>
|
779 |
+
<label class="gadwp-settings-switchoo-label" for="ga_force_ssl">
|
780 |
+
<div class="gadwp-settings-switchoo-inner"></div>
|
781 |
+
<div class="gadwp-settings-switchoo-switch"></div>
|
782 |
+
</label>
|
783 |
+
</div>
|
784 |
+
<div class="switch-desc"><?php echo " ".__("enable Force SSL", 'google-analytics-dashboard-for-wp' );?></div>
|
785 |
+
</td>
|
786 |
+
</tr>
|
787 |
<tr>
|
788 |
<td colspan="2"><?php echo "<h2>" . __( "Cross-domain Tracking", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
|
789 |
</tr>
|
858 |
<div class="switch-desc"><?php echo " ".__("enable tracking for Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' );?></div>
|
859 |
</td>
|
860 |
</tr>
|
861 |
+
<tr>
|
862 |
+
<td colspan="2" class="gadwp-settings-title">
|
863 |
+
<div class="button-primary gadwp-settings-switchoo">
|
864 |
+
<input type="checkbox" name="options[amp_tracking_clientidapi]" value="1" class="gadwp-settings-switchoo-checkbox" id="amp_tracking_clientidapi" <?php checked( $options['amp_tracking_clientidapi'], 1 ); ?>>
|
865 |
+
<label class="gadwp-settings-switchoo-label" for="amp_tracking_clientidapi">
|
866 |
+
<div class="gadwp-settings-switchoo-inner"></div>
|
867 |
+
<div class="gadwp-settings-switchoo-switch"></div>
|
868 |
+
</label>
|
869 |
+
</div>
|
870 |
+
<div class="switch-desc"><?php echo " ".__("enable Google AMP Client Id API", 'google-analytics-dashboard-for-wp' );?></div>
|
871 |
+
</td>
|
872 |
+
</tr>
|
873 |
<tr>
|
874 |
<td colspan="2"><?php echo "<h2>" . __( "Ecommerce", 'google-analytics-dashboard-for-wp' ) . "</h2>"; ?></td>
|
875 |
</tr>
|
config.php
CHANGED
@@ -80,6 +80,7 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
80 |
'tm_pubyearmonth_var',
|
81 |
'ga_aff_tracking',
|
82 |
'amp_tracking_analytics',
|
|
|
83 |
'amp_tracking_tagmanager',
|
84 |
'optimize_tracking',
|
85 |
'optimize_pagehiding',
|
@@ -274,6 +275,7 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
274 |
'ga_hash_tracking',
|
275 |
'switch_profile', // V4.7
|
276 |
'amp_tracking_analytics', //v5.0
|
|
|
277 |
'optimize_tracking', //v5.0
|
278 |
'optimize_pagehiding', //v5.0
|
279 |
'amp_tracking_tagmanager', //v5.0
|
@@ -284,6 +286,7 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
284 |
'ga_pagescrolldepth_tracking', //v5.0
|
285 |
'tm_pagescrolldepth_tracking', //v5.0
|
286 |
'ga_event_precision', //v5.1.1.1
|
|
|
287 |
);
|
288 |
foreach ( $zeros as $key ) {
|
289 |
if ( ! isset( $this->options[$key] ) ) {
|
80 |
'tm_pubyearmonth_var',
|
81 |
'ga_aff_tracking',
|
82 |
'amp_tracking_analytics',
|
83 |
+
'amp_tracking_clientidapi',
|
84 |
'amp_tracking_tagmanager',
|
85 |
'optimize_tracking',
|
86 |
'optimize_pagehiding',
|
275 |
'ga_hash_tracking',
|
276 |
'switch_profile', // V4.7
|
277 |
'amp_tracking_analytics', //v5.0
|
278 |
+
'amp_tracking_clientidapi', //v5.1.2
|
279 |
'optimize_tracking', //v5.0
|
280 |
'optimize_pagehiding', //v5.0
|
281 |
'amp_tracking_tagmanager', //v5.0
|
286 |
'ga_pagescrolldepth_tracking', //v5.0
|
287 |
'tm_pagescrolldepth_tracking', //v5.0
|
288 |
'ga_event_precision', //v5.1.1.1
|
289 |
+
'ga_force_ssl', //v5.1.2
|
290 |
);
|
291 |
foreach ( $zeros as $key ) {
|
292 |
if ( ! isset( $this->options[$key] ) ) {
|
front/js/tracking-analytics-events.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";var gadwpRedirectLink;var gadwpRedirectCalled=false;var gadwpDefaultPrevented=false;function gadwpRedirect(){if(gadwpRedirectCalled){return}gadwpRedirectCalled=true;if(gadwpDefaultPrevented==false){document.location.href=gadwpRedirectLink}else{gadwpDefaultPrevented=false}}jQuery(window).on("load",function(){if(gadwpUAEventsData.options.event_tracking){jQuery("a").filter(function(){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");return this.href.match(a)}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"download";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="mailto"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"email";var c=this.getAttribute("data-vars-ga-action")||"send";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="tel"]').click(function(d){
|
1 |
+
"use strict";var gadwpRedirectLink;var gadwpRedirectCalled=false;var gadwpDefaultPrevented=false;function gadwpRedirect(){if(gadwpRedirectCalled){return}gadwpRedirectCalled=true;if(gadwpDefaultPrevented==false){document.location.href=gadwpRedirectLink}else{gadwpDefaultPrevented=false}}jQuery(window).on("load",function(){if(gadwpUAEventsData.options.event_tracking){jQuery("a").filter(function(){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");return this.href.match(a)}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"download";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="mailto"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"email";var c=this.getAttribute("data-vars-ga-action")||"send";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="tel"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"telephone";var c=this.getAttribute("data-vars-ga-action")||"call";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});if(gadwpUAEventsData.options.root_domain){jQuery('a[href^="http"]').filter(function(){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");if(!this.href.match(a)){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)==-1&&this.href.indexOf("://")>-1){return this.href}}}).click(function(d){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"outbound";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(d.isDefaultPrevented()){gadwpDefaultPrevented=true;gadwpRedirectCalled=false}}else{gadwpRedirectCalled=true;gadwpDefaultPrevented=false}if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1,hitCallback:gadwpRedirect})}else{ga("send","event",b,c,a,{hitCallback:gadwpRedirect})}setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}}})}}if(gadwpUAEventsData.options.event_affiliates&&gadwpUAEventsData.options.aff_tracking){jQuery("a").filter(function(){if(gadwpUAEventsData.options.event_affiliates!=""){var a=new RegExp("("+gadwpUAEventsData.options.event_affiliates.replace(/\//g,"/")+")");return this.href.match(a)}}).click(function(c){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"affiliates";var d=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(e.isDefaultPrevented()){gadwpDefaultPrevented=true;gadwpRedirectCalled=false}}else{gadwpRedirectCalled=true;gadwpDefaultPrevented=false}if(this.target!="_blank"&&gadwpUAEventsData.options.event_precision){if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,d,a,{nonInteraction:1,hitCallback:gadwpRedirect})}else{ga("send","event",b,d,a,{hitCallback:gadwpRedirect})}setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,d,a,{nonInteraction:1})}else{ga("send","event",b,d,a)}}})}if(gadwpUAEventsData.options.root_domain&&gadwpUAEventsData.options.hash_tracking){jQuery("a").filter(function(){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)!=-1||this.href.indexOf("://")==-1){return this.hash}}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"hashmark";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}})}if(gadwpUAEventsData.options.event_formsubmit){jQuery('input[type="submit"]').click(function(f){var d=this;var b=d.getAttribute("data-vars-ga-category")||"form";var c=d.getAttribute("data-vars-ga-action")||"submit";var a=d.getAttribute("data-vars-ga-label")||d.name||d.value;if(gadwpUAEventsData.options.event_formsubmit){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}})}if(gadwpUAEventsData.options.ga_pagescrolldepth_tracking){jQuery.scrollDepth({percentage:true,userTiming:false,pixelDepth:false,gtmOverride:true,nonInteraction:true})}});
|
front/tracking-analytics.php
CHANGED
@@ -244,6 +244,9 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
244 |
if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
|
245 |
$fieldsobject['cookieExpires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
|
246 |
}
|
|
|
|
|
|
|
247 |
$this->add( 'create', $fields, $fieldsobject );
|
248 |
|
249 |
if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
|
@@ -273,6 +276,13 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
273 |
$this->add( 'require', $fields );
|
274 |
}
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
$custom_dimensions = $this->bulid_custom_dimensions();
|
277 |
if ( ! empty( $custom_dimensions ) ) {
|
278 |
foreach ( $custom_dimensions as $index => $value ) {
|
@@ -354,7 +364,9 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
354 |
}
|
355 |
}
|
356 |
|
357 |
-
|
|
|
|
|
358 |
}
|
359 |
}
|
360 |
}
|
@@ -371,6 +383,9 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics_AMP' ) ) {
|
|
371 |
add_filter( 'amp_post_template_data', array( $this, 'load_scripts' ) );
|
372 |
add_action( 'amp_post_template_footer', array( $this, 'output' ) );
|
373 |
add_filter( 'the_content', array( $this, 'add_data_attributes' ), 999, 1 );
|
|
|
|
|
|
|
374 |
}
|
375 |
|
376 |
private function get_link_event_data( $link ) {
|
@@ -578,6 +593,10 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics_AMP' ) ) {
|
|
578 |
do_action( 'gadwp_analytics_amp_config', $this );
|
579 |
}
|
580 |
|
|
|
|
|
|
|
|
|
581 |
/**
|
582 |
* Outputs the Google Analytics tracking code for AMP
|
583 |
*/
|
244 |
if ( ! empty( $this->gadwp->config->options['ga_cookieexpires'] ) ) {
|
245 |
$fieldsobject['cookieExpires'] = (int) $this->gadwp->config->options['ga_cookieexpires'];
|
246 |
}
|
247 |
+
if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
|
248 |
+
$fieldsobject['useAmpClientId'] = 'true';
|
249 |
+
}
|
250 |
$this->add( 'create', $fields, $fieldsobject );
|
251 |
|
252 |
if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
|
276 |
$this->add( 'require', $fields );
|
277 |
}
|
278 |
|
279 |
+
if ( $this->gadwp->config->options['ga_force_ssl'] ) {
|
280 |
+
$fields = array();
|
281 |
+
$fields['option'] = 'forceSSL';
|
282 |
+
$fields['value'] = 'true';
|
283 |
+
$this->add( 'set', $fields );
|
284 |
+
}
|
285 |
+
|
286 |
$custom_dimensions = $this->bulid_custom_dimensions();
|
287 |
if ( ! empty( $custom_dimensions ) ) {
|
288 |
foreach ( $custom_dimensions as $index => $value ) {
|
364 |
}
|
365 |
}
|
366 |
|
367 |
+
$tracking_script_path = apply_filters( 'gadwp_analytics_script_path', 'https://www.google-analytics.com/analytics.js' );;
|
368 |
+
|
369 |
+
GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode, 'tracking_script_path' => $tracking_script_path ) );
|
370 |
}
|
371 |
}
|
372 |
}
|
383 |
add_filter( 'amp_post_template_data', array( $this, 'load_scripts' ) );
|
384 |
add_action( 'amp_post_template_footer', array( $this, 'output' ) );
|
385 |
add_filter( 'the_content', array( $this, 'add_data_attributes' ), 999, 1 );
|
386 |
+
if ( $this->gadwp->config->options['amp_tracking_clientidapi'] ) {
|
387 |
+
add_action( 'amp_post_template_head', array( $this, 'add_amp_client_id' ) );
|
388 |
+
}
|
389 |
}
|
390 |
|
391 |
private function get_link_event_data( $link ) {
|
593 |
do_action( 'gadwp_analytics_amp_config', $this );
|
594 |
}
|
595 |
|
596 |
+
public function add_amp_client_id() {
|
597 |
+
GADWP_Tools::load_view( 'front/views/analytics-amp-clientidapi.php' );
|
598 |
+
}
|
599 |
+
|
600 |
/**
|
601 |
* Outputs the Google Analytics tracking code for AMP
|
602 |
*/
|
front/views/analytics-amp-clientidapi.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
|
11 |
+
<meta name="amp-google-client-id-api" content="googleanalytics">
|
front/views/analytics-code.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
13 |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
14 |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
15 |
-
})(window,document,'script','
|
16 |
<?php echo $data['trackingcode']?>
|
17 |
</script>
|
18 |
<!-- END GADWP Universal Analytics -->
|
12 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
13 |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
14 |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
15 |
+
})(window,document,'script','<?php echo $data['tracking_script_path']?>','ga');
|
16 |
<?php echo $data['trackingcode']?>
|
17 |
</script>
|
18 |
<!-- END GADWP Universal Analytics -->
|
gadwp.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://deconf.com
|
5 |
* Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
|
6 |
* Author: Alin Marcu
|
7 |
-
* Version: 5.1.
|
8 |
* Author URI: https://deconf.com
|
9 |
* Text Domain: google-analytics-dashboard-for-wp
|
10 |
* Domain Path: /languages
|
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
16 |
|
17 |
// Plugin Version
|
18 |
if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
|
19 |
-
define( 'GADWP_CURRENT_VERSION', '5.1.
|
20 |
}
|
21 |
|
22 |
if ( ! class_exists( 'GADWP_Manager' ) ) {
|
4 |
* Plugin URI: https://deconf.com
|
5 |
* Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
|
6 |
* Author: Alin Marcu
|
7 |
+
* Version: 5.1.2
|
8 |
* Author URI: https://deconf.com
|
9 |
* Text Domain: google-analytics-dashboard-for-wp
|
10 |
* Domain Path: /languages
|
16 |
|
17 |
// Plugin Version
|
18 |
if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
|
19 |
+
define( 'GADWP_CURRENT_VERSION', '5.1.2' );
|
20 |
}
|
21 |
|
22 |
if ( ! class_exists( 'GADWP_Manager' ) ) {
|
install/install.php
CHANGED
@@ -74,6 +74,7 @@ class GADWP_Install {
|
|
74 |
$options['amp_containerid'] = '';
|
75 |
$options['amp_tracking_tagmanager'] = 0;
|
76 |
$options['amp_tracking_analytics'] = 0;
|
|
|
77 |
$options['trackingcode_infooter'] = 0;
|
78 |
$options['trackingevents_infooter'] = 0;
|
79 |
$options['ecommerce_mode'] = 'disabled';
|
@@ -85,6 +86,7 @@ class GADWP_Install {
|
|
85 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
86 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
87 |
$options['ga_event_precision'] = 0;
|
|
|
88 |
} else {
|
89 |
$options = array();
|
90 |
$options['ga_dash_clientid'] = get_option( 'ga_dash_clientid' );
|
@@ -143,6 +145,7 @@ class GADWP_Install {
|
|
143 |
$options['amp_containerid'] = '';
|
144 |
$options['amp_tracking_tagmanager'] = 0;
|
145 |
$options['amp_tracking_analytics'] = 0;
|
|
|
146 |
$options['trackingcode_infooter'] = 0;
|
147 |
$options['trackingevents_infooter'] = 0;
|
148 |
$options['ecommerce_mode'] = 'disabled';
|
@@ -156,6 +159,7 @@ class GADWP_Install {
|
|
156 |
$options['ga_speed_samplerate'] = 1;
|
157 |
$options['ga_user_samplerate'] = 100;
|
158 |
$options['ga_event_precision'] = 0;
|
|
|
159 |
|
160 |
delete_option( 'ga_dash_clientid' );
|
161 |
delete_option( 'ga_dash_clientsecret' );
|
74 |
$options['amp_containerid'] = '';
|
75 |
$options['amp_tracking_tagmanager'] = 0;
|
76 |
$options['amp_tracking_analytics'] = 0;
|
77 |
+
$options['amp_tracking_clientidapi'] = 0;
|
78 |
$options['trackingcode_infooter'] = 0;
|
79 |
$options['trackingevents_infooter'] = 0;
|
80 |
$options['ecommerce_mode'] = 'disabled';
|
86 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
87 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
88 |
$options['ga_event_precision'] = 0;
|
89 |
+
$options['ga_force_ssl'] = 0;
|
90 |
} else {
|
91 |
$options = array();
|
92 |
$options['ga_dash_clientid'] = get_option( 'ga_dash_clientid' );
|
145 |
$options['amp_containerid'] = '';
|
146 |
$options['amp_tracking_tagmanager'] = 0;
|
147 |
$options['amp_tracking_analytics'] = 0;
|
148 |
+
$options['amp_tracking_clientidapi'] = 0;
|
149 |
$options['trackingcode_infooter'] = 0;
|
150 |
$options['trackingevents_infooter'] = 0;
|
151 |
$options['ecommerce_mode'] = 'disabled';
|
159 |
$options['ga_speed_samplerate'] = 1;
|
160 |
$options['ga_user_samplerate'] = 100;
|
161 |
$options['ga_event_precision'] = 0;
|
162 |
+
$options['ga_force_ssl'] = 0;
|
163 |
|
164 |
delete_option( 'ga_dash_clientid' );
|
165 |
delete_option( 'ga_dash_clientsecret' );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://deconf.com/donate/
|
|
4 |
Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8.2
|
7 |
-
Stable tag: 5.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -167,6 +167,13 @@ This is a major update, please read the [release notes](https://deconf.com/googl
|
|
167 |
|
168 |
== Changelog ==
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
= 5.1.1.3 =
|
171 |
* Bug Fixes:
|
172 |
* fixes a bug on the exponential backoff system
|
4 |
Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8.2
|
7 |
+
Stable tag: 5.1.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
167 |
|
168 |
== Changelog ==
|
169 |
|
170 |
+
= 5.1.2 =
|
171 |
+
* Enhancements:
|
172 |
+
* adds support for Google AMP Client ID API
|
173 |
+
* adds support for Force SSL option
|
174 |
+
* Bug Fixes:
|
175 |
+
* fixes a telephone tracking issue
|
176 |
+
|
177 |
= 5.1.1.3 =
|
178 |
* Bug Fixes:
|
179 |
* fixes a bug on the exponential backoff system
|
tools/gapi.php
CHANGED
@@ -110,7 +110,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
110 |
}
|
111 |
if ( isset( $errors[1][0]['reason'] ) && ( 'userRateLimitExceeded' == $errors[1][0]['reason'] || 'quotaExceeded' == $errors[1][0]['reason'] ) ) {
|
112 |
if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
|
113 |
-
usleep( rand(
|
114 |
$this->gadwp->config->options['api_backoff'] = $this->gadwp->config->options['api_backoff'] + 1;
|
115 |
$this->gadwp->config->set_plugin_options();
|
116 |
return false;
|
@@ -118,7 +118,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
118 |
return true;
|
119 |
}
|
120 |
}
|
121 |
-
if ( 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] ) {
|
122 |
return true;
|
123 |
}
|
124 |
return false;
|
@@ -281,10 +281,10 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
281 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
282 |
return $e->getCode();
|
283 |
}
|
284 |
-
|
285 |
$this->gadwp->config->options['api_backoff'] = 0;
|
286 |
-
$this->gadwp->config->set_plugin_options();
|
287 |
-
|
288 |
if ( $data->getRows() > 0 ) {
|
289 |
return $data;
|
290 |
} else {
|
@@ -804,10 +804,10 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
804 |
$gadwp_data->rows[$i] = array_map( 'esc_html', $row );
|
805 |
$i++;
|
806 |
}
|
807 |
-
|
808 |
$this->gadwp->config->options['api_backoff'] = 0;
|
809 |
-
$this->gadwp->config->set_plugin_options();
|
810 |
-
|
811 |
return array( $gadwp_data );
|
812 |
}
|
813 |
|
110 |
}
|
111 |
if ( isset( $errors[1][0]['reason'] ) && ( 'userRateLimitExceeded' == $errors[1][0]['reason'] || 'quotaExceeded' == $errors[1][0]['reason'] ) ) {
|
112 |
if ( $this->gadwp->config->options['api_backoff'] <= 5 ) {
|
113 |
+
usleep( rand( 1000000, 4500000 ) );
|
114 |
$this->gadwp->config->options['api_backoff'] = $this->gadwp->config->options['api_backoff'] + 1;
|
115 |
$this->gadwp->config->set_plugin_options();
|
116 |
return false;
|
118 |
return true;
|
119 |
}
|
120 |
}
|
121 |
+
if ( 500 == $errors[0] || 503 == $errors[0] || 400 == $errors[0] || 401 == $errors[0] || 403 == $errors[0] ) {
|
122 |
return true;
|
123 |
}
|
124 |
return false;
|
281 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
282 |
return $e->getCode();
|
283 |
}
|
284 |
+
|
285 |
$this->gadwp->config->options['api_backoff'] = 0;
|
286 |
+
$this->gadwp->config->set_plugin_options();
|
287 |
+
|
288 |
if ( $data->getRows() > 0 ) {
|
289 |
return $data;
|
290 |
} else {
|
804 |
$gadwp_data->rows[$i] = array_map( 'esc_html', $row );
|
805 |
$i++;
|
806 |
}
|
807 |
+
|
808 |
$this->gadwp->config->options['api_backoff'] = 0;
|
809 |
+
$this->gadwp->config->set_plugin_options();
|
810 |
+
|
811 |
return array( $gadwp_data );
|
812 |
}
|
813 |
|