Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.3.4

Version Description

  • 21/10/2021 =

  • Site verification and domainc claim issue got fixed for the manually created merchant center accounts

  • Some users were facing difficulty on the onboarding page because of the access token expiry. The issue is fixed now.

Download this release

Release Info

Developer Tatvic
Plugin Icon 128x128 Enhanced Ecommerce Google Analytics Plugin for WooCommerce
Version 4.3.4
Comparing to
See all releases

Code changes from version 4.3.3 to 4.3.4

admin/class-conversios-onboarding.php CHANGED
@@ -14,6 +14,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
14
  protected $plan_id = 1;
15
  protected $tvc_data = array();
16
  protected $last_login;
 
17
  public function __construct( ){
18
  if ( ! is_admin() ) {
19
  return;
@@ -29,6 +30,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
29
 
30
  $this->connect_url = $this->TVC_Admin_Helper->get_connect_url();
31
  $this->tvc_data = $this->TVC_Admin_Helper->get_store_data();
 
32
  /**
33
  * check last login for check RefreshToken
34
  */
@@ -199,7 +201,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
199
  <!-- onborading left start -->
200
  <div class="onboardingstepwrap">
201
  <!-- step-0 start -->
202
- <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']==""){ echo "activestep"; }else{echo "selectedactivestep";} ?>">
203
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-0']; ?>" id="google-signing" data-id="step_0">
204
  <div class="stepleftround">
205
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
@@ -210,8 +212,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
210
  </div>
211
  </div>
212
  <div class="stepmoredtlwrp">
213
- <div class="stepmoredtl">
214
-
215
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
216
  <div class="google_connect_url google-btn">
217
  <div class="google-icon-wrapper">
@@ -220,20 +221,31 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
220
  <p class="btn-text"><b>Sign in with google</b></p>
221
  </div>
222
  <?php } else{?>
223
- <div class="google_connect_url google-btn">
224
- <div class="google-icon-wrapper">
225
- <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
226
- </div>
227
- <p class="btn-text mr-35"><b>Reauthorize</b></p>
228
- </div>
229
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
230
  <p>Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.</p>
231
  </div>
232
  </div>
233
  </div>
234
  <!-- step-0 over -->
235
  <!-- step-1 start -->
236
- <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'])?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail']){ echo "activestep"; } ?>">
237
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-1']; ?>" id="google-analytics" data-id="step_1">
238
  <div class="stepleftround">
239
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
@@ -323,7 +335,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
323
  </div>
324
  <!-- step-1 over -->
325
  <!-- step-2 start -->
326
- <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1)?'selectedactivestep':''; ?>">
327
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-2']; ?>" id="google-ads" data-id="step_2">
328
  <div class="stepleftround">
329
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
@@ -414,7 +426,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
414
  </div>
415
  <!-- step-2 over -->
416
  <!-- step-3 start -->
417
- <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1)?'selectedactivestep':''; ?>">
418
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-3']; ?>" id="gmc-account" data-id="step_3">
419
  <div class="stepleftround">
420
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
14
  protected $plan_id = 1;
15
  protected $tvc_data = array();
16
  protected $last_login;
17
+ protected $is_refresh_token_expire;
18
  public function __construct( ){
19
  if ( ! is_admin() ) {
20
  return;
30
 
31
  $this->connect_url = $this->TVC_Admin_Helper->get_connect_url();
32
  $this->tvc_data = $this->TVC_Admin_Helper->get_store_data();
33
+ $this->is_refresh_token_expire = $this->TVC_Admin_Helper->is_refresh_token_expire();
34
  /**
35
  * check last login for check RefreshToken
36
  */
201
  <!-- onborading left start -->
202
  <div class="onboardingstepwrap">
203
  <!-- step-0 start -->
204
+ <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']=="" || $this->is_refresh_token_expire == true ){ echo "activestep"; }else{echo "selectedactivestep";} ?>">
205
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-0']; ?>" id="google-signing" data-id="step_0">
206
  <div class="stepleftround">
207
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
212
  </div>
213
  </div>
214
  <div class="stepmoredtlwrp">
215
+ <div class="stepmoredtl">
 
216
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
217
  <div class="google_connect_url google-btn">
218
  <div class="google-icon-wrapper">
221
  <p class="btn-text"><b>Sign in with google</b></p>
222
  </div>
223
  <?php } else{?>
224
+
225
+ <?php if($this->is_refresh_token_expire == true){?>
226
+ <p class="alert alert-primary">It seems the token to access your Google accounts is expired. Sign in again to continue.</p>
227
+ <div class="google_connect_url google-btn">
228
+ <div class="google-icon-wrapper">
229
+ <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
230
+ </div>
231
+ <p class="btn-text"><b>Sign in with google</b></p>
232
+ </div>
233
+ <?php } else{ ?>
234
+ <div class="google_connect_url google-btn">
235
+ <div class="google-icon-wrapper">
236
+ <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
237
+ </div>
238
+ <p class="btn-text mr-35"><b>Reauthorize</b></p>
239
+ </div>
240
+ <?php } ?>
241
+ <?php } ?>
242
  <p>Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.</p>
243
  </div>
244
  </div>
245
  </div>
246
  <!-- step-0 over -->
247
  <!-- step-1 start -->
248
+ <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
249
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-1']; ?>" id="google-analytics" data-id="step_1">
250
  <div class="stepleftround">
251
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
335
  </div>
336
  <!-- step-1 over -->
337
  <!-- step-2 start -->
338
+ <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
339
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-2']; ?>" id="google-ads" data-id="step_2">
340
  <div class="stepleftround">
341
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
426
  </div>
427
  <!-- step-2 over -->
428
  <!-- step-3 start -->
429
+ <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1 && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?>">
430
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-3']; ?>" id="gmc-account" data-id="step_3">
431
  <div class="stepleftround">
432
  <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
admin/class-tvc-admin-helper.php CHANGED
@@ -871,7 +871,7 @@ Class TVC_Admin_Helper{
871
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
872
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
873
  }else{
874
- $this->set_update_api_to_db();
875
  return array('error'=>false, 'msg'=>"Domain claimed successfully.");
876
  }
877
  }else{
@@ -926,7 +926,7 @@ Class TVC_Admin_Helper{
926
  if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
927
  return array('error'=>true, 'msg'=>$siteVerification_tag->errors[0]);
928
  }else{
929
- $this->set_update_api_to_db();
930
  return array('error'=>false, 'msg'=>"Site verification successfully.");
931
  }
932
  }else{
@@ -934,7 +934,7 @@ Class TVC_Admin_Helper{
934
  }
935
  // one more try
936
  }else{
937
- $this->set_update_api_to_db();
938
  return array('error'=>false, 'msg'=>"Site verification successfully.");
939
  }
940
  }
@@ -1142,6 +1142,19 @@ Class TVC_Admin_Helper{
1142
  return $google_detail['setting'];
1143
  }
1144
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
 
1146
  /*
1147
  * conver curency code to currency symbols
871
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
872
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
873
  }else{
874
+ $this->update_subscription_details_api_to_db();
875
  return array('error'=>false, 'msg'=>"Domain claimed successfully.");
876
  }
877
  }else{
926
  if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
927
  return array('error'=>true, 'msg'=>$siteVerification_tag->errors[0]);
928
  }else{
929
+ $this->update_subscription_details_api_to_db();
930
  return array('error'=>false, 'msg'=>"Site verification successfully.");
931
  }
932
  }else{
934
  }
935
  // one more try
936
  }else{
937
+ $this->update_subscription_details_api_to_db();
938
  return array('error'=>false, 'msg'=>"Site verification successfully.");
939
  }
940
  }
1142
  return $google_detail['setting'];
1143
  }
1144
  }
1145
+ /*
1146
+ * Check refresh tocken status
1147
+ */
1148
+ public function is_refresh_token_expire(){
1149
+ $access_token = $this->customApiObj->get_tvc_access_token();
1150
+ $refresh_token = $this->customApiObj->get_tvc_refresh_token();
1151
+ $access_token = $this->customApiObj->generateAccessToken($access_token, $refresh_token);
1152
+ if($access_token != ""){
1153
+ return false;
1154
+ }else{
1155
+ return true;
1156
+ }
1157
+ }
1158
 
1159
  /*
1160
  * conver curency code to currency symbols
admin/css/style.css CHANGED
@@ -933,6 +933,7 @@ button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{b
933
 
934
  /* RC*/
935
  .onbordingbody{padding-top: 10px;}
 
936
  .dashboard_page_conversios_onboarding, .index_page_conversios_onboarding, .onbordingbody-wapper{background: #fff;}
937
  .bodyrightpart{padding: 20px 10px 10px 0;}
938
  .blueupgrdbtn{display: inline-block;}
933
 
934
  /* RC*/
935
  .onbordingbody{padding-top: 10px;}
936
+ .onbordording-step .click_here{font-weight: 600; cursor: pointer;}
937
  .dashboard_page_conversios_onboarding, .index_page_conversios_onboarding, .onbordingbody-wapper{background: #fff;}
938
  .bodyrightpart{padding: 20px 10px 10px 0;}
939
  .blueupgrdbtn{display: inline-block;}
admin/js/tvc-ee-custom.js CHANGED
@@ -315,7 +315,7 @@ var tvc_helper = {
315
  url: tvc_ajax_url,
316
  data: post_data,
317
  success: function (response) {
318
- console.log(post_data);
319
  if(response.error == false){
320
  if(Object.keys(response.data).length > 0){
321
  v_this.set_google_analytics_reports_value(response.data, post_data);
315
  url: tvc_ajax_url,
316
  data: post_data,
317
  success: function (response) {
318
+ console.log(response);
319
  if(response.error == false){
320
  if(Object.keys(response.data).length > 0){
321
  v_this.set_google_analytics_reports_value(response.data, post_data);
enhanced-ecommerce-google-analytics.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Google Analytics and Google Shopping plugin for WooCommerce
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
18
- * Version: 4.3.3
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
@@ -23,7 +23,7 @@
23
  * Text Domain: www.tatvic.com
24
  * Domain Path: /languages
25
  * WC requires at least: 1.4.1
26
- * WC tested up to: 5.6.0
27
  */
28
 
29
  /**
@@ -37,7 +37,7 @@ if ( ! defined( 'WPINC' ) ) {
37
  * Start at version 1.0.0 and use SemVer - https://semver.org
38
  * Rename this for your plugin and update it as you release new versions.
39
  */
40
- define( 'PLUGIN_TVC_VERSION', '4.3.3' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
15
  * Plugin Name: Google Analytics and Google Shopping plugin for WooCommerce
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
18
+ * Version: 4.3.4
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
23
  * Text Domain: www.tatvic.com
24
  * Domain Path: /languages
25
  * WC requires at least: 1.4.1
26
+ * WC tested up to: 5.8.0
27
  */
28
 
29
  /**
37
  * Start at version 1.0.0 and use SemVer - https://semver.org
38
  * Rename this for your plugin and update it as you release new versions.
39
  */
40
+ define( 'PLUGIN_TVC_VERSION', '4.3.4' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
includes/setup/class-conversios-dashboard.php CHANGED
@@ -27,6 +27,7 @@ if ( ! class_exists( 'Conversios_Dashboard' ) ) {
27
 
28
  protected $connect_url;
29
  protected $g_mail;
 
30
  public function __construct( ){
31
 
32
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
@@ -42,6 +43,7 @@ if ( ! class_exists( 'Conversios_Dashboard' ) ) {
42
  } else if(isset($_GET['subscription_id']) && $_GET['subscription_id']){
43
  $this->notice = "You tried signing in with different email. Please try again by signing it with the email id that you used to set up the plugin earlier. <a href=\'".$this->TVC_Admin_Helper->get_conversios_site_url()."\' target=\'_blank\'>Reach out to us</a> if you have any difficulty.";
44
  }
 
45
  $this->subscription_data = $this->TVC_Admin_Helper->get_user_subscription_data();
46
  $this->pro_plan_site = $this->TVC_Admin_Helper->get_pro_plan_site().'?utm_source=EE+Plugin+User+Interface&utm_medium=dashboard&utm_campaign=Upsell+at+Conversios';
47
  if(isset($this->subscription_data->plan_id) && !in_array($this->subscription_data->plan_id, array("1"))){
@@ -51,14 +53,14 @@ if ( ! class_exists( 'Conversios_Dashboard' ) ) {
51
  $this->google_ads_id = $this->subscription_data->google_ads_id;
52
  }
53
 
54
-
55
-
56
  if( $this->subscription_id != "" ){
57
  $this->g_mail = get_option('ee_customer_gmail');
58
  $this->ga_traking_type = $this->subscription_data->tracking_option; // UA,GA4,BOTH
59
  $this->ga3_property_id = $this->subscription_data->property_id; // GA3
60
  $this->ga3_ua_analytic_account_id = $this->subscription_data->ua_analytic_account_id;
61
- $this->set_ga3_view_id_and_ga3_currency();
 
 
62
  $this->ga4_measurement_id = $this->subscription_data->measurement_id; //GA4 ID
63
  }else{
64
  wp_redirect("admin.php?page=conversios_onboarding");
@@ -131,6 +133,9 @@ if ( ! class_exists( 'Conversios_Dashboard' ) ) {
131
  }
132
  var plan_id = '<?php echo $this->plan_id; ?>';
133
  var g_mail = '<?php echo $this->g_mail; ?>';
 
 
 
134
  //$(function() {
135
  var start = moment().subtract(30, 'days');
136
  var end = moment();
@@ -159,9 +164,15 @@ if ( ! class_exists( 'Conversios_Dashboard' ) ) {
159
  conversios_nonce:'<?php echo wp_create_nonce( 'conversios_nonce' ); ?>'
160
  };
161
  // Call API
162
- if(notice == ""){
163
  tvc_helper.get_google_analytics_reports(data);
164
  }
 
 
 
 
 
 
165
  }
166
  $('#reportrange').daterangepicker({
167
  startDate: start,
27
 
28
  protected $connect_url;
29
  protected $g_mail;
30
+ protected $is_refresh_token_expire;
31
  public function __construct( ){
32
 
33
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
43
  } else if(isset($_GET['subscription_id']) && $_GET['subscription_id']){
44
  $this->notice = "You tried signing in with different email. Please try again by signing it with the email id that you used to set up the plugin earlier. <a href=\'".$this->TVC_Admin_Helper->get_conversios_site_url()."\' target=\'_blank\'>Reach out to us</a> if you have any difficulty.";
45
  }
46
+ $this->is_refresh_token_expire = $this->TVC_Admin_Helper->is_refresh_token_expire();
47
  $this->subscription_data = $this->TVC_Admin_Helper->get_user_subscription_data();
48
  $this->pro_plan_site = $this->TVC_Admin_Helper->get_pro_plan_site().'?utm_source=EE+Plugin+User+Interface&utm_medium=dashboard&utm_campaign=Upsell+at+Conversios';
49
  if(isset($this->subscription_data->plan_id) && !in_array($this->subscription_data->plan_id, array("1"))){
53
  $this->google_ads_id = $this->subscription_data->google_ads_id;
54
  }
55
 
 
 
56
  if( $this->subscription_id != "" ){
57
  $this->g_mail = get_option('ee_customer_gmail');
58
  $this->ga_traking_type = $this->subscription_data->tracking_option; // UA,GA4,BOTH
59
  $this->ga3_property_id = $this->subscription_data->property_id; // GA3
60
  $this->ga3_ua_analytic_account_id = $this->subscription_data->ua_analytic_account_id;
61
+ if($this->is_refresh_token_expire == false){
62
+ $this->set_ga3_view_id_and_ga3_currency();
63
+ }
64
  $this->ga4_measurement_id = $this->subscription_data->measurement_id; //GA4 ID
65
  }else{
66
  wp_redirect("admin.php?page=conversios_onboarding");
133
  }
134
  var plan_id = '<?php echo $this->plan_id; ?>';
135
  var g_mail = '<?php echo $this->g_mail; ?>';
136
+ var is_refresh_token_expire = '<?php echo $this->is_refresh_token_expire; ?>';
137
+ is_refresh_token_expire = (is_refresh_token_expire == "")?false:true;
138
+ console.log(is_refresh_token_expire);
139
  //$(function() {
140
  var start = moment().subtract(30, 'days');
141
  var end = moment();
164
  conversios_nonce:'<?php echo wp_create_nonce( 'conversios_nonce' ); ?>'
165
  };
166
  // Call API
167
+ if(notice == "" && is_refresh_token_expire == false){
168
  tvc_helper.get_google_analytics_reports(data);
169
  }
170
+
171
+ if(notice == "" && is_refresh_token_expire == true && g_mail != ""){
172
+ tvc_helper.tvc_alert("error","","It seems the token to access your Google Analytics account is expired. Sign in with "+g_mail+" again to reactivate the token. <span class='google_connect_url'>Click here..</span>");
173
+ }else if(notice == "" && is_refresh_token_expire == true ){
174
+ tvc_helper.tvc_alert("error","","It seems the token to access your Google Analytics account is expired. Sign in with the connected email again to reactivate the token. <span class='google_connect_url'>Click here..</span>");
175
+ }
176
  }
177
  $('#reportrange').daterangepicker({
178
  startDate: start,
readme.txt CHANGED
@@ -8,8 +8,8 @@ Author: Tatvic
8
  Requires at least: 1.4.1
9
  Tested up to: 5.8.1
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 4.3.3
12
- Version: 4.3.3
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
@@ -380,6 +380,11 @@ You can resolve the duplication of data by removing the manually implemented GA
380
 
381
  == Changelog ==
382
 
 
 
 
 
 
383
  = 4.3.3 - 14/10/2021 =
384
 
385
  * Performance enhancement for product sync
8
  Requires at least: 1.4.1
9
  Tested up to: 5.8.1
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 4.3.4
12
+ Version: 4.3.4
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
380
 
381
  == Changelog ==
382
 
383
+ = 4.3.4 - 21/10/2021 =
384
+
385
+ * Site verification and domainc claim issue got fixed for the manually created merchant center accounts
386
+ * Some users were facing difficulty on the onboarding page because of the access token expiry. The issue is fixed now.
387
+
388
  = 4.3.3 - 14/10/2021 =
389
 
390
  * Performance enhancement for product sync