Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.6.7

Version Description

  • 11/03/2022 =
  • Fix: - Fixed the Google ads converstion tracking issue for some users.
Download this release

Release Info

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

Code changes from version 4.6.6 to 4.6.7

admin/class-conversios-onboarding.php CHANGED
@@ -507,7 +507,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
507
  </form>
508
  </div>
509
  <div class="stepnotewrp">
510
- <?php esc_html_e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at <a href="#">Google Merchant Center Help</a> website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
511
  </div>
512
  </div>
513
  </div>
507
  </form>
508
  </div>
509
  <div class="stepnotewrp">
510
+ <?php esc_html_e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at Google Merchant Center Help website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
511
  </div>
512
  </div>
513
  </div>
admin/class-tvc-admin-helper.php CHANGED
@@ -247,7 +247,7 @@ Class TVC_Admin_Helper{
247
  $rs = $this->customApiObj->get_remarketing_snippets($customer_id);
248
  $remarketing_snippets=array();
249
  if(property_exists($rs,"error") && $rs->error == false){
250
- if(property_exists($rs,"data") && $rs->data != "" && isset($remarketing_snippets["snippets"])) {
251
  $remarketing_snippets["snippets"]=base64_encode($rs->data->snippets);
252
  $remarketing_snippets["id"]=$rs->data->id;
253
  }
@@ -725,15 +725,15 @@ Class TVC_Admin_Helper{
725
  $call_js_function_args="";
726
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
727
  $title = esc_html__("Site verification and Domain claim for merchant center account failed.","conversios");
728
- $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","conversios");
729
  $call_js_function_args = "both";
730
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
731
  $title = esc_html__("Site verification for merchant center account failed.","conversios");
732
- $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","conversios");
733
  $call_js_function_args = "site_verified";
734
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
735
- $title = esc_html__("Site verification for merchant center account failed.","conversios");
736
- $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","conversios");
737
  $call_js_function_args = "domain_claim";
738
  }
739
  if($message!= "" && $title != ""){
@@ -823,7 +823,7 @@ Class TVC_Admin_Helper{
823
  ];
824
  $claimWebsite = $this->customApiObj->claimWebsite($postData);
825
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
826
- return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
827
  }else{
828
  $this->update_subscription_details_api_to_db();
829
  return array('error'=>false, 'msg'=>esc_html__("Domain claimed successfully.", "conversios"));
@@ -852,7 +852,7 @@ Class TVC_Admin_Helper{
852
  $siteVerificationToken = $this->customApiObj->siteVerificationToken($postData);
853
 
854
  if(isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)){
855
- goto call_method_tag;
856
  }else{
857
  $myFile = ABSPATH.$siteVerificationToken->data->token;
858
  if(!file_exists($myFile)){
@@ -865,7 +865,6 @@ Class TVC_Admin_Helper{
865
  $postData['method']="file";
866
  $siteVerification = $this->customApiObj->siteVerification($postData);
867
  if(isset($siteVerification->error) && !empty($siteVerification->errors)){
868
- call_method_tag:
869
  //methd using tag
870
  $postData['method']="meta";
871
  $siteVerificationToken_tag = $this->customApiObj->siteVerificationToken($postData);
@@ -878,13 +877,13 @@ Class TVC_Admin_Helper{
878
  sleep(1);
879
  $siteVerification_tag = $this->customApiObj->siteVerification($postData);
880
  if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
881
- return array('error'=>true, 'msg'=>esc_html($siteVerification_tag->errors[0]));
882
  }else{
883
  $this->update_subscription_details_api_to_db();
884
  return array('error'=>false, 'msg'=>esc_html__("Site verification successfully.","conversios"));
885
  }
886
  }else{
887
- return array('error'=>true, 'msg'=> esc_html($siteVerificationToken_tag->errors[0]));
888
  }
889
  // one more try
890
  }else{
247
  $rs = $this->customApiObj->get_remarketing_snippets($customer_id);
248
  $remarketing_snippets=array();
249
  if(property_exists($rs,"error") && $rs->error == false){
250
+ if(property_exists($rs,"data") && $rs->data != "" && property_exists($rs->data,"snippets")) {
251
  $remarketing_snippets["snippets"]=base64_encode($rs->data->snippets);
252
  $remarketing_snippets["id"]=$rs->data->id;
253
  }
725
  $call_js_function_args="";
726
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
727
  $title = esc_html__("Site verification and Domain claim for merchant center account failed.","conversios");
728
+ $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","conversios");
729
  $call_js_function_args = "both";
730
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
731
  $title = esc_html__("Site verification for merchant center account failed.","conversios");
732
+ $message = esc_html__("Without a verified website, your product will get disapproved.","conversios");
733
  $call_js_function_args = "site_verified";
734
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
735
+ $title = esc_html__("Site claimed website for merchant center account failed.","conversios");
736
+ $message = esc_html__("Without a claimed website, your product will get disapproved.","conversios");
737
  $call_js_function_args = "domain_claim";
738
  }
739
  if($message!= "" && $title != ""){
823
  ];
824
  $claimWebsite = $this->customApiObj->claimWebsite($postData);
825
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
826
+ return array('error'=>true, 'msg'=>$claimWebsite->errors);
827
  }else{
828
  $this->update_subscription_details_api_to_db();
829
  return array('error'=>false, 'msg'=>esc_html__("Domain claimed successfully.", "conversios"));
852
  $siteVerificationToken = $this->customApiObj->siteVerificationToken($postData);
853
 
854
  if(isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)){
855
+ return array('error'=>true, 'msg'=> esc_attr($siteVerificationToken->errors));
856
  }else{
857
  $myFile = ABSPATH.$siteVerificationToken->data->token;
858
  if(!file_exists($myFile)){
865
  $postData['method']="file";
866
  $siteVerification = $this->customApiObj->siteVerification($postData);
867
  if(isset($siteVerification->error) && !empty($siteVerification->errors)){
 
868
  //methd using tag
869
  $postData['method']="meta";
870
  $siteVerificationToken_tag = $this->customApiObj->siteVerificationToken($postData);
877
  sleep(1);
878
  $siteVerification_tag = $this->customApiObj->siteVerification($postData);
879
  if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
880
+ return array('error'=>true, 'msg'=>esc_html($siteVerification_tag->errors));
881
  }else{
882
  $this->update_subscription_details_api_to_db();
883
  return array('error'=>false, 'msg'=>esc_html__("Site verification successfully.","conversios"));
884
  }
885
  }else{
886
+ return array('error'=>true, 'msg'=> esc_html($siteVerificationToken_tag->errors));
887
  }
888
  // one more try
889
  }else{
admin/helper/class-onboarding-helper.php CHANGED
@@ -1063,7 +1063,7 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
1063
  if(isset($response->data) && count($response->data) > 0){
1064
  $return->message = esc_html__("Google Ads conversion tracking setting success.","conversios");
1065
  }else{
1066
- $response = $this->createConversion($data);
1067
  if(isset($response->error) && $response->error == false){
1068
  $return->error = false;
1069
  $return->message = esc_html__("Google Ads conversion tracking setting success.","conversios");
1063
  if(isset($response->data) && count($response->data) > 0){
1064
  $return->message = esc_html__("Google Ads conversion tracking setting success.","conversios");
1065
  }else{
1066
+ $response = $this->createConversion($postData);
1067
  if(isset($response->error) && $response->error == false){
1068
  $return->error = false;
1069
  $return->message = esc_html__("Google Ads conversion tracking setting success.","conversios");
admin/js/onboarding-custom.js CHANGED
@@ -744,7 +744,7 @@ function list_google_merchant_account(tvc_data){
744
  success: function (response) {
745
  if (response.error === false){
746
  jQuery('#google_merchant_center_id').empty();
747
- jQuery('#google_merchant_center_id').append(jQuery('<option>', {value: "", text: "Select Measurement Id"}));
748
  if (response.data.length > 0) {
749
  $.each(response.data, function (key, value) {
750
  if(selectedValue == value.account_id){
744
  success: function (response) {
745
  if (response.error === false){
746
  jQuery('#google_merchant_center_id').empty();
747
+ jQuery('#google_merchant_center_id').append(jQuery('<option>', {value: "", text: "Select Google Merchant Center"}));
748
  if (response.data.length > 0) {
749
  $.each(response.data, function (key, value) {
750
  if(selectedValue == value.account_id){
admin/partials/general-fields.php CHANGED
@@ -3,138 +3,6 @@ echo "<script>var return_url ='".esc_url_raw($this->url)."';</script>";
3
  $TVC_Admin_Helper = new TVC_Admin_Helper();
4
  $class = "";
5
  $message_p = "";
6
- if (isset($_GET['connect']) && isset($_GET['subscription_id'])) {
7
- /*
8
- * save subscription_id in "ee_options" and then API call for get subscription details
9
- */
10
- if (isset($_GET['subscription_id']) && sanitize_text_field($_GET['subscription_id'])) {
11
- $settings = $TVC_Admin_Helper->get_ee_options_settings();
12
- $settings['subscription_id'] = sanitize_text_field($_GET['subscription_id']);
13
- $TVC_Admin_Helper->save_ee_options_settings($settings);
14
- }
15
- $customApiObj = new CustomApi();
16
- $google_detail = $customApiObj->getGoogleAnalyticDetail();
17
- /*
18
- * active licence key while come from server page
19
- */
20
- $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
21
- if(isset($ee_additional_data['temp_active_licence_key']) && $ee_additional_data['temp_active_licence_key'] != ""){
22
- $licence_key = $ee_additional_data['temp_active_licence_key'];
23
- $TVC_Admin_Helper->active_licence($licence_key, sanitize_text_field($_GET['subscription_id']));
24
- unset($ee_additional_data['temp_active_licence_key']);
25
- $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
26
- }
27
-
28
- if(property_exists($google_detail,"error") && $google_detail->error == false && !isset($_POST['ee_submit_plugin'])){
29
- if(property_exists($google_detail,"data") && $google_detail->data != ""){
30
- /*
31
- * function call for save conversion send to in WP DB
32
- */
33
- $googleDetail = $google_detail->data;
34
- if($googleDetail->plan_id != 1 && $googleDetail->google_ads_conversion_tracking == 1){
35
- $TVC_Admin_Helper->update_conversion_send_to();
36
- }
37
- //'website_url' => $googleDetail->site_url,
38
- $postData = [
39
- 'merchant_id' => sanitize_text_field($googleDetail->merchant_id),
40
- 'website_url' => get_site_url(),
41
- 'subscription_id' => sanitize_text_field($googleDetail->id),
42
- 'account_id' => sanitize_text_field($googleDetail->google_merchant_center_id)
43
- ];
44
-
45
- if ($googleDetail->is_site_verified == '0') {
46
- $postData['method']="file";
47
- $siteVerificationToken = $customApiObj->siteVerificationToken($postData);
48
- if (isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)) {
49
- goto call_method_tag;
50
- } else {
51
- $myFile = ABSPATH.$siteVerificationToken->data->token;
52
- if (!file_exists($myFile)) {
53
- $fh = fopen($myFile, 'w+');
54
- chmod($myFile,0777);
55
- $stringData = "google-site-verification: ".$siteVerificationToken->data->token;
56
- fwrite($fh, $stringData);
57
- fclose($fh);
58
- }
59
- $postData['method']="file";
60
- $siteVerification = $customApiObj->siteVerification($postData);
61
- if (isset($siteVerification->error) && !empty($siteVerification->errors)) {
62
- call_method_tag:
63
- //methd using tag
64
- $postData['method']="meta";
65
- $siteVerificationToken_tag = $customApiObj->siteVerificationToken($postData);
66
- if(isset($siteVerificationToken_tag->data->token) && $siteVerificationToken_tag->data->token){
67
- $TVC_Admin_Helper->set_ee_additional_data(array("add_site_varification_tag"=>1,"site_varification_tag_val"=> base64_encode($siteVerificationToken_tag->data->token)));
68
- sleep(1);
69
- $siteVerification_tag = $customApiObj->siteVerification($postData);
70
- if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
71
- }else{
72
- $googleDetail->is_site_verified = '1';
73
- }
74
- }
75
- } else {
76
- $googleDetail->is_site_verified = '1';
77
- }
78
- }
79
- }
80
- if ($googleDetail->is_domain_claim == '0') {
81
- $claimWebsite = $customApiObj->claimWebsite($postData);
82
- if (isset($claimWebsite->error) && !empty($claimWebsite->errors)) {
83
- } else {
84
- $googleDetail->is_domain_claim = '1';
85
- }
86
- }
87
-
88
- $settings['subscription_id'] = sanitize_text_field($googleDetail->id);
89
- $settings['ga_eeT'] = (isset($googleDetail->enhanced_e_commerce_tracking) && $googleDetail->enhanced_e_commerce_tracking == "1") ? "on" : "";
90
-
91
- $settings['ga_ST'] = (isset($googleDetail->add_gtag_snippet) && $googleDetail->add_gtag_snippet == "1") ? "on" : "";
92
- $settings['gm_id'] = sanitize_text_field($googleDetail->measurement_id);
93
- $settings['ga_id'] = sanitize_text_field($googleDetail->property_id);
94
- $settings['google_ads_id'] = sanitize_text_field($googleDetail->google_ads_id);
95
- $settings['google_merchant_id'] = sanitize_text_field($googleDetail->google_merchant_center_id);
96
- $settings['tracking_option'] = sanitize_text_field($googleDetail->tracking_option);
97
- $settings['ga_gUser'] = 'on';
98
- //$_POST['ga_gCkout'] = 'on';
99
- $settings['ga_Impr'] = 6;
100
- $settings['ga_IPA'] = 'on';
101
- $settings['ga_OPTOUT'] = 'on';
102
- $settings['ga_PrivacyPolicy'] = 'on';
103
- $settings['google-analytic'] = '';
104
- //update option in wordpress local database
105
- update_option('google_ads_conversion_tracking', $googleDetail->google_ads_conversion_tracking);
106
- update_option('ads_tracking_id', $googleDetail->google_ads_id);
107
- update_option('ads_ert', $googleDetail->remarketing_tags);
108
- update_option('ads_edrt', $googleDetail->dynamic_remarketing_tags);
109
- $TVC_Admin_Helper->save_ee_options_settings($settings);
110
-
111
- /*
112
- * function call for save API data in WP DB
113
- */
114
- $TVC_Admin_Helper->set_update_api_to_db($googleDetail, false);
115
- /*
116
- * function call for save remarketing snippets in WP DB
117
- */
118
- $TVC_Admin_Helper->update_remarketing_snippets();
119
- if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
120
- if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
121
- wp_redirect(esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=sync_product_page&welcome_msg=true"));
122
- exit;
123
- }else{
124
- wp_redirect(esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=gaa_config_page&welcome_msg=true"));
125
- exit;
126
- }
127
- }
128
- }
129
- }
130
- } else if(isset($_GET['connect']) && !isset($_POST['ee_submit_plugin'])) {
131
- $googleDetail = [];
132
- $class = 'alert-message tvc-alert-error';
133
- $message_p = esc_html__("Google analytic detail is empty.", "conversios");
134
- printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message_p));
135
- }else{
136
- $TVC_Admin_Helper->is_ee_options_data_empty();
137
- }
138
  if (isset($_POST['ee_submit_plugin'])) {
139
  $settings = $TVC_Admin_Helper->get_ee_options_settings();
140
  if(!empty(sanitize_text_field($_POST['ga_id']))){
3
  $TVC_Admin_Helper = new TVC_Admin_Helper();
4
  $class = "";
5
  $message_p = "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  if (isset($_POST['ee_submit_plugin'])) {
7
  $settings = $TVC_Admin_Helper->get_ee_options_settings();
8
  if(!empty(sanitize_text_field($_POST['ga_id']))){
enhanced-ecommerce-google-analytics.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Conversios.io - 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.6.6
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
@@ -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.6.6' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
15
  * Plugin Name: Conversios.io - 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.6.7
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
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.6.7' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
includes/setup/CustomApi.php CHANGED
@@ -727,6 +727,15 @@ class CustomApi{
727
  return $return;
728
  }else{
729
  $return->error = true;
 
 
 
 
 
 
 
 
 
730
  $return->data = $result->data;
731
  $return->status = $result->status;
732
  return $return;
@@ -773,8 +782,15 @@ class CustomApi{
773
  return $return;
774
  }else{
775
  $return->error = true;
776
- $return->errors = $result->errors;
777
-
 
 
 
 
 
 
 
778
  return $return;
779
  }
780
  } catch (Exception $e) {
@@ -815,8 +831,15 @@ class CustomApi{
815
  return $return;
816
  }else{
817
  $return->error = true;
818
- $return->errors = $result->errors;
819
-
 
 
 
 
 
 
 
820
  return $return;
821
  }
822
  } catch (Exception $e) {
727
  return $return;
728
  }else{
729
  $return->error = true;
730
+ if(is_array($result->errors) ){
731
+ if(count($result->errors) != count($result->errors, COUNT_RECURSIVE)){
732
+ $return->errors = implode("&",array_map(function($a) {return implode("~",$a);},$result->errors));
733
+ }else{
734
+ $return->errors = implode(" ",$result->errors);
735
+ }
736
+ }else{
737
+ $return->errors = $result->errors;
738
+ }
739
  $return->data = $result->data;
740
  $return->status = $result->status;
741
  return $return;
782
  return $return;
783
  }else{
784
  $return->error = true;
785
+ if(is_array($result->errors) ){
786
+ if(count($result->errors) != count($result->errors, COUNT_RECURSIVE)){
787
+ $return->errors = implode("&",array_map(function($a) {return implode("~",$a);},$result->errors));
788
+ }else{
789
+ $return->errors = implode(" ",$result->errors);
790
+ }
791
+ }else{
792
+ $return->errors = $result->errors;
793
+ }
794
  return $return;
795
  }
796
  } catch (Exception $e) {
831
  return $return;
832
  }else{
833
  $return->error = true;
834
+ if(is_array($result->errors) ){
835
+ if(count($result->errors) != count($result->errors, COUNT_RECURSIVE)){
836
+ $return->errors = implode("&",array_map(function($a) {return implode("~",$a);},$result->errors));
837
+ }else{
838
+ $return->errors = implode(" ",$result->errors);
839
+ }
840
+ }else{
841
+ $return->errors = $result->errors;
842
+ }
843
  return $return;
844
  }
845
  } catch (Exception $e) {
public/class-enhanced-ecommerce-google-analytics-public-pro.php CHANGED
@@ -706,8 +706,8 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
706
  $user_bill_addr="";
707
  $user_ship_addr="";
708
  if(isset($this->tvc_options["user_id"]) && $this->tvc_options["user_id"]!="" ){
709
- $user_bill_addr = get_user_meta($t_user_id->ID, 'shipping_city', true);
710
- $user_ship_addr = get_user_meta($t_user_id->ID, 'billing_city', true);
711
  }
712
  //orderpage transcation data json
713
  $orderpage_trans_Array=array(
@@ -1007,6 +1007,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1007
  }
1008
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1009
  gtag("event","view_item_list", {
 
1010
  "value": t_json_name[t_item].tvc_p,
1011
  "items": [
1012
  {
@@ -1026,6 +1027,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1026
  }
1027
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1028
  gtag("event","view_item_list", {
 
1029
  "value": t_json_name[t_item].tvc_p,
1030
  "items": [
1031
  {
@@ -1082,6 +1084,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1082
  });
1083
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1084
  gtag("event","add_to_cart", {
 
1085
  "value": t_prod_data_json[t_prod_url_key].tvc_p,
1086
  "items": [
1087
  {
@@ -1131,6 +1134,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1131
  }
1132
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1133
  gtag("event","view_item_list", {
 
1134
  "value": t_json_name[t_item].tvc_p,
1135
  "items": [
1136
  {
@@ -1153,6 +1157,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1153
  }
1154
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1155
  gtag("event","view_item_list", {
 
1156
  "value": t_json_name[t_item].tvc_p,
1157
  "items": [
1158
  {
@@ -1211,6 +1216,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1211
 
1212
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1213
  gtag("event","add_to_cart", {
 
1214
  "value": t_prod_data_json[t_prod_url_key].tvc_p,
1215
  "items": [
1216
  {
706
  $user_bill_addr="";
707
  $user_ship_addr="";
708
  if(isset($this->tvc_options["user_id"]) && $this->tvc_options["user_id"]!="" ){
709
+ $user_bill_addr = get_user_meta($this->tvc_options["user_id"], 'shipping_city', true);
710
+ $user_ship_addr = get_user_meta($this->tvc_options["user_id"], 'billing_city', true);
711
  }
712
  //orderpage transcation data json
713
  $orderpage_trans_Array=array(
1007
  }
1008
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1009
  gtag("event","view_item_list", {
1010
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1011
  "value": t_json_name[t_item].tvc_p,
1012
  "items": [
1013
  {
1027
  }
1028
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1029
  gtag("event","view_item_list", {
1030
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1031
  "value": t_json_name[t_item].tvc_p,
1032
  "items": [
1033
  {
1084
  });
1085
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1086
  gtag("event","add_to_cart", {
1087
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1088
  "value": t_prod_data_json[t_prod_url_key].tvc_p,
1089
  "items": [
1090
  {
1134
  }
1135
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1136
  gtag("event","view_item_list", {
1137
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1138
  "value": t_json_name[t_item].tvc_p,
1139
  "items": [
1140
  {
1157
  }
1158
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1159
  gtag("event","view_item_list", {
1160
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1161
  "value": t_json_name[t_item].tvc_p,
1162
  "items": [
1163
  {
1216
 
1217
  if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
1218
  gtag("event","add_to_cart", {
1219
+ "send_to":"' . esc_js($this->remarketing_snippet_id) . '",
1220
  "value": t_prod_data_json[t_prod_url_key].tvc_p,
1221
  "items": [
1222
  {
public/js/tvc-ee-google-analytics.js CHANGED
@@ -321,10 +321,10 @@ class TVC_Enhanced {
321
  var ads_value=0;
322
  for(var t_item in tvc_oc){
323
  ads_value=ads_value + parseFloat(tvc_oc[t_item].tvc_p);
324
- ads_items.push({
325
- item_id: tvc_oc[t_item].tvc_i,
326
- google_business_vertical: "retail"
327
- });
328
  }
329
  gtag("event","purchase", {
330
  "send_to":this.options.remarketing_snippet_id,
321
  var ads_value=0;
322
  for(var t_item in tvc_oc){
323
  ads_value=ads_value + parseFloat(tvc_oc[t_item].tvc_p);
324
+ ads_items.push({
325
+ item_id: tvc_oc[t_item].tvc_i,
326
+ google_business_vertical: "retail"
327
+ });
328
  }
329
  gtag("event","purchase", {
330
  "send_to":this.options.remarketing_snippet_id,
readme.txt CHANGED
@@ -8,8 +8,8 @@ Author: Tatvic
8
  Requires at least: 3.5.0
9
  Tested up to: 5.9.1
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 4.6.6
12
- Version: 4.6.6
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
@@ -379,6 +379,8 @@ You can resolve the duplication of data by removing the manually implemented GA
379
 
380
 
381
  == Changelog ==
 
 
382
 
383
  = 4.6.6 - 03/03/2022 =
384
  * New: In this release, we have Enhanced and optimized in Google Analytics tracking event.
8
  Requires at least: 3.5.0
9
  Tested up to: 5.9.1
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 4.6.7
12
+ Version: 4.6.7
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
379
 
380
 
381
  == Changelog ==
382
+ = 4.6.7 - 11/03/2022 =
383
+ * Fix: - Fixed the Google ads converstion tracking issue for some users.
384
 
385
  = 4.6.6 - 03/03/2022 =
386
  * New: In this release, we have Enhanced and optimized in Google Analytics tracking event.