Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 5.0.0

Version Description

  • 20/10/2022 =
  • Conversios is geared up for this festive season and with that Conversios is coming up with an array of much demanded features for its users.
  • Conversios is the best plugin available in the market for Google Analytics tracking for WooCommerce stores. It is for sure the fastest and the most efficient (95% accuracy guaranteed) plugin for data collection in Google Analytics and GA4.
  • At Conversios, we thrive to be your one stop solution for all the MarTech needs and keeping that in focus, we are bringing up 2 major feature updates that many of you were demanding for a while.
  • What are we bringing for you? Google Tag Manager based single click implementation for Google Analytics, Google Analytics 4, and multiple ad pixel integrations like Meta, Snapchat, Tiktok, Pinterest, Google Ads, Twitter, Microsoft Bing Ads Use your own Google Tag Manager account with the conversios plugin.
  • What will you get out of it?
    1. Google Tag Manager based implementation helps in data collection accuracy and you have more control over your tags implemented on the website.
    2. Many websites page speed decreases because of gtag.js implementation as it renders multiple Javascripts on the website. Google Tag Manager based implementation uses datalayer to push data to GA or other ad channels and it renders only once on your web page. Hence, your site speed will be intact with this approach.
    3. Debugging which events are tracking correctly or not becomes a lot easier in Google Tag Manager based implementation. Hence, less possibility of data leakage from your web store and more insights from the visitors.
    4. Google Tag Manager based implementation will prepare you for the next privacy-centric industry revolution leveraging first party cookies. Sooner or later stores like yours will have to go for server side tagging. GTM based implementation is our first step for you in that direction.
    5. If you want us to add any other pixel in the plugin, shout out and that will be done in 3 business days.
Download this release

Release Info

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

Code changes from version 4.9.4 to 5.0.0

Files changed (35) hide show
  1. admin/class-conversios-admin.php +6 -3
  2. admin/class-conversios-onboarding.php +3 -2
  3. admin/class-enhanced-ecommerce-google-analytics-admin.php +39 -21
  4. admin/class-tvc-admin-auto-product-sync-helper.php +54 -21
  5. admin/class-tvc-admin-helper.php +276 -120
  6. admin/css/enhanced-ecommerce-google-analytics-admin.css +13 -0
  7. admin/css/style.css +27 -9
  8. admin/helper/class-onboarding-helper.php +30 -6
  9. admin/images/bing_icon.png +0 -0
  10. admin/images/fb-icon.png +0 -0
  11. admin/images/fevicon.gif +0 -0
  12. admin/images/pinterest_icon.png +0 -0
  13. admin/images/snapchat_icon.png +0 -0
  14. admin/images/tiKtok_icon.png +0 -0
  15. admin/images/twitter_icon.png +0 -0
  16. admin/js/tvc-ee-custom.js +14 -14
  17. admin/partials/class-conversios-header.php +5 -5
  18. admin/partials/general-fields.php +716 -520
  19. enhanced-ecommerce-google-analytics.php +11 -6
  20. includes/class-enhanced-ecommerce-google-analytics.php +6 -1
  21. includes/data/class-tvc-ajax-file.php +243 -3
  22. includes/setup/CustomApi.php +12 -8
  23. includes/setup/class-tatvic-category-selector-element.php +1 -1
  24. includes/setup/class-tvc-product-sync-helper.php +259 -101
  25. includes/setup/google-shopping-feed-gaa-config.php +39 -47
  26. includes/setup/google-shopping-feed-sync-product.php +96 -6
  27. includes/setup/plugins/datepicker/jquery-ui.css +1311 -0
  28. includes/setup/pmax-add.php +10 -6
  29. includes/setup/pmax-edit.php +2 -2
  30. includes/setup/tatvic-category-wrapper.php +35 -1
  31. public/class-con-settings.php +190 -0
  32. public/class-enhanced-ecommerce-google-analytics-public-pro.php +755 -182
  33. public/class-enhanced-ecommerce-google-analytics-public.php +645 -213
  34. public/js/con-gtm-google-analytics.js +343 -0
  35. readme.txt +110 -298
admin/class-conversios-admin.php CHANGED
@@ -177,8 +177,10 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
177
  wp_register_style('conversios-daterangepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css') );
178
  wp_enqueue_style('conversios-daterangepicker-css');
179
  }else if(sanitize_text_field($_GET['page']) == "conversios-pmax"){
180
- wp_register_style('tvc-bootstrap-datepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css'));
181
- wp_enqueue_style('tvc-bootstrap-datepicker-css');
 
 
182
  }
183
  //all conversios page css
184
  wp_enqueue_style('conversios-style-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), esc_attr($this->version), 'all' );
@@ -208,7 +210,8 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
208
  //wp_enqueue_script( 'conversios-chart-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js') );
209
  wp_enqueue_script( 'conversios-pmax-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/pmax-custom.js'), array( 'jquery' ), esc_attr($this->version), false );
210
  wp_register_script('tvc-bootstrap-datepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
211
- wp_enqueue_script('tvc-bootstrap-datepicker-js');
 
212
  }
213
  }
214
  }
177
  wp_register_style('conversios-daterangepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css') );
178
  wp_enqueue_style('conversios-daterangepicker-css');
179
  }else if(sanitize_text_field($_GET['page']) == "conversios-pmax"){
180
+ //wp_register_style('tvc-bootstrap-datepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css'));
181
+ //wp_enqueue_style('tvc-bootstrap-datepicker-css');
182
+ wp_register_style( 'jquery-ui', esc_url_raw(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/jquery-ui.css') );
183
+ wp_enqueue_style( 'jquery-ui' );
184
  }
185
  //all conversios page css
186
  wp_enqueue_style('conversios-style-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), esc_attr($this->version), 'all' );
210
  //wp_enqueue_script( 'conversios-chart-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js') );
211
  wp_enqueue_script( 'conversios-pmax-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/pmax-custom.js'), array( 'jquery' ), esc_attr($this->version), false );
212
  wp_register_script('tvc-bootstrap-datepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
213
+ wp_enqueue_script('tvc-bootstrap-datepicker-js');
214
+ wp_enqueue_script( 'jquery-ui-datepicker' );
215
  }
216
  }
217
  }
admin/class-conversios-onboarding.php CHANGED
@@ -187,7 +187,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
187
  #wpadminbar{display: none;}
188
  </style>
189
  <div class="bodyrightpart onbordingbody-wapper">
190
- <div class="loader-section" id="loader-section"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/ajax-loader.gif');?>" alt="loader"></div>
191
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
192
  <div class="onbordingbody">
193
  <div class="site-header">
@@ -860,7 +860,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
860
  //console.log("ga4_acc_val",ga4_acc_val);
861
  //console.log("googleAds",googleAds);
862
  //console.log("gmc_field",gmc_field);
863
- if(ua_acc_val == 1 || ga4_acc_val == 1){
864
  call_list_analytics_account(tvc_data,1); //call analytics api first time
865
  }
866
 
@@ -1178,6 +1178,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
1178
  let tr_ads = save_google_ads_data(google_ads_id, tvc_data, subscription_id, false );
1179
  if(tr_ads){
1180
  go_next(this);
 
1181
  }
1182
  }
1183
 
187
  #wpadminbar{display: none;}
188
  </style>
189
  <div class="bodyrightpart onbordingbody-wapper">
190
+ <div class="loader-section" id="loader-section"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/fevicon.gif');?>" alt="loader"></div>
191
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
192
  <div class="onbordingbody">
193
  <div class="site-header">
860
  //console.log("ga4_acc_val",ga4_acc_val);
861
  //console.log("googleAds",googleAds);
862
  //console.log("gmc_field",gmc_field);
863
+ if(subscription_id != "" && (ua_acc_val == 1 || ga4_acc_val == 1)){
864
  call_list_analytics_account(tvc_data,1); //call analytics api first time
865
  }
866
 
1178
  let tr_ads = save_google_ads_data(google_ads_id, tvc_data, subscription_id, false );
1179
  if(tr_ads){
1180
  go_next(this);
1181
+ list_google_merchant_account(tvc_data);
1182
  }
1183
  }
1184
 
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -56,7 +56,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
56
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_a']) && $ee_additional_data['dismissed_ee_adimin_notic_a'] == 1){
57
  }else{
58
  if(!$this->get_subscriptionId()){
59
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
60
  <p>'. esc_html__("Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("CONFIGURE NOW","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
61
  </div>';
62
  }
@@ -67,7 +67,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
67
  if(isset($google_detail['setting']) && $google_detail['setting']){
68
  $googleDetail = $google_detail['setting'];
69
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
70
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_b">
71
  <p>'. esc_html__("Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("Automate now","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
72
  </div>';
73
 
@@ -76,7 +76,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
76
  }
77
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
78
  }else{
79
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_c">
80
  <p>'. esc_html__("Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("View it from here.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
81
  </div>';
82
 
@@ -87,7 +87,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
87
  }else{
88
 
89
  if($fb_pixel_id == ""){
90
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_d">
91
  <img style="float: left; height: 45px;" src="'.esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/fb-pixel.jpg").'" ><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Introducing the all-new Facebook Pixel Tracking in Conversios today!","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios-google-analytics#fb_pixel_id').'"><b><u>'. esc_html__(" Check it out for yourself.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
92
  </div>';
93
  }
@@ -97,7 +97,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
97
  }else if(( isset($ee_additional_data['dismissed_ee_adimin_notic_d']) && $ee_additional_data['dismissed_ee_adimin_notic_d'] == 1) || $fb_pixel_id != ""){
98
  $gm_id = isset($ee_settings['gm_id'])?$ee_settings['gm_id']:"";
99
  if($gm_id != ""){
100
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_e">
101
  <img style="float: left; height: 45px;" src="'.esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/icon-dashboard.jpg").'" ><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Your GA4 Dashboard is just a click away !","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios&ga_type=ga4').'"><b><u>'. esc_html__(" Go to GA4 Dashboard.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
102
  </div>';
103
  }
@@ -105,27 +105,44 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
105
 
106
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_f']) && $ee_additional_data['dismissed_ee_adimin_notic_f'] == 1){
107
  }else {
108
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_f"><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Grow your business with Performance Max Campaigns. You can create a campaign through our plugin with just a few clicks, and promote products across Google Platforms,","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios-pmax').'"><b><u>'. esc_html__(" Try now.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
109
  </div>';
110
 
111
  }
112
  ?>
113
  <script>
114
- var tvc_ajax_url = '<?php echo esc_url_raw(admin_url( 'admin-ajax.php' )); ?>';
115
- (function( $ ) {
116
- jQuery( function() {
117
- jQuery( '.notice' ).on( 'click', '.notice-dismiss', function( event, el ) {
118
- var ee_notice_dismiss_id = jQuery(this).parent('.is-dismissible').attr("data-id");
119
- jQuery.post(tvc_ajax_url,{
120
- action: "tvc_call_notice_dismiss",
121
- data:{ee_notice_dismiss_id:ee_notice_dismiss_id},
122
- dataType: "json"
123
- },function( response ){
 
124
  });
125
  });
126
- });
127
- })( jQuery );
128
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  <?php
130
  }
131
 
@@ -146,7 +163,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
146
  }else{
147
  wp_register_style('plugin-bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css') );
148
  }
149
- wp_enqueue_style('plugin-bootstrap');
150
  wp_enqueue_style('custom-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css'), array(), esc_attr($this->version), 'all' );
151
  //if(is_rtl()){ }
152
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
@@ -203,8 +220,9 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
203
  wp_enqueue_script('plugin-select2');
204
  wp_register_script('plugin-chart', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js'));
205
  wp_enqueue_script('plugin-chart');
206
- wp_register_script('tvc-bootstrap-datepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
207
- wp_enqueue_script('tvc-bootstrap-datepicker-js');
 
208
  }
209
  }
210
  }
56
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_a']) && $ee_additional_data['dismissed_ee_adimin_notic_a'] == 1){
57
  }else{
58
  if(!$this->get_subscriptionId()){
59
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_a">
60
  <p>'. esc_html__("Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("CONFIGURE NOW","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
61
  </div>';
62
  }
67
  if(isset($google_detail['setting']) && $google_detail['setting']){
68
  $googleDetail = $google_detail['setting'];
69
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
70
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_b">
71
  <p>'. esc_html__("Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("Automate now","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
72
  </div>';
73
 
76
  }
77
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
78
  }else{
79
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_c">
80
  <p>'. esc_html__("Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI.","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("View it from here.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
81
  </div>';
82
 
87
  }else{
88
 
89
  if($fb_pixel_id == ""){
90
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_d">
91
  <img style="float: left; height: 45px;" src="'.esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/fb-pixel.jpg").'" ><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Introducing the all-new Facebook Pixel Tracking in Conversios today!","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios-google-analytics#fb_pixel_id').'"><b><u>'. esc_html__(" Check it out for yourself.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
92
  </div>';
93
  }
97
  }else if(( isset($ee_additional_data['dismissed_ee_adimin_notic_d']) && $ee_additional_data['dismissed_ee_adimin_notic_d'] == 1) || $fb_pixel_id != ""){
98
  $gm_id = isset($ee_settings['gm_id'])?$ee_settings['gm_id']:"";
99
  if($gm_id != ""){
100
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_e">
101
  <img style="float: left; height: 45px;" src="'.esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/icon-dashboard.jpg").'" ><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Your GA4 Dashboard is just a click away !","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios&ga_type=ga4').'"><b><u>'. esc_html__(" Go to GA4 Dashboard.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
102
  </div>';
103
  }
105
 
106
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_f']) && $ee_additional_data['dismissed_ee_adimin_notic_f'] == 1){
107
  }else {
108
+ echo '<div class="notice notice-info is-dismissible con-admn-notice" data-id="ee_adimin_notic_f"><p style="line-height: 28px; margin-left: 5px; display: inline-block;">'. esc_html__("Grow your business with Performance Max Campaigns. You can create a campaign through our plugin with just a few clicks, and promote products across Google Platforms,","enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw('admin.php?page=conversios-pmax').'"><b><u>'. esc_html__(" Try now.","enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
109
  </div>';
110
 
111
  }
112
  ?>
113
  <script>
114
+ var tvc_ajax_url = '<?php echo esc_url_raw(admin_url( 'admin-ajax.php' )); ?>';
115
+ (function( $ ) {
116
+ jQuery( function() {
117
+ jQuery( '.notice.con-admn-notice' ).on( 'click', '.notice-dismiss', function( event, el ) {
118
+ var ee_notice_dismiss_id = jQuery(this).parent('.is-dismissible').attr("data-id");
119
+ jQuery.post(tvc_ajax_url,{
120
+ action: "tvc_call_notice_dismiss",
121
+ data:{ee_notice_dismiss_id:ee_notice_dismiss_id},
122
+ dataType: "json"
123
+ },function( response ){
124
+ });
125
  });
126
  });
127
+ })( jQuery );
 
128
  </script>
129
+
130
+ <script>
131
+ var tvc_ajax_url = '<?php echo esc_url_raw(admin_url( 'admin-ajax.php' )); ?>';
132
+ (function( $ ) {
133
+ jQuery( function() {
134
+ jQuery( '.notice-dismiss_trigger' ).on( 'click', '.notice-dismiss', function( event, el ) {
135
+ var ee_notice_dismiss_id_trigger = jQuery(this).parent('.is-dismissible').attr("data-id");
136
+ jQuery.post(tvc_ajax_url,{
137
+ action: "tvc_call_notice_dismiss_trigger",
138
+ data:{ee_notice_dismiss_id_trigger:ee_notice_dismiss_id_trigger},
139
+ dataType: "json"
140
+ },function( response ){
141
+ });
142
+ });
143
+ });
144
+ })( jQuery );
145
+ </script>
146
  <?php
147
  }
148
 
163
  }else{
164
  wp_register_style('plugin-bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css') );
165
  }
166
+ wp_enqueue_style('plugin-bootstrap');
167
  wp_enqueue_style('custom-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css'), array(), esc_attr($this->version), 'all' );
168
  //if(is_rtl()){ }
169
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
220
  wp_enqueue_script('plugin-select2');
221
  wp_register_script('plugin-chart', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js'));
222
  wp_enqueue_script('plugin-chart');
223
+ //wp_register_script('tvc-bootstrap-datepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
224
+ //wp_enqueue_script('tvc-bootstrap-datepicker-js');
225
+ wp_enqueue_script( 'jquery-ui-datepicker' );
226
  }
227
  }
228
  }
admin/class-tvc-admin-auto-product-sync-helper.php CHANGED
@@ -17,11 +17,13 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
17
  add_action('admin_init', array($this,'add_table_in_db'));
18
  $this->customApiObj = new CustomApi();
19
  $this->time_space = $this->TVC_Admin_Helper->get_auto_sync_time_space();
 
20
  $this->batch_size = $this->TVC_Admin_Helper->get_auto_sync_batch_size();
21
  //add_action('admin_init',array($this,'add_woo_req'));
22
 
23
  add_action('admin_init',array($this,'add_schedule_event'));
24
  add_action( 'ee_auto_product_sync_check', array($this, 'call_auto_sync_product' ), 10, 1 );
 
25
 
26
  //add_action('admin_init',array($this,'call_auto_sync_product_ttt'));
27
  }
@@ -162,27 +164,52 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
162
  * update batch wise product sync data in DB table "ee_product_sync_data"
163
  */
164
  public function update_last_sync_in_db_batch_wise($products){
165
- $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
166
- if( $ee_prod_mapped_attrs != "" ){
167
- global $wpdb;
168
- $product_ids = implode(',', array_column($products, 'w_product_id'));
169
- $where ='`w_product_id` in ('.$product_ids.')';
170
- $pids = $this->TVC_Admin_DB_Helper->tvc_get_results_in_array('ee_product_sync_data', $where, array('w_product_id'), true);
171
- foreach($products as $key => $product) {
172
- $t_data = array(
173
- 'w_product_id'=>esc_sql($product->w_product_id),
174
- 'w_cat_id'=>esc_sql($product->w_cat_id),
175
- 'g_cat_id'=>esc_sql($product->g_cat_id),
176
- 'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
177
- 'update_date'=>esc_sql(date('Y-m-d'))
178
- );
179
- if(!in_array($product->w_product_id, $pids)){
180
- $this->TVC_Admin_DB_Helper->tvc_add_row('ee_product_sync_data', $t_data, array("%d", "%d", "%d", "%s", "%s") );
181
- }else{
182
- $this->TVC_Admin_DB_Helper->tvc_update_row('ee_product_sync_data', $t_data, array('w_product_id'=> esc_sql($product->w_product_id), 'w_cat_id'=> esc_sql($product->w_cat_id) ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
- }
185
- wp_reset_postdata();
 
 
186
  }
187
  }
188
 
@@ -514,7 +541,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
514
  if($row_count >0){
515
  if ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'ee_auto_product_sync_check' ) ) {
516
  //strtotime( 'midnight tonight' )
517
- as_schedule_recurring_action( strtotime( "+2 minutes" ), esc_attr($this->time_space), 'ee_auto_product_sync_check',array("last_sync_product_id"=>0),"product_sync");
518
  }
519
  }
520
  }
@@ -599,6 +626,12 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
599
  return $schedules;
600
  }
601
  */
 
 
 
 
 
 
602
  }// end Class
603
  }
604
  new TVC_Admin_Auto_Product_sync_Helper();
17
  add_action('admin_init', array($this,'add_table_in_db'));
18
  $this->customApiObj = new CustomApi();
19
  $this->time_space = $this->TVC_Admin_Helper->get_auto_sync_time_space();
20
+ $this->timestamp = $this->TVC_Admin_Helper->get_first_auto_sync_timestamp();
21
  $this->batch_size = $this->TVC_Admin_Helper->get_auto_sync_batch_size();
22
  //add_action('admin_init',array($this,'add_woo_req'));
23
 
24
  add_action('admin_init',array($this,'add_schedule_event'));
25
  add_action( 'ee_auto_product_sync_check', array($this, 'call_auto_sync_product' ), 10, 1 );
26
+ add_filter( 'cron_schedules', array($this,'tvc_add_cron_interval_for_product_sync') );
27
 
28
  //add_action('admin_init',array($this,'call_auto_sync_product_ttt'));
29
  }
164
  * update batch wise product sync data in DB table "ee_product_sync_data"
165
  */
166
  public function update_last_sync_in_db_batch_wise($products){
167
+ try {
168
+ $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
169
+ if( $ee_prod_mapped_attrs != "" ){
170
+ global $wpdb;
171
+ $product_ids = implode(',', array_column($products, 'w_product_id'));
172
+ $where ='`w_product_id` in ('.$product_ids.')';
173
+ $pids = $this->TVC_Admin_DB_Helper->tvc_get_results_in_array('ee_product_sync_data', $where, array('w_product_id'), true);
174
+ foreach($products as $key => $product) {
175
+ $t_data = array(
176
+ 'w_product_id'=>esc_sql($product->w_product_id),
177
+ 'w_cat_id'=>esc_sql($product->w_cat_id),
178
+ 'g_cat_id'=>esc_sql($product->g_cat_id),
179
+ 'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
180
+ 'update_date'=>esc_sql(date('Y-m-d'))
181
+ );
182
+ if(!in_array($product->w_product_id, $pids)){
183
+ $this->TVC_Admin_DB_Helper->tvc_add_row('ee_product_sync_data', $t_data, array("%d", "%d", "%d", "%s", "%s") );
184
+ }else{
185
+ $this->TVC_Admin_DB_Helper->tvc_update_row('ee_product_sync_data', $t_data, array('w_product_id'=> esc_sql($product->w_product_id), 'w_cat_id'=> esc_sql($product->w_cat_id) ));
186
+ }
187
+ }
188
+ wp_reset_postdata();
189
+ }
190
+ } catch (Exception $e) {
191
+ $this->TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
192
+ }
193
+ }
194
+
195
+ /*
196
+ * Update batch wise product sync data in DB table "ee_prouct_pre_sync_data"
197
+ */
198
+ public function update_product_status_pre_sync_data($products){
199
+ try {
200
+ $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
201
+ if( $ee_prod_mapped_attrs != "" ){
202
+ foreach($products as $product) {
203
+ $t_data = array(
204
+ 'update_date'=>esc_sql(date( 'Y-m-d H:i:s', current_time( 'timestamp') )),
205
+ 'status'=>esc_sql(1)
206
+ );
207
+ $this->TVC_Admin_DB_Helper->tvc_update_row('ee_prouct_pre_sync_data', $t_data, array('w_product_id'=> esc_sql($product->w_product_id), 'w_cat_id'=> esc_sql($product->w_cat_id) ));
208
  }
209
+ wp_reset_postdata();
210
+ }
211
+ } catch (Exception $e) {
212
+ $this->TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
213
  }
214
  }
215
 
541
  if($row_count >0){
542
  if ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'ee_auto_product_sync_check' ) ) {
543
  //strtotime( 'midnight tonight' )
544
+ as_schedule_recurring_action( esc_attr($this->timestamp), esc_attr($this->time_space), 'ee_auto_product_sync_check',array("last_sync_product_id"=>0),"product_sync");
545
  }
546
  }
547
  }
626
  return $schedules;
627
  }
628
  */
629
+ public function tvc_add_cron_interval_for_product_sync( $schedules ) {
630
+ $schedules['product_sync_interval'] = array(
631
+ 'interval' => 180,
632
+ 'display' => esc_html__( 'Every Five Seconds' ) );
633
+ return $schedules;
634
+ }
635
  }// end Class
636
  }
637
  new TVC_Admin_Auto_Product_sync_Helper();
admin/class-tvc-admin-helper.php CHANGED
@@ -25,8 +25,8 @@ Class TVC_Admin_Helper{
25
  $this->TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
26
  add_action('init',array($this, 'init'));
27
  add_action( 'init', array( $this, 'tvc_upgrade_function' ), 9999 );
28
- }
29
-
30
  public function includes() {
31
  if (!class_exists('CustomApi.php')) {
32
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
@@ -124,29 +124,33 @@ Class TVC_Admin_Helper{
124
  * verstion auto updated
125
  */
126
  public function need_auto_update_db(){
127
- $old_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.5.1"));
128
- $new_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.5.5"));
129
- $ee_auto_update_id = get_option('ee_auto_update_id');
130
- if($ee_auto_update_id!=""){
131
- if( $ee_auto_update_id != $new_ee_auto_update_id){
132
- global $wpdb;
133
- $tablename = $wpdb->prefix ."ee_products_sync_list";
134
- $wpdb->query("DROP TABLE IF EXISTS ".$tablename);
135
- $tablename = $wpdb->prefix ."ee_product_sync_data";
136
- $this->TVC_Admin_DB_Helper->tvc_safe_truncate_table($tablename);
137
- $tablename = $wpdb->prefix ."ee_product_sync_call";
138
- $this->TVC_Admin_DB_Helper->tvc_safe_truncate_table($tablename);
139
- new TVC_Admin_Auto_Product_sync_Helper();
140
- update_option("ee_auto_update_id", $new_ee_auto_update_id );
141
- }
142
- if($ee_auto_update_id == "tvc_4.5.1"){
143
- //tvc_4.5.1
144
- $this->update_subscription_details_api_to_db();
145
- }
146
- }else{
147
- update_option("ee_auto_update_id", $old_ee_auto_update_id );
148
- }
149
- }
 
 
 
 
150
  /*
151
  * Check auto update time
152
  */
@@ -206,7 +210,7 @@ Class TVC_Admin_Helper{
206
  $syncProductStat = array("total" =>0, "approved" => 0, "disapproved" => 0, "pending" => 0 );
207
  if( $merchantId != ""){
208
  $api_rs = $this->import_gmc_products_sync_in_db($next_page_token);
209
- if( $api_rs["next_page_token"] == "" ){
210
  $product_status = $this->TVC_Admin_DB_Helper->tvc_get_counts_groupby('ee_products_sync_list','google_status');
211
  foreach ($product_status as $key => $value) {
212
  if(isset($value['google_status']) ){
@@ -240,7 +244,7 @@ Class TVC_Admin_Helper{
240
 
241
  $campaigns_list = "";
242
  if(isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ""){
243
- $this->update_remarketing_snippets();
244
  $shopping_api = new ShoppingApi();
245
  $campaigns_list_res = $shopping_api->getCampaigns();
246
  if(isset($campaigns_list_res->data) && isset($campaigns_list_res->status) && $campaigns_list_res->status == 200) {
@@ -418,13 +422,9 @@ Class TVC_Admin_Helper{
418
  /*
419
  * get additional data from DB
420
  */
421
- public function get_ee_additional_data(){
422
- if(!empty($this->ee_additional_data)){
423
- return $this->ee_additional_data;
424
- }else{
425
- $this->ee_additional_data = unserialize(get_option('ee_additional_data'));
426
- return $this->ee_additional_data;
427
- }
428
  }
429
 
430
  public function save_ee_options_settings($settings){
@@ -780,17 +780,17 @@ Class TVC_Admin_Helper{
780
  $notice_text ="";
781
  $call_js_function_args="";
782
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
783
- $title = esc_html__("Site verification and Domain claim for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
784
  $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
785
- $call_js_function_args = "both";
786
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
787
- $title = esc_html__("Site verification for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
788
  $message = esc_html__("Without a verified website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
789
- $call_js_function_args = "site_verified";
790
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
791
- $title = esc_html__("Site claimed website for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
792
  $message = esc_html__("Without a claimed website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
793
- $call_js_function_args = "domain_claim";
794
  }
795
  if($message!= "" && $title != ""){
796
  ?>
@@ -801,7 +801,7 @@ Class TVC_Admin_Helper{
801
  </div>
802
  <div class="erralertrigt">
803
  <h6><?php echo esc_attr($title); ?></h6>
804
- <p><?php echo esc_attr($message); ?> <a href="javascript:void(0)" id="call_both_verification" onclick="call_tvc_site_verified_and_domain_claim('<?php echo esc_attr($call_js_function_args); ?>');"><?php esc_html_e("Click here","enhanced-e-commerce-for-woocommerce-store"); ?></a> <?php esc_html_e("to verify and claim the domain.","enhanced-e-commerce-for-woocommerce-store"); ?></p>
805
  </div>
806
  </div>
807
  </div>
@@ -980,6 +980,18 @@ Class TVC_Admin_Helper{
980
  }
981
  }
982
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  public function get_auto_sync_batch_size(){
984
  $plan_id = $this->get_plan_id();
985
  $ee_additional_data = $this->get_ee_additional_data();
@@ -1029,84 +1041,7 @@ Class TVC_Admin_Helper{
1029
  public function get_ee_msg_nofification_list(){
1030
  return unserialize(get_option('ee_msg_nofifications'));
1031
  }
1032
- /*public function add_ee_msg_nofification($key, $html, $title = null, $link = null, $link_title = null, $overwrite= false, $link_type = "internal"){
1033
- $ee_msg_list = $this->get_ee_msg_nofification_list();
1034
- if((!isset($ee_msg_list[$key]) && $html !="") ||($overwrite == true && isset($ee_msg_list[$key]) && $html !="")){
1035
- $msg = array();
1036
- $date_formate=get_option('date_format')." ".get_option('time_format');
1037
- if($date_formate ==""){
1038
- $date_formate = 'M-d-Y';
1039
- }
1040
- $msg["title"] = isset($title)?$title:"";
1041
- $msg["date"] = date( $date_formate, current_time( 'timestamp' ) );
1042
- $msg["html"] = base64_encode((isset($html))?$html:"");
1043
- if($link != ""){
1044
- $msg["link"] = $link;
1045
- $msg["link_title"] = (isset($link_title) && $link_title)?$link_title:"Learn more";
1046
- $msg["link_type"] = $link_type;
1047
- }
1048
- $msg["active"] = 1;
1049
- $ee_msg_list[$key] = $msg;
1050
- $this->set_ee_msg_nofification_list($ee_msg_list);
1051
- }
1052
- }
1053
-
1054
- public function add_tvc_fixed_nofification(){
1055
- $nofifications = [];
1056
-
1057
- $nofifications["tvc_f_notif_1"] = array(
1058
- "tittle"=>esc_html__("Congratulations..!! You are one step closer.","enhanced-e-commerce-for-woocommerce-store"),
1059
- "html"=>esc_html__("Thanks for installing the new avatar of Enhanced Ecommerce for WooCommerce plugin. Explore the full potential of Google Analytics, Google Ads and Google shopping by setting up all your Google accounts and take data driven decisions to scale your eCommerce business faster.", "enhanced-e-commerce-for-woocommerce-store")
1060
- );
1061
- $nofifications["tvc_f_notif_2"] = array(
1062
- "tittle"=>esc_html__("Share your feedback.","enhanced-e-commerce-for-woocommerce-store"),
1063
- "html"=>esc_html__("Your feedback is very important to us. Please write about your experience and the new feature requests here.","enhanced-e-commerce-for-woocommerce-store"),
1064
- "link"=>"https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/",
1065
- "link_title"=>esc_html__("Share Feedback", "enhanced-e-commerce-for-woocommerce-store"),
1066
- "link_type"=>"external"
1067
- );
1068
-
1069
- $google_detail = $this->get_ee_options_data();
1070
- if(isset($google_detail['setting'])){
1071
- $googleDetail = $google_detail['setting'];
1072
-
1073
- if(isset($googleDetail->subscription_expiry_date) && !in_array($googleDetail->plan_id, array("1"))){
1074
- $current = strtotime("now");
1075
- //echo "<br>curent date: ".date( 'M-d-Y H:i',$current);
1076
- $subscription_expiry_time = strtotime($googleDetail->subscription_expiry_date);
1077
- //echo "<br>subscription expiry date: ".date( 'M-d-Y H:i',$subscription_expiry_time);
1078
- $diffrent_day = floor(( $subscription_expiry_time - $current)/(60*60*24) +1);
1079
- if($diffrent_day < 6 && $diffrent_day > 0){
1080
- $befor_day = $diffrent_day." ".($diffrent_day == 1 ? 'day':'days');
1081
- $nofifications["tvc_pay_not_".date("YYYY_m_d",$current)] = array(
1082
- "tittle"=>"Gentle reminder",
1083
- "html"=>"Your plan is expiring in ".$befor_day.". Payment will be auto debited from your configured paypal account on “next billing date”."
1084
- );
1085
- }
1086
- $diffrent_day = floor(( $current - $subscription_expiry_time)/(60*60*24)-1);
1087
-
1088
- if($diffrent_day == 6 ){
1089
- $nofifications["tvc_expired_plan_not_".date("YYYY_m_d",$current)] = array(
1090
- "tittle"=>"Plan Expired..!!",
1091
- "html"=>esc_html__("Your plan is expired now. Contact “analytics2@tatvic.com” or call us at “(415) 968-6313” to renew your plan.", "enhanced-e-commerce-for-woocommerce-store")
1092
- );
1093
- }
1094
- }
1095
-
1096
- }
1097
-
1098
- if(!empty($nofifications)){
1099
- foreach ($nofifications as $key => $value){
1100
- if(isset($value["html"]) && $value["html"] != ""){
1101
- $n_link = isset($value["link"])?$value["link"]:"";
1102
- $n_link_title = isset($value["link_title"])?$value["link_title"]:"";
1103
- $link_type = isset($value["link_type"])?$value["link_type"]:"";
1104
- $this->add_ee_msg_nofification( $key, $value["html"], $value["tittle"], $n_link, $n_link_title, "", $link_type);
1105
- }
1106
- }
1107
- }
1108
- } */
1109
-
1110
  public function active_licence($licence_key, $subscription_id){
1111
  if($licence_key != ""){
1112
  $customObj = new CustomApi();
@@ -1175,6 +1110,134 @@ Class TVC_Admin_Helper{
1175
  }
1176
  }
1177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1178
  /*
1179
  * conver curency code to currency symbols
1180
  */
@@ -1201,5 +1264,98 @@ Class TVC_Admin_Helper{
1201
  }else{
1202
  return $code;
1203
  }
1204
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1205
  }
25
  $this->TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
26
  add_action('init',array($this, 'init'));
27
  add_action( 'init', array( $this, 'tvc_upgrade_function' ), 9999 );
28
+ }
29
+
30
  public function includes() {
31
  if (!class_exists('CustomApi.php')) {
32
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
124
  * verstion auto updated
125
  */
126
  public function need_auto_update_db(){
127
+ $old_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.5.5"));
128
+ $new_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.5.6"));
129
+ $ee_auto_update_id = get_option('ee_auto_update_id');
130
+ if($ee_auto_update_id!=""){
131
+ if( $ee_auto_update_id != $new_ee_auto_update_id){
132
+ global $wpdb;
133
+ try {
134
+ $table = $wpdb->prefix ."ee_prouct_pre_sync_data";
135
+ $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) );
136
+ if ( $wpdb->get_var( $query ) === $table ) {
137
+ $table = esc_sql($table);
138
+ $wpdb->query("ALTER TABLE $table ADD `create_date` DATETIME NULL DEFAULT CURRENT_TIMESTAMP AFTER `product_sync_profile_id`");
139
+ $wpdb->query("ALTER TABLE $table CHANGE `update_date` `update_date` DATETIME NULL");
140
+ }
141
+ } catch (Exception $e) {
142
+
143
+ }
144
+ update_option("ee_auto_update_id", $new_ee_auto_update_id );
145
+ }
146
+ if($ee_auto_update_id == "tvc_4.5.1"){
147
+ //tvc_4.5.1
148
+ $this->update_subscription_details_api_to_db();
149
+ }
150
+ }else{
151
+ update_option("ee_auto_update_id", $old_ee_auto_update_id );
152
+ }
153
+ }
154
  /*
155
  * Check auto update time
156
  */
210
  $syncProductStat = array("total" =>0, "approved" => 0, "disapproved" => 0, "pending" => 0 );
211
  if( $merchantId != ""){
212
  $api_rs = $this->import_gmc_products_sync_in_db($next_page_token);
213
+ if(isset($api_rs["next_page_token"]) && $api_rs["next_page_token"] == "" ){
214
  $product_status = $this->TVC_Admin_DB_Helper->tvc_get_counts_groupby('ee_products_sync_list','google_status');
215
  foreach ($product_status as $key => $value) {
216
  if(isset($value['google_status']) ){
244
 
245
  $campaigns_list = "";
246
  if(isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ""){
247
+ //$this->update_remarketing_snippets();
248
  $shopping_api = new ShoppingApi();
249
  $campaigns_list_res = $shopping_api->getCampaigns();
250
  if(isset($campaigns_list_res->data) && isset($campaigns_list_res->status) && $campaigns_list_res->status == 200) {
422
  /*
423
  * get additional data from DB
424
  */
425
+ public function get_ee_additional_data(){
426
+ $this->ee_additional_data = unserialize(get_option('ee_additional_data'));
427
+ return $this->ee_additional_data;
 
 
 
 
428
  }
429
 
430
  public function save_ee_options_settings($settings){
780
  $notice_text ="";
781
  $call_js_function_args="";
782
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
783
+ /*$title = esc_html__("Site verification and Domain claim for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
784
  $message = esc_html__("Without a verified and claimed website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
785
+ $call_js_function_args = "both";*/
786
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
787
+ /*$title = esc_html__("Site verification for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
788
  $message = esc_html__("Without a verified website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
789
+ $call_js_function_args = "site_verified";*/
790
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
791
+ /*$title = esc_html__("Site claimed website for merchant center account failed.","enhanced-e-commerce-for-woocommerce-store");
792
  $message = esc_html__("Without a claimed website, your product will get disapproved.","enhanced-e-commerce-for-woocommerce-store");
793
+ $call_js_function_args = "domain_claim";*/
794
  }
795
  if($message!= "" && $title != ""){
796
  ?>
801
  </div>
802
  <div class="erralertrigt">
803
  <h6><?php echo esc_attr($title); ?></h6>
804
+ <!--<p><?php echo esc_attr($message); ?> <a href="javascript:void(0)" id="call_both_verification" onclick="call_tvc_site_verified_and_domain_claim('<?php echo esc_attr($call_js_function_args); ?>');"><?php esc_html_e("Click here","enhanced-e-commerce-for-woocommerce-store"); ?></a> <?php esc_html_e("to verify and claim the domain.","enhanced-e-commerce-for-woocommerce-store"); ?></p>-->
805
  </div>
806
  </div>
807
  </div>
980
  }
981
  }
982
 
983
+ public function get_first_auto_sync_timestamp(){
984
+ $plan_id = $this->get_plan_id();
985
+ $ee_additional_data = $this->get_ee_additional_data();
986
+ $product_sync_duration = (isset($ee_additional_data['product_sync_duration']) && $ee_additional_data['product_sync_duration'])?$ee_additional_data['product_sync_duration']:"";
987
+ $pro_snyc_time_limit = (int)(isset($ee_additional_data['pro_snyc_time_limit']) && $ee_additional_data['pro_snyc_time_limit'] > 0)?$ee_additional_data['pro_snyc_time_limit']:"";
988
+ if( $product_sync_duration != "" && $pro_snyc_time_limit > 0 && $plan_id != 1){
989
+ return strtotime($pro_snyc_time_limit." ".$product_sync_duration);
990
+ }else{
991
+ return strtotime("25 days");
992
+ }
993
+ }
994
+
995
  public function get_auto_sync_batch_size(){
996
  $plan_id = $this->get_plan_id();
997
  $ee_additional_data = $this->get_ee_additional_data();
1041
  public function get_ee_msg_nofification_list(){
1042
  return unserialize(get_option('ee_msg_nofifications'));
1043
  }
1044
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1045
  public function active_licence($licence_key, $subscription_id){
1046
  if($licence_key != ""){
1047
  $customObj = new CustomApi();
1110
  }
1111
  }
1112
 
1113
+ public function tvc_display_admin_notices(){
1114
+ $ee_additional_data = $this->get_ee_additional_data();
1115
+ if(isset($ee_additional_data['admin_notices'])&& !empty($ee_additional_data['admin_notices'])){
1116
+ foreach($ee_additional_data['admin_notices'] as $key => $admin_notice){
1117
+ if(!empty($admin_notice['link_title']) && !empty($admin_notice['status']) && $admin_notice['status'] = "1"){ ?>
1118
+ <div class="notice notice-info notice-dismiss_trigger is-dismissible" data-id='<?php echo esc_attr($key); ?>'>
1119
+ <?php echo '<p>'. esc_html__($admin_notice['content'],"enhanced-e-commerce-for-woocommerce-store").' <a href="'.esc_url_raw($admin_notice["link"]).'" target="_blank" ><b><u>'. esc_html__($admin_notice['link_title'],"enhanced-e-commerce-for-woocommerce-store").'</u></b></a></p>
1120
+ </div>';
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ //tvc_add_data_admin_notice function for adding the admin notices
1126
+ public function tvc_add_admin_notice($slug, $link_title, $content, $status, $link = null, $value = null, $title = null){
1127
+ $ee_additional_data = $this->get_ee_additional_data();
1128
+ if(!isset($ee_additional_data['admin_notices'][$slug])){
1129
+ $ee_additional_data['admin_notices'][$slug] = array("link_title"=>$link_title,"content"=>$content,"status"=> $status,"title"=>$title, "value"=> $value,"link"=>$link );
1130
+ $this->set_ee_additional_data($ee_additional_data);
1131
+ }
1132
+ }
1133
+ //tvc_dismiss_admin_notice function for dismissing the admin notices
1134
+ public function tvc_dismiss_admin_notice($slug, $title, $content, $status, $value = null){
1135
+ $ee_additional_data = $this->get_ee_additional_data();
1136
+ if(isset($ee_additional_data['admin_notices'][$slug])){
1137
+ $ee_additional_data['admin_notices'][$slug] = array("title"=>$title,"content"=>$content,"status"=> $status, "value"=> $value);
1138
+ $this->set_ee_additional_data($ee_additional_data);
1139
+ }
1140
+ }
1141
+ public function tvc_add_data_admin_notice(){
1142
+ $tvc_add_data_admin_notice = $this->get_ee_options_settings();
1143
+ $con_subscription_id = $this->get_subscriptionId();
1144
+ //when user google signed in
1145
+ if($con_subscription_id != "" && $con_subscription_id != null ){
1146
+ $link_title = "User Manual Guide";
1147
+ $content = "You have not linked Google Analytics, Google Ads and Google Merchant Center accounts with Conversios plugin. Set up the conversios plugin now and boost your sales. Refer User Manual guide to get started,";
1148
+ $status = "0";
1149
+ $this->tvc_dismiss_admin_notice("no_google_signin", $link_title, $content, $status);
1150
+ //getting the review from user.
1151
+ if(!isset($_POST['conversios_onboarding_nonce'])){
1152
+ $ee_additional_data = $this->get_ee_additional_data();
1153
+ if(!isset($ee_additional_data['con_created_at'])){
1154
+ //if exisiting user and created date is not there
1155
+ $ee_additional_data = $this->get_ee_additional_data();
1156
+ $ee_additional_data['con_created_at'] = "";
1157
+ $ee_additional_data['con_updated_at'] = date('Y-m-d');
1158
+ $this->set_ee_additional_data($ee_additional_data);
1159
+ //add admin notice if created date is not there
1160
+ $link_title = "review here.";
1161
+ $content = "You have successfully started recording all the important ecommerce events in Google Analytics account using Conversios plugin. Let us know your experience by sharing your";
1162
+ $status = "1";
1163
+ $link = "https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#reviews";
1164
+ $this->tvc_add_admin_notice("review_for_days" , $link_title , $content, $status, $link );
1165
+ }else if(isset($ee_additional_data['con_created_at']) && $ee_additional_data['con_created_at'] != ''){
1166
+ //existing user if created date is available
1167
+ $current_date = date('Y-m-d');
1168
+ $created_date=date_create($ee_additional_data['con_created_at']);
1169
+ $today = date_create($current_date);
1170
+ $diff=date_diff($created_date,$today);
1171
+ $day_diff = $diff->format("%a");
1172
+ if($day_diff>= 15){
1173
+ $link_title = "review here.";
1174
+ $content = "You have successfully started recording all the important ecommerce events in Google Analytics account using Conversios plugin. Let us know your experience by sharing your";
1175
+ $status = "1";
1176
+ $link = "https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#reviews";
1177
+ $this->tvc_add_admin_notice("review_for_days" , $link_title , $content, $status, $link);
1178
+ }
1179
+ }
1180
+ }
1181
+ //if user has not selected merchant center account.
1182
+ if(!isset($tvc_add_data_admin_notice['google_merchant_id']) || (isset($tvc_add_data_admin_notice['google_merchant_id']) && $tvc_add_data_admin_notice['google_merchant_id'] == '')){
1183
+ $link_title = "Link Google Merchant account";
1184
+ $content = "You have not linked Google Merchant Account account with conversios plugin yet. Increase your sales by linking the Google Merchant Account, Refer the user manual to link the account";
1185
+ $status = "1";
1186
+ $this->tvc_add_admin_notice("no_merchant_account" , $link_title , $content, $status);
1187
+ }else{
1188
+ $link_title = "Link Google Merchant account";
1189
+ $content = "You have not linked Google Merchant Account account with conversios plugin yet. Increase your sales by linking the Google Merchant Account, Refer the user manual to link the account";
1190
+ $status = "0";
1191
+ $this->tvc_dismiss_admin_notice("no_merchant_account", $link_title, $content, $status);
1192
+ }
1193
+ //if user has not selected Google Ads account.
1194
+ if(!isset($tvc_add_data_admin_notice['google_ads_id']) || (isset($tvc_add_data_admin_notice['google_ads_id']) && $tvc_add_data_admin_notice['google_ads_id'] == '')){
1195
+ $link_title = "Link Google Ads account";
1196
+ $content = "You have not linked Google Ads account with conversios plugin yet. Increase your sales by linking the Google Ads account, Refer the user manual to link the account";
1197
+ $status = "1";
1198
+ $link = "admin.php?page=conversios_onboarding";
1199
+ $this->tvc_add_admin_notice("no_google_ads_account" , $link_title , $content, $status, $link);
1200
+ }else{
1201
+ $link_title = "Link Google Ads account";
1202
+ $content = "You have not linked Google Ads account with conversios plugin yet. Increase your sales by linking the Google Ads account, Refer the user manual to link the account";
1203
+ $status = "0";
1204
+ $this->tvc_dismiss_admin_notice("no_google_ads_account", $link_title, $content, $status);
1205
+ }
1206
+ //if user has not selected GA4 account.
1207
+ if(!isset($tvc_add_data_admin_notice['gm_id']) || (isset($tvc_add_data_admin_notice['gm_id']) && $tvc_add_data_admin_notice['gm_id'] == '')){
1208
+ $link_title = "Link Google Analytics 4 account";
1209
+ $content = "You have not linked Google Analytics 4 account with conversios plugin yet. Increase your sales by linking the Google Analytics 4 account, Refer the user manual to link the account";
1210
+ $status = "1";
1211
+ $link = "admin.php?page=conversios_onboarding";
1212
+ $this->tvc_add_admin_notice("no_ga4_account" , $link_title , $content, $status, $link);
1213
+ }else{
1214
+ $link_title = "Link Google Analytics 4 account";
1215
+ $content = "You have not linked Google Analytics 4 account with conversios plugin yet. Increase your sales by linking the Google Analytics 4 account, Refer the user manual to link the account";
1216
+ $status = "0";
1217
+ $this->tvc_dismiss_admin_notice("no_ga4_account", $link_title, $content, $status);
1218
+ }
1219
+ //if user has not selected Google Analytics account.
1220
+ if(!isset($tvc_add_data_admin_notice['ga_id']) || (isset($tvc_add_data_admin_notice['ga_id']) && $tvc_add_data_admin_notice['ga_id'] == '')){
1221
+ $link_title = "Link Google Analytics account";
1222
+ $content = "You have not linked Google Analytics account with conversios plugin yet. Increase your sales by linking the Google Analytics account, Refer the user manual to link the account";
1223
+ $status = "1";
1224
+ $link = "admin.php?page=conversios_onboarding";
1225
+ $this->tvc_add_admin_notice("no_ga_account" , $link_title , $content, $status, $link);
1226
+ }else{
1227
+ $link_title = "Link Google Analytics account";
1228
+ $content = "You have not linked Google Analytics account with conversios plugin yet. Increase your sales by linking the Google Analytics account, Refer the user manual to link the account";
1229
+ $status = "0";
1230
+ $this->tvc_dismiss_admin_notice("no_ga_account", $link_title, $content, $status);
1231
+ }
1232
+ }else{
1233
+ //when user will not do google sign in
1234
+ $link_title = " User Manual Guide";
1235
+ $content = "You have not linked Google Analytics, Google Ads and Google Merchant Center accounts with Conversios plugin. Set up the conversios plugin now and boost your sales. Refer User Manual guide to get started,";
1236
+ $status = "1";
1237
+ $link = "https://conversios.io/help-center/Installation-Manual.pdf";
1238
+ $this->tvc_add_admin_notice("no_google_signin", $link_title, $content, $status, $link);
1239
+ }
1240
+ }
1241
  /*
1242
  * conver curency code to currency symbols
1243
  */
1264
  }else{
1265
  return $code;
1266
  }
1267
+ }
1268
+ /*pixel validation */
1269
+ public function is_facebook_pixel_id( $string ) {
1270
+ if (empty($string)) {
1271
+ return true;
1272
+ }
1273
+ $re = '/^\d{14,16}$/m';
1274
+ return $this->con_validate_with_regex($re, $string);
1275
+ }
1276
+ public function is_bing_uet_tag_id( $string ) {
1277
+ if (empty($string)) {
1278
+ return true;
1279
+ }
1280
+ $re = '/^\d{7,9}$/m';
1281
+ return $this->con_validate_with_regex($re, $string);
1282
+ }
1283
+ public function is_twitter_pixel_id( $string ) {
1284
+ if (empty($string)) {
1285
+ return true;
1286
+ }
1287
+ $re = '/^[a-z0-9]{5,7}$/m';
1288
+ return $this->con_validate_with_regex($re, $string);
1289
+ }
1290
+ public function is_pinterest_pixel_id( $string ) {
1291
+ if (empty($string)) {
1292
+ return true;
1293
+ }
1294
+ $re = '/^\d{13}$/m';
1295
+ return $this->con_validate_with_regex($re, $string);
1296
+ }
1297
+ public function is_snapchat_pixel_id( $string ) {
1298
+ if (empty($string)) {
1299
+ return true;
1300
+ }
1301
+ $re = '/^[a-z0-9\-]*$/m';
1302
+ return $this->con_validate_with_regex($re, $string);
1303
+ }
1304
+ public function is_tiktok_pixel_id( $string ) {
1305
+ if (empty($string)) {
1306
+ return true;
1307
+ }
1308
+ $re = '/^[A-Z0-9]{20,20}$/m';
1309
+ return $this->con_validate_with_regex($re, $string);
1310
+ }
1311
+ public function con_validate_with_regex( $re, $string ) {
1312
+ // validate if string matches the regex $re
1313
+ if (preg_match($re, $string)){
1314
+ return true;
1315
+ } else {
1316
+ return false;
1317
+ }
1318
+ }
1319
+
1320
+ public function validate_pixels(){
1321
+ $errors = array();
1322
+ if(isset($_POST["fb_pixel_id"]) && $_POST["fb_pixel_id"] != "" && !$this->is_facebook_pixel_id($_POST["fb_pixel_id"])){
1323
+ unset($_POST["fb_pixel_id"]);
1324
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong facebook pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1325
+ }
1326
+ if(isset($_POST["microsoft_ads_pixel_id"]) && $_POST["microsoft_ads_pixel_id"] != "" && !$this->is_bing_uet_tag_id($_POST["microsoft_ads_pixel_id"])){
1327
+ unset($_POST["microsoft_ads_pixel_id"]);
1328
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong microsoft ads pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1329
+ }
1330
+ if(isset($_POST["twitter_ads_pixel_id"]) && $_POST["twitter_ads_pixel_id"] != "" && !$this->is_twitter_pixel_id($_POST["twitter_ads_pixel_id"])){
1331
+ unset($_POST["twitter_ads_pixel_id"]);
1332
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong twitter ads pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1333
+ }
1334
+ if(isset($_POST["pinterest_ads_pixel_id"]) && $_POST["pinterest_ads_pixel_id"] != "" && !$this->is_pinterest_pixel_id($_POST["pinterest_ads_pixel_id"])){
1335
+ unset($_POST["pinterest_ads_pixel_id"]);
1336
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong pinterest ads pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1337
+ }
1338
+ if(isset($_POST["snapchat_ads_pixel_id"]) && $_POST["snapchat_ads_pixel_id"] != "" && !$this->is_snapchat_pixel_id($_POST["snapchat_ads_pixel_id"])){
1339
+ unset($_POST["snapchat_ads_pixel_id"]);
1340
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong napchat ads pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1341
+ }
1342
+ if(isset($_POST["tiKtok_ads_pixel_id"]) && $_POST["tiKtok_ads_pixel_id"] != "" && !$this->is_tiktok_pixel_id($_POST["tiKtok_ads_pixel_id"])){
1343
+ unset($_POST["tiKtok_ads_pixel_id"]);
1344
+ $errors[] = array("error" => true, "message" => esc_html__("You entered wrong tiKtok ads pixel ID.", "enhanced-e-commerce-for-woocommerce-store"));
1345
+ }
1346
+ return $errors;
1347
+ }
1348
+ /*
1349
+ * Add Plugin logs
1350
+ */
1351
+ public function plugin_log($message, $file = 'plugin') {
1352
+ // Get WordPress uploads directory.
1353
+ if(is_array($message)) {
1354
+ $message = json_encode($message);
1355
+ }
1356
+ $log = new WC_Logger();
1357
+ $log->log( 'Conversios Product Sync Log ', $message );
1358
+ //error_log($message);
1359
+ return true;
1360
+ }
1361
  }
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -714,4 +714,17 @@ img{
714
 
715
  .list-image img {
716
  max-width: 18px;
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  }
714
 
715
  .list-image img {
716
  max-width: 18px;
717
+ }
718
+
719
+ .not-count {
720
+ position: absolute;
721
+ top: -5px;
722
+ right: -15px;
723
+ width: 20px;
724
+ height: 20px;
725
+ line-height: 20px;
726
+ text-align: center;
727
+ padding: 0;
728
+ border-radius: 50%;
729
+ background-color: #2D62ED;
730
  }
admin/css/style.css CHANGED
@@ -30,13 +30,15 @@
30
  .rate_us span{margin-right: 3px; /*vertical-align: bottom;*/}
31
  .rate_us img{max-width: 120px;}
32
  /*dasboard*/
33
- select.data_collection_method{
34
  border: 1px solid #C6C6C6;
35
  border-radius: 6px;
36
  box-sizing: border-box;
37
  cursor: pointer;
38
  -webkit-user-select: none;
39
  padding-right: 30px;
 
 
40
  }
41
  .btn-11 {
42
  overflow: hidden;
@@ -195,7 +197,7 @@ select.data_collection_method{
195
  z-index: 999;
196
  }
197
  .loader-section img {
198
- max-width: 50px;
199
  }
200
  .site-header{left: 160px !important;}
201
  button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{background-color:#CCCCCC;color:#ffffff;}
@@ -563,7 +565,7 @@ input[type="radio"], input[type="checkbox"]{margin:0;}
563
  .onbrdpp-body p strong{color:#1e1e1e;}
564
  .onbrdpp-body h5{margin-bottom:15px;}
565
  .onbrdpp-body ul,.onbrdpp-body ol{padding:0;margin:0;}
566
- .onbrdpp-body ul li, .onbrdpp-body ol li{font-size:16px;line-height:24px;margin-bottom:12px;}
567
  .onbrdpp-body ul li:last-child, .onbrdpp-body ol li:last-child{margin-bottom:0px;}
568
  .onbrdpp-body ol{padding-left:20px;}
569
  .onbrdpp-body ol li{padding-left:5px;}
@@ -652,7 +654,7 @@ input[type="radio"], input[type="checkbox"]{margin:0;}
652
  .hdrcntcbx{padding-left:15px;margin-left:15px;border-left:1px solid #C6C6C6;font-size:14px;line-height:22px;}
653
  .hdrcntcbx span{color:#0083FC;display:inline-block;}
654
  .hdrtpright{display:flex;padding:0 15px;max-width:33.333333%;flex:0 0 33.33333%;justify-content:flex-end;}
655
- .hustleplanbtn .cvrs-btn{font-size:12px;padding:6px 12px;}
656
  .hdrnotiwrp{display:flex;margin-left:22px;align-items:flex-start;}
657
  .notialrt{background-color:#FA424D;color:#ffffff;font-size:10px;line-height:12px;border-radius:30px;padding:2px 4px 2px;margin-left:-10px;}
658
 
@@ -1156,10 +1158,13 @@ button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{b
1156
  #ee_plugin_form select{
1157
  min-width: 480px;
1158
  }
 
1159
  #ee_plugin_form select.select-sm { min-width: 80px; border-radius: 6px; padding: 1px 5px; margin: 0; display: inline-block;}
1160
- table .tracking-trigger td{ padding: 0 0 0.5rem 1rem !important;}
1161
  #ee_plugin_form input[type="text"], #ee_plugin_form input[type="number"], .tracking-trigger .fromfiled{ min-width: 285px; height: 32px; margin-bottom: 5px;}
1162
  #ee_plugin_form .tracking-trigger input[type="text"].select-sm{min-width: 10px; max-width: 80px;}
 
 
1163
  /**********PMax CSS ************/
1164
  .search-box { background: url('../images/search-icon.png');
1165
  background-repeat: no-repeat;
@@ -1351,21 +1356,21 @@ img.img-upload {
1351
  .pmax-campaign .cmp_urls .fromfiled{max-width: 500px;}
1352
  .pmax-campaign .cmp_urls .form-col-8 {width: 45%;}
1353
  /*.pmax-campaign .fromfiled.smtext{max-width: 200px;}*/
1354
- .google-account-analytics .ga-title.con_faq_title{cursor: pointer; position: relative; background-color: #F1F1F1; padding: 10px 5px;}
1355
  .google-account-analytics .ga-title.con_faq_title.active{ margin-bottom: 8px;}
1356
  .con_faq_title img.faq_icon{position: absolute; right: 10px; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1357
  .con_faq_title.active img.faq_icon{transform: rotate(180deg); transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1358
- .sec_con_integration {opacity: 0; position: fixed; visibility: hidden; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1359
  .sec_con_integration.active{ opacity: 1; position: relative; visibility: visible; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1360
  .sec_con_integration .tvc-hide{transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1361
- .sec_con_integration .tvc-tooltip{position: relative; display: inline-block; width: auto; top: 0px; float: right; right: -4px;}
1362
  .sec_con_integration .tvc-tooltip .tvc-tooltiptext{line-height: 1.2; bottom: 6px; left: 125%; top: auto; min-width: 380px;}
1363
  .tvc-css-selector-sec .tvc-tooltip{top: -6px; right: 13px;}
1364
  .tracking-trigger th span{display: inline-block;}
1365
  .sec_con_integration th .tvc-tooltip{top: -7px; right: -3px;}
1366
  .tvc_ee_plugin_form .tvc-tooltip{position: relative; display: inline-block; width: auto;}
1367
  .tvc_ee_plugin_form .tvc-tooltip .tvc-tooltiptext{line-height: 1.2; bottom: 0px; left: 125%; top: auto; min-width: 380px; padding: 5px 8px;}
1368
-
1369
 
1370
  .tvc-auto-product-sync-form .ga-title{position: relative;}
1371
  .tvc_ee_plugin_form .sec_con_integration.advance-setting .tvc-tooltip{top: inherit; float: inherit; right: inherit;}
@@ -1437,3 +1442,16 @@ site-verified-pos{
1437
  border-bottom-width: 0px;
1438
  box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
1439
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  .rate_us span{margin-right: 3px; /*vertical-align: bottom;*/}
31
  .rate_us img{max-width: 120px;}
32
  /*dasboard*/
33
+ #ee_plugin_form select.data_collection_method{
34
  border: 1px solid #C6C6C6;
35
  border-radius: 6px;
36
  box-sizing: border-box;
37
  cursor: pointer;
38
  -webkit-user-select: none;
39
  padding-right: 30px;
40
+ min-width: 450px;
41
+ max-width: 450px;
42
  }
43
  .btn-11 {
44
  overflow: hidden;
197
  z-index: 999;
198
  }
199
  .loader-section img {
200
+ /*max-width: 50px;*/
201
  }
202
  .site-header{left: 160px !important;}
203
  button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{background-color:#CCCCCC;color:#ffffff;}
565
  .onbrdpp-body p strong{color:#1e1e1e;}
566
  .onbrdpp-body h5{margin-bottom:15px;}
567
  .onbrdpp-body ul,.onbrdpp-body ol{padding:0;margin:0;}
568
+ .onbrdpp-body ul li, .onbrdpp-body ol li{font-size:14px;line-height:24px;margin-bottom:12px;}
569
  .onbrdpp-body ul li:last-child, .onbrdpp-body ol li:last-child{margin-bottom:0px;}
570
  .onbrdpp-body ol{padding-left:20px;}
571
  .onbrdpp-body ol li{padding-left:5px;}
654
  .hdrcntcbx{padding-left:15px;margin-left:15px;border-left:1px solid #C6C6C6;font-size:14px;line-height:22px;}
655
  .hdrcntcbx span{color:#0083FC;display:inline-block;}
656
  .hdrtpright{display:flex;padding:0 15px;max-width:33.333333%;flex:0 0 33.33333%;justify-content:flex-end;}
657
+ .hustleplanbtn .cvrs-btn{font-size:12px;padding:6px 12px; margin-left: 20px;}
658
  .hdrnotiwrp{display:flex;margin-left:22px;align-items:flex-start;}
659
  .notialrt{background-color:#FA424D;color:#ffffff;font-size:10px;line-height:12px;border-radius:30px;padding:2px 4px 2px;margin-left:-10px;}
660
 
1158
  #ee_plugin_form select{
1159
  min-width: 480px;
1160
  }
1161
+ #ee_plugin_form select.select-lsm{min-width: 170px; border-radius: 6px; padding: 1px 5px; margin: 0; display: inline-block;}
1162
  #ee_plugin_form select.select-sm { min-width: 80px; border-radius: 6px; padding: 1px 5px; margin: 0; display: inline-block;}
1163
+ table.tracking-trigger td{ padding: 0 0 0.5rem 1rem !important;}
1164
  #ee_plugin_form input[type="text"], #ee_plugin_form input[type="number"], .tracking-trigger .fromfiled{ min-width: 285px; height: 32px; margin-bottom: 5px;}
1165
  #ee_plugin_form .tracking-trigger input[type="text"].select-sm{min-width: 10px; max-width: 80px;}
1166
+ #ee_plugin_form table th{width: 35%;}
1167
+ #ee_plugin_form h4{color: #002BFC; opacity: 0.6;}
1168
  /**********PMax CSS ************/
1169
  .search-box { background: url('../images/search-icon.png');
1170
  background-repeat: no-repeat;
1356
  .pmax-campaign .cmp_urls .fromfiled{max-width: 500px;}
1357
  .pmax-campaign .cmp_urls .form-col-8 {width: 45%;}
1358
  /*.pmax-campaign .fromfiled.smtext{max-width: 200px;}*/
1359
+ .google-account-analytics .ga-title.con_faq_title{cursor: pointer; position: relative; background-color: #F1F1F1; padding: 10px 5px; margin-bottom: 10px;}
1360
  .google-account-analytics .ga-title.con_faq_title.active{ margin-bottom: 8px;}
1361
  .con_faq_title img.faq_icon{position: absolute; right: 10px; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1362
  .con_faq_title.active img.faq_icon{transform: rotate(180deg); transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1363
+ .sec_con_integration {color: #000; margin-bottom: 10px; margin-left: 15px; opacity: 0; position: fixed; visibility: hidden; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1364
  .sec_con_integration.active{ opacity: 1; position: relative; visibility: visible; transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1365
  .sec_con_integration .tvc-hide{transition:all 0.5s ease-in-out 0s;-moz-transition:all 0.5s ease-in-out 0s;-webkit-transition:all 0.5s ease-in-out 0s;-o-transition:all 0.5s ease-in-out 0s;}
1366
+ .sec_con_integration .tvc-tooltip{position: relative; display: inline-block; width: auto; top: 0px;}
1367
  .sec_con_integration .tvc-tooltip .tvc-tooltiptext{line-height: 1.2; bottom: 6px; left: 125%; top: auto; min-width: 380px;}
1368
  .tvc-css-selector-sec .tvc-tooltip{top: -6px; right: 13px;}
1369
  .tracking-trigger th span{display: inline-block;}
1370
  .sec_con_integration th .tvc-tooltip{top: -7px; right: -3px;}
1371
  .tvc_ee_plugin_form .tvc-tooltip{position: relative; display: inline-block; width: auto;}
1372
  .tvc_ee_plugin_form .tvc-tooltip .tvc-tooltiptext{line-height: 1.2; bottom: 0px; left: 125%; top: auto; min-width: 380px; padding: 5px 8px;}
1373
+ .sec_con_integration label.align-middle{display: block;}
1374
 
1375
  .tvc-auto-product-sync-form .ga-title{position: relative;}
1376
  .tvc_ee_plugin_form .sec_con_integration.advance-setting .tvc-tooltip{top: inherit; float: inherit; right: inherit;}
1442
  border-bottom-width: 0px;
1443
  box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
1444
  }
1445
+ .con-setting-container{border-bottom: 1px solid #dcdcde; margin:10px 15px;}
1446
+ .con-setting-container-last{margin:10px 15px;}
1447
+ .use_your_gtm_id input[type="text"]{display: inline-block; margin-top: 5px;}
1448
+ .use_your_gtm_id input[type="text"].tvc-hide{display: none;}
1449
+ .con_new_features{background-color: #f71a1a;
1450
+ padding: 0 2px;
1451
+ color: #fff;
1452
+ font-size: 13px;
1453
+ font-weight: 200;
1454
+ margin-left: 2px;
1455
+ vertical-align: top;
1456
+ margin-top: -5px;
1457
+ display: inline-block;}
admin/helper/class-onboarding-helper.php CHANGED
@@ -366,12 +366,8 @@ if(!class_exists('Conversios_Onboarding_Helper')):
366
  $settings['ga4_api_secret'] = isset($old_setting['ga4_api_secret'])?$old_setting['ga4_api_secret']:"";
367
  $settings['ga_CG'] = isset($old_setting['ga_CG'])?$old_setting['ga_CG']:"";
368
  $settings['ga_optimize_id'] = isset($old_setting['ga_optimize_id'])?$old_setting['ga_optimize_id']:"";
369
-
370
- /*$settings['tvc_conversion_tracking_type'] = isset($old_setting['tvc_conversion_tracking_type'])?$old_setting['tvc_conversion_tracking_type']:"";
371
- $settings['tvc_product_detail_conversion_tracking_type'] = isset($old_setting['tvc_product_detail_conversion_tracking_type'])?$old_setting['tvc_product_detail_conversion_tracking_type']:"";
372
- $settings['tvc_checkout_conversion_tracking_type'] = isset($old_setting['tvc_checkout_conversion_tracking_type'])?$old_setting['tvc_checkout_conversion_tracking_type']:"";*/
373
 
374
- $tracking_integration = array("tvc_product_list_data_collection_method", "tvc_product_detail_data_collection_method", "tvc_checkout_data_collection_method", "tvc_thankyou_data_collection_method", "tvc_product_detail_addtocart_selector", "tvc_product_detail_addtocart_selector_type", "tvc_product_detail_addtocart_selector_val", "tvc_checkout_step_2_selector", "tvc_checkout_step_2_selector_type", "tvc_checkout_step_2_selector_val", "tvc_checkout_step_3_selector", "tvc_checkout_step_3_selector_type", "tvc_checkout_step_3_selector_val");
375
  foreach($tracking_integration as $val){
376
  $settings[$val] = isset($old_setting[$val])?sanitize_text_field($old_setting[$val]):"";
377
  }
@@ -404,7 +400,19 @@ if(!class_exists('Conversios_Onboarding_Helper')):
404
  */
405
  if(property_exists($tvc_data,"g_mail") && sanitize_email($tvc_data->g_mail)){
406
  update_option('ee_customer_gmail', $tvc_data->g_mail);
 
 
 
 
 
 
 
 
 
 
 
407
  }
 
408
  $return_url = "admin.php?page=conversios-google-shopping-feed&tab=gaa_config_page";
409
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
410
  if( sanitize_text_field($googleDetail->google_merchant_center_id) != "" && sanitize_text_field($googleDetail->google_ads_id) != ""){
@@ -743,6 +751,14 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
743
  $return->status = $result->status;
744
  $return->data = $result->data;
745
  $return->error = false;
 
 
 
 
 
 
 
 
746
  return $return;
747
  }else{
748
  $return->error = true;
@@ -796,7 +812,15 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
796
  $response_message = wp_remote_retrieve_response_message($request);
797
  $response_body = json_decode(wp_remote_retrieve_body($request));
798
  if ((isset($response_body->error) && $response_body->error == '') || (!isset($response_body->error)) ) {
799
- return $response_body;
 
 
 
 
 
 
 
 
800
  } else {
801
  $return = new \stdClass();
802
  $return->error = true;
366
  $settings['ga4_api_secret'] = isset($old_setting['ga4_api_secret'])?$old_setting['ga4_api_secret']:"";
367
  $settings['ga_CG'] = isset($old_setting['ga_CG'])?$old_setting['ga_CG']:"";
368
  $settings['ga_optimize_id'] = isset($old_setting['ga_optimize_id'])?$old_setting['ga_optimize_id']:"";
 
 
 
 
369
 
370
+ $tracking_integration = array("tracking_method", "want_to_use_your_gtm", "use_your_gtm_id", "tvc_product_list_data_collection_method", "tvc_product_detail_data_collection_method", "tvc_checkout_data_collection_method", "tvc_thankyou_data_collection_method", "tvc_product_detail_addtocart_selector", "tvc_product_detail_addtocart_selector_type", "tvc_product_detail_addtocart_selector_val", "tvc_checkout_step_2_selector", "tvc_checkout_step_2_selector_type", "tvc_checkout_step_2_selector_val", "tvc_checkout_step_3_selector", "tvc_checkout_step_3_selector_type", "tvc_checkout_step_3_selector_val", "microsoft_ads_pixel_id", "twitter_ads_pixel_id", "pinterest_ads_pixel_id", "snapchat_ads_pixel_id", "tiKtok_ads_pixel_id");
371
  foreach($tracking_integration as $val){
372
  $settings[$val] = isset($old_setting[$val])?sanitize_text_field($old_setting[$val]):"";
373
  }
400
  */
401
  if(property_exists($tvc_data,"g_mail") && sanitize_email($tvc_data->g_mail)){
402
  update_option('ee_customer_gmail', $tvc_data->g_mail);
403
+ }
404
+ //is not work for existing user && $ee_additional_data['con_created_at'] != ""
405
+ if(isset($ee_additional_data['con_created_at'])){
406
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
407
+ $ee_additional_data['con_updated_at'] = date('Y-m-d');
408
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
409
+ }else{
410
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
411
+ $ee_additional_data['con_created_at'] = date('Y-m-d');
412
+ $ee_additional_data['con_updated_at'] = date('Y-m-d');
413
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
414
  }
415
+
416
  $return_url = "admin.php?page=conversios-google-shopping-feed&tab=gaa_config_page";
417
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
418
  if( sanitize_text_field($googleDetail->google_merchant_center_id) != "" && sanitize_text_field($googleDetail->google_ads_id) != ""){
751
  $return->status = $result->status;
752
  $return->data = $result->data;
753
  $return->error = false;
754
+ //admin notice when user created new google ads account.
755
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
756
+ $link_title = "Create Performance max campaign now.";
757
+ $content = "Create your first Google Ads performance max campaign using the plugin and get $500 as free credits.";
758
+ $status = "1";
759
+ $link = "admin.php?page=conversios-pmax";
760
+ $created_google_ads_id = $result->data->adwords_id;
761
+ $TVC_Admin_Helper->tvc_add_admin_notice("created_googleads_account", $link_title, $content, $status, $link, $created_google_ads_id);
762
  return $return;
763
  }else{
764
  $return->error = true;
812
  $response_message = wp_remote_retrieve_response_message($request);
813
  $response_body = json_decode(wp_remote_retrieve_body($request));
814
  if ((isset($response_body->error) && $response_body->error == '') || (!isset($response_body->error)) ) {
815
+ //create merchant account admin notices
816
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
817
+ $link_title = "Create Performance max campaign now.";
818
+ $content = "Create your first Google Ads performance max campaign using the plugin and get $500 as free credits.";
819
+ $status = "1";
820
+ $created_merchant_id = $response_body->account->id;
821
+ $link = "admin.php?page=conversios-pmax";
822
+ $TVC_Admin_Helper->tvc_add_admin_notice("created_merchant_account", $link_title, $content, $status, $link, $created_merchant_id);
823
+ return $response_body;
824
  } else {
825
  $return = new \stdClass();
826
  $return->error = true;
admin/images/bing_icon.png ADDED
Binary file
admin/images/fb-icon.png CHANGED
Binary file
admin/images/fevicon.gif ADDED
Binary file
admin/images/pinterest_icon.png ADDED
Binary file
admin/images/snapchat_icon.png ADDED
Binary file
admin/images/tiKtok_icon.png ADDED
Binary file
admin/images/twitter_icon.png ADDED
Binary file
admin/js/tvc-ee-custom.js CHANGED
@@ -75,7 +75,7 @@ var tvc_helper = {
75
  // Shopping and Google Ads Performance
76
  post_data['action']='get_google_ads_reports_chart';
77
  var v_this = this;
78
- $.ajax({
79
  type: "POST",
80
  dataType: "json",
81
  url: tvc_ajax_url,
@@ -99,7 +99,7 @@ var tvc_helper = {
99
  //Compaign Performance
100
  post_data['action']='get_google_ads_campaign_performance';
101
  var v_this = this;
102
- $.ajax({
103
  type: "POST",
104
  dataType: "json",
105
  url: tvc_ajax_url,
@@ -130,7 +130,7 @@ var tvc_helper = {
130
  var v_this = this;
131
  if(data != undefined && Object.keys(data).length > 0){
132
  var i=0;
133
- $.each(data, function (propKey, propValue) {
134
  if(i<5){
135
  //table_row = ''; table_row_last = '';
136
  status = (propValue['active'] == 1)?'active':'deactivate';
@@ -203,7 +203,7 @@ var tvc_helper = {
203
  if(data.hasOwnProperty('graph_type')){
204
  labels_key = data['graph_type'];
205
  }
206
- $.each(s_1_div_id, function (propKey, propValue) {
207
  if(data.hasOwnProperty(propValue['id'])){
208
  if(propValue['chart_id']!= undefined && propValue['is_chart'] != undefined && propValue['chart_type'] != undefined){
209
 
@@ -242,7 +242,7 @@ var tvc_helper = {
242
  var t_labels = "";
243
 
244
  //var d_backgroundColors = ['#FF6384','#22CFCF','#0ea50b','#FF9F40','#FFCD56']
245
- $.each(chart_data, function (key, value) {
246
  if(labels_key != "" && value.hasOwnProperty(labels_key)){
247
  t_labels =value[labels_key];
248
  }else{
@@ -327,7 +327,7 @@ var tvc_helper = {
327
  google_analytics_reports_call_api:function(post_data){
328
  var v_this = this;
329
  var g_mail = post_data.g_mail;
330
- $.ajax({
331
  type: "POST",
332
  dataType: "json",
333
  url: tvc_ajax_url,
@@ -469,7 +469,7 @@ var tvc_helper = {
469
  }
470
  if(Object.keys(s_1_div_id).length > 0){
471
  var temp_val =""; var temp_div_id = "";
472
- $.each(s_1_div_id, function (propKey, propValue) {
473
  if(basic_data.hasOwnProperty(propValue['id'])){
474
  temp_val = basic_data[propValue['id']];
475
  temp_div_id = "#s1_"+propValue['id']+" > .dash-smry-value";
@@ -492,7 +492,7 @@ var tvc_helper = {
492
  var table_row = '';
493
  var product_revenue_per = 0;
494
  if(p_p_r != undefined && Object.keys(p_p_r).length > 0){
495
- $.each(p_p_r, function (propKey, propValue) {
496
  table_row = '';
497
  if(ga_swatch == "ga3"){
498
  product_revenue_per = ((propValue['itemRevenue']*100)/basic_data.transactionRevenue).toFixed(1);
@@ -536,7 +536,7 @@ var tvc_helper = {
536
  //console.log(m_p_r);
537
  var table_row = '';
538
 
539
- $.each(m_p_r, function (propKey, propValue) {
540
  table_row = '';
541
  if(ga_swatch == "ga3"){
542
  table_row += '<tr><td class="prdnm-cell">'+((propValue["medium"]!=undefined)?propValue["medium"]:0)+'</td>';
@@ -810,12 +810,12 @@ var tvc_helper = {
810
  remove_loader_for_analytics_reports:function(){
811
  var reg_section = this.get_analytics_reports_section();
812
  if(Object.keys(reg_section).length > 0){
813
- $.each(reg_section, function (propKey, propValue) {
814
  if(propValue.hasOwnProperty('main-class') && propValue.hasOwnProperty('loading-type')){
815
  if(propValue['loading-type'] == 'bgcolor'){
816
  //jQuery("."+propValue['main-class']).addClass("is_loading");
817
  if(Object.keys(propValue['ajax_fields']).length > 0){
818
- $.each(propValue['ajax_fields'], function (propKey, propValue) {
819
  jQuery("."+propValue['class']).removeClass("loading-bg-effect");
820
  });
821
  }
@@ -851,7 +851,7 @@ var tvc_helper = {
851
  }
852
 
853
  if(Object.keys(chart_ids).length > 0){
854
- $.each(chart_ids, function (propKey, propValue) {
855
  var canvas = document.getElementById(propKey);
856
  if( canvas != null){
857
  var is_blank = v_this.is_canvas_blank(canvas);
@@ -866,12 +866,12 @@ var tvc_helper = {
866
  add_loader_for_analytics_reports:function(){
867
  var reg_section = this.get_analytics_reports_section();
868
  if(Object.keys(reg_section).length > 0){
869
- $.each(reg_section, function (propKey, propValue) {
870
  if(propValue.hasOwnProperty('main-class') && propValue.hasOwnProperty('loading-type')){
871
  if(propValue['loading-type'] == 'bgcolor'){
872
  //jQuery("."+propValue['main-class']).addClass("is_loading");
873
  if(Object.keys(propValue['ajax_fields']).length > 0){
874
- $.each(propValue['ajax_fields'], function (propKey, propValue) {
875
  jQuery("."+propValue['class']).addClass("loading-bg-effect");
876
  });
877
  }
75
  // Shopping and Google Ads Performance
76
  post_data['action']='get_google_ads_reports_chart';
77
  var v_this = this;
78
+ jQuery.ajax({
79
  type: "POST",
80
  dataType: "json",
81
  url: tvc_ajax_url,
99
  //Compaign Performance
100
  post_data['action']='get_google_ads_campaign_performance';
101
  var v_this = this;
102
+ jQuery.ajax({
103
  type: "POST",
104
  dataType: "json",
105
  url: tvc_ajax_url,
130
  var v_this = this;
131
  if(data != undefined && Object.keys(data).length > 0){
132
  var i=0;
133
+ jQuery.each(data, function (propKey, propValue) {
134
  if(i<5){
135
  //table_row = ''; table_row_last = '';
136
  status = (propValue['active'] == 1)?'active':'deactivate';
203
  if(data.hasOwnProperty('graph_type')){
204
  labels_key = data['graph_type'];
205
  }
206
+ jQuery.each(s_1_div_id, function (propKey, propValue) {
207
  if(data.hasOwnProperty(propValue['id'])){
208
  if(propValue['chart_id']!= undefined && propValue['is_chart'] != undefined && propValue['chart_type'] != undefined){
209
 
242
  var t_labels = "";
243
 
244
  //var d_backgroundColors = ['#FF6384','#22CFCF','#0ea50b','#FF9F40','#FFCD56']
245
+ jQuery.each(chart_data, function (key, value) {
246
  if(labels_key != "" && value.hasOwnProperty(labels_key)){
247
  t_labels =value[labels_key];
248
  }else{
327
  google_analytics_reports_call_api:function(post_data){
328
  var v_this = this;
329
  var g_mail = post_data.g_mail;
330
+ jQuery.ajax({
331
  type: "POST",
332
  dataType: "json",
333
  url: tvc_ajax_url,
469
  }
470
  if(Object.keys(s_1_div_id).length > 0){
471
  var temp_val =""; var temp_div_id = "";
472
+ jQuery.each(s_1_div_id, function (propKey, propValue) {
473
  if(basic_data.hasOwnProperty(propValue['id'])){
474
  temp_val = basic_data[propValue['id']];
475
  temp_div_id = "#s1_"+propValue['id']+" > .dash-smry-value";
492
  var table_row = '';
493
  var product_revenue_per = 0;
494
  if(p_p_r != undefined && Object.keys(p_p_r).length > 0){
495
+ jQuery.each(p_p_r, function (propKey, propValue) {
496
  table_row = '';
497
  if(ga_swatch == "ga3"){
498
  product_revenue_per = ((propValue['itemRevenue']*100)/basic_data.transactionRevenue).toFixed(1);
536
  //console.log(m_p_r);
537
  var table_row = '';
538
 
539
+ jQuery.each(m_p_r, function (propKey, propValue) {
540
  table_row = '';
541
  if(ga_swatch == "ga3"){
542
  table_row += '<tr><td class="prdnm-cell">'+((propValue["medium"]!=undefined)?propValue["medium"]:0)+'</td>';
810
  remove_loader_for_analytics_reports:function(){
811
  var reg_section = this.get_analytics_reports_section();
812
  if(Object.keys(reg_section).length > 0){
813
+ jQuery.each(reg_section, function (propKey, propValue) {
814
  if(propValue.hasOwnProperty('main-class') && propValue.hasOwnProperty('loading-type')){
815
  if(propValue['loading-type'] == 'bgcolor'){
816
  //jQuery("."+propValue['main-class']).addClass("is_loading");
817
  if(Object.keys(propValue['ajax_fields']).length > 0){
818
+ jQuery.each(propValue['ajax_fields'], function (propKey, propValue) {
819
  jQuery("."+propValue['class']).removeClass("loading-bg-effect");
820
  });
821
  }
851
  }
852
 
853
  if(Object.keys(chart_ids).length > 0){
854
+ jQuery.each(chart_ids, function (propKey, propValue) {
855
  var canvas = document.getElementById(propKey);
856
  if( canvas != null){
857
  var is_blank = v_this.is_canvas_blank(canvas);
866
  add_loader_for_analytics_reports:function(){
867
  var reg_section = this.get_analytics_reports_section();
868
  if(Object.keys(reg_section).length > 0){
869
+ jQuery.each(reg_section, function (propKey, propValue) {
870
  if(propValue.hasOwnProperty('main-class') && propValue.hasOwnProperty('loading-type')){
871
  if(propValue['loading-type'] == 'bgcolor'){
872
  //jQuery("."+propValue['main-class']).addClass("is_loading");
873
  if(Object.keys(propValue['ajax_fields']).length > 0){
874
+ jQuery.each(propValue['ajax_fields'], function (propKey, propValue) {
875
  jQuery("."+propValue['class']).addClass("loading-bg-effect");
876
  });
877
  }
admin/partials/class-conversios-header.php CHANGED
@@ -104,7 +104,7 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
104
  </div>
105
  </div>
106
  <div class="hdrtpright">
107
- <div class="hustleplanbtn">
108
  <a href="<?php echo esc_url_raw($this->site_url.'conversios-account'); ?>"><button class="cvrs-btn greenbtn"><?php echo esc_attr($plan_name); ?></button></a>
109
  </div>
110
  </div>
@@ -139,7 +139,7 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
139
  'acitve_icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/active-conversios-menu.png")
140
  ),
141
  'conversios-google-analytics'=>array('title'=>esc_html__('Pixel Settings','enhanced-e-commerce-for-woocommerce-store')),
142
- 'conversios-google-shopping-feed'=>array('title'=>esc_html__('Product Sync','enhanced-e-commerce-for-woocommerce-store'), 'slug' =>'conversios-google-shopping-feed&tab=sync_product_page'),
143
  'conversios-pmax'=>array('title'=>esc_html__('Performance Max','enhanced-e-commerce-for-woocommerce-store'),
144
  'icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/conversios-google-ads-menu.png"),
145
  'acitve_icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/active-conversios-google-ads-menu.png")
@@ -194,9 +194,9 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
194
  <span class="navinfonavtext"><?php echo esc_attr($value['title']); ?></span>
195
  </a>
196
  <div class="con-dropdown-content">
197
- <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=sync_product_page"); ?>">Product Sync</a>
198
- <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=gaa_config_page"); ?>">Shopping Configuration</a>
199
- <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=shopping_campaigns_page"); ?>">Smart Shopping Campaigns</a>
200
  </div>
201
  </div>
202
  </li>
104
  </div>
105
  </div>
106
  <div class="hdrtpright">
107
+ <div class="hustleplanbtn">
108
  <a href="<?php echo esc_url_raw($this->site_url.'conversios-account'); ?>"><button class="cvrs-btn greenbtn"><?php echo esc_attr($plan_name); ?></button></a>
109
  </div>
110
  </div>
139
  'acitve_icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/active-conversios-menu.png")
140
  ),
141
  'conversios-google-analytics'=>array('title'=>esc_html__('Pixel Settings','enhanced-e-commerce-for-woocommerce-store')),
142
+ 'conversios-google-shopping-feed'=>array('title'=>esc_html__('Product Feed','enhanced-e-commerce-for-woocommerce-store'), 'slug' =>'conversios-google-shopping-feed&tab=sync_product_page'),
143
  'conversios-pmax'=>array('title'=>esc_html__('Performance Max','enhanced-e-commerce-for-woocommerce-store'),
144
  'icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/conversios-google-ads-menu.png"),
145
  'acitve_icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/active-conversios-google-ads-menu.png")
194
  <span class="navinfonavtext"><?php echo esc_attr($value['title']); ?></span>
195
  </a>
196
  <div class="con-dropdown-content">
197
+ <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=sync_product_page"); ?>">Product Feed</a>
198
+ <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=gaa_config_page"); ?>">Shopping Configuration</a>
199
+ <a href="<?php echo esc_url_raw("admin.php?page=conversios-google-shopping-feed&tab=shopping_campaigns_page"); ?>">Smart Shopping Campaigns</a>
200
  </div>
201
  </div>
202
  </li>
admin/partials/general-fields.php CHANGED
@@ -4,110 +4,125 @@ $TVC_Admin_Helper = new TVC_Admin_Helper();
4
  $this->customApiObj = new CustomApi();
5
  $class="";
6
  $message_p = "";
7
- if (isset($_POST['ee_submit_plugin'])) {
8
- $settings = $TVC_Admin_Helper->get_ee_options_settings();
9
- if(!empty(sanitize_text_field($_POST['ga_id']))){
10
- $settings['tracking_option'] = "UA";
11
- }
12
- if(!empty(sanitize_text_field($_POST['gm_id']))){
13
- $settings['tracking_option'] = "GA4";
14
- }
15
- if(!empty(sanitize_text_field($_POST['gm_id'])) && !empty(sanitize_text_field($_POST['ga_id']))){
16
- $settings['tracking_option'] = "BOTH";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
- update_option('ads_tracking_id', sanitize_text_field($_POST['google_ads_id']));
19
-
20
- $settings['ga_eeT'] = isset($_POST["ga_eeT"])?sanitize_text_field($_POST["ga_eeT"]):"";
21
- //content grouping start
22
- $settings['ga_CG'] = isset($_POST["ga_CG"])?sanitize_text_field($_POST["ga_CG"]):"";
23
- $settings['ga_optimize_id'] = isset($_POST["ga_optimize_id"])?sanitize_text_field($_POST["ga_optimize_id"]):"";
24
- //content grouping end
25
- $settings['ga_ST'] = isset($_POST["ga_ST"])?sanitize_text_field($_POST["ga_ST"]):"";
26
- $settings['gm_id'] = isset($_POST["gm_id"])?sanitize_text_field($_POST["gm_id"]):"";
27
- $settings['ga_id'] = isset($_POST["ga_id"])?sanitize_text_field($_POST["ga_id"]):"";
28
- $settings['google_ads_id'] = isset($_POST["google_ads_id"])?sanitize_text_field($_POST["google_ads_id"]):"";
29
- $settings['google_merchant_id'] = isset($_POST["google_merchant_id"])?sanitize_text_field($_POST["google_merchant_id"]):"";
30
- $settings['ga_gUser'] = isset($_POST["ga_gUser"])?sanitize_text_field($_POST["ga_gUser"]):"";
31
- //$_POST['ga_gCkout'] = 'on';
32
- $settings['ga_Impr'] = isset($_POST["ga_Impr"])?sanitize_text_field($_POST["ga_Impr"]):"1";
33
- $settings['ga_IPA'] = isset($_POST["ga_IPA"])?sanitize_text_field($_POST["ga_IPA"]):"";
34
- //$settings['ga_OPTOUT'] = isset($_POST["ga_OPTOUT"])?sanitize_text_field($_POST["ga_OPTOUT"]):"";
35
- $settings['ga_PrivacyPolicy'] = isset($_POST["ga_PrivacyPolicy"])?sanitize_text_field($_POST["ga_PrivacyPolicy"]):"";
36
- $settings['google-analytic'] = '';
37
- $tracking_integration = array("tvc_product_list_data_collection_method", "tvc_product_detail_data_collection_method", "tvc_checkout_data_collection_method", "tvc_thankyou_data_collection_method", "tvc_product_detail_addtocart_selector", "tvc_product_detail_addtocart_selector_type", "tvc_product_detail_addtocart_selector_val", "tvc_checkout_step_2_selector", "tvc_checkout_step_2_selector_type", "tvc_checkout_step_2_selector_val", "tvc_checkout_step_3_selector", "tvc_checkout_step_3_selector_type", "tvc_checkout_step_3_selector_val");
38
- foreach($tracking_integration as $val){
39
- $settings[$val] = isset($_POST[$val])?sanitize_text_field($_POST[$val]):"";
40
  }
41
-
42
- $settings['fb_pixel_id'] = isset($_POST["fb_pixel_id"])?sanitize_text_field($_POST["fb_pixel_id"]):"";
43
- $settings['ga4_api_secret'] = isset($_POST["ga4_api_secret"])?sanitize_text_field($_POST["ga4_api_secret"]):"";
44
-
45
- $TVC_Admin_Helper->save_ee_options_settings($settings);
46
- $TVC_Admin_Helper->update_app_status();
47
- //google ads start
48
- $response = $this->customApiObj->updateTrackingOption($_POST);
49
- $googleDetail = $this->google_detail;
50
- $googleDetail_setting = $this->google_detail['setting'];
51
- if(isset($_POST['remarketing_tags'])){
52
- update_option('ads_ert', sanitize_text_field($_POST['remarketing_tags']) );
53
- $googleDetail_setting->remarketing_tags = sanitize_text_field($_POST['remarketing_tags']);
54
  }else{
55
- update_option('ads_ert', 0);
56
- $googleDetail_setting->remarketing_tags = 0;
57
  }
58
- if(isset($_POST['dynamic_remarketing_tags'])){
59
- update_option('ads_edrt', sanitize_text_field($_POST['dynamic_remarketing_tags']) );
60
- $googleDetail_setting->dynamic_remarketing_tags = sanitize_text_field($_POST['dynamic_remarketing_tags']);
61
  }else{
62
- update_option('ads_edrt', 0);
63
- $googleDetail_setting->dynamic_remarketing_tags = 0;
64
  }
65
- if($this->plan_id != 1){
66
- if(isset($_POST['google_ads_conversion_tracking'])){
67
- update_option('google_ads_conversion_tracking', sanitize_text_field($_POST['google_ads_conversion_tracking']) );
68
- $googleDetail_setting->google_ads_conversion_tracking = sanitize_text_field($_POST['google_ads_conversion_tracking']);
69
- }else{
70
- update_option('google_ads_conversion_tracking', 0);
71
- $googleDetail_setting->google_ads_conversion_tracking = 0;
72
- }
73
- if(isset($_POST['ga_EC'])){
74
- update_option('ga_EC', sanitize_text_field($_POST['ga_EC']) );
75
- }else{
76
- update_option('ga_EC', 0);
77
- }
78
- if(isset($_POST['ee_conversio_send_to'])){
79
- update_option('ee_conversio_send_to', sanitize_text_field($_POST['ee_conversio_send_to']) );
80
- $googleDetail_setting->ee_conversio_send_to = sanitize_text_field($_POST['ee_conversio_send_to']);
81
- }
82
  }
83
- if(isset($_POST['link_google_analytics_with_google_ads'])){
84
- $googleDetail_setting->link_google_analytics_with_google_ads = sanitize_text_field($_POST['link_google_analytics_with_google_ads']);
85
- }else{
86
- $googleDetail_setting->link_google_analytics_with_google_ads = 0;
87
- }
88
- $googleDetail['setting'] = $googleDetail_setting;
89
- $TVC_Admin_Helper->set_ee_options_data($googleDetail);
90
- //google ads end
91
-
92
- $class='alert-message tvc-alert-success';
93
- $message_p = esc_html__( 'Your settings have been saved.', 'enhanced-e-commerce-for-woocommerce-store' );
 
 
 
94
  }
95
  $data = unserialize(get_option('ee_options'));
96
  $this->current_customer_id = $TVC_Admin_Helper->get_currentCustomerId();
97
  $subscription_id = $TVC_Admin_Helper->get_subscriptionId();
98
  $TVC_Admin_Helper->add_spinner_html();
99
- $google_detail = $TVC_Admin_Helper->get_ee_options_data();
100
- $googleDetail = "";
101
- $plan_id = 1;
102
- if(isset($google_detail['setting'])){
103
- $googleDetail = $google_detail['setting'];
104
- if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
105
- $plan_id = $googleDetail->plan_id;
106
- }
107
- }
108
  ?>
109
  <div class="tab-content">
110
- <?php if($message_p){
 
 
 
 
 
 
 
 
 
111
  printf('<div class="%1$s"><div class="alert">%2$s</div></div>', esc_attr($class), esc_html($message_p));
112
  }?>
113
  <div class="tab-pane show active" id="googleShoppingFeed">
@@ -126,216 +141,485 @@ if(isset($google_detail['setting'])){
126
  <button type="submit" class="btn btn-primary" name="verify-licence-key"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/right-arrow.svg'); ?>" alt="active licence key"></button>
127
  </div>
128
  </div>
129
- </form>
130
-
131
  </div>
132
  </div>
133
- <?php }?>
134
- <div class="row mb-3">
135
- <div class="col-6 col-md-6 col-lg-6">
136
- <h2 class="ga-title"><?php esc_html_e("Connected Google Analytics Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
137
- </div>
138
- <div class="col-6 col-md-6 col-lg-6 text-right">
139
- <div class="acc-num">
140
- <p class="ga-text">
141
- <?php echo (isset($data['ga_id']) && $data['ga_id'] != '') ? $data['ga_id'] : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
142
- </p>
143
- <?php
144
- if (isset($data['ga_id']) && $data['ga_id'] != '') {
145
- echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'.esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
146
- } else {
147
- echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  }?>
149
- </div>
150
- </div>
151
- </div>
152
- <div class="row mb-3">
153
- <div class="col-6 col-md-6 col-lg-6">
154
- <h2 class="ga-title"><?php esc_html_e("Connected Google Analytics 4 Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
155
- </div>
156
- <div class="col-6 col-md-6 col-lg-6 text-right">
 
 
 
 
 
 
 
 
157
  <div class="acc-num">
158
  <p class="ga-text">
159
- <?php echo (isset($data['gm_id']) && $data['gm_id'] != '') ? esc_attr($data['gm_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
160
  </p>
161
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  if (isset($data['gm_id']) && esc_attr($data['gm_id']) != '') {
163
  echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
164
  } else {
165
  echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
166
  }?>
167
  </div>
168
- </div>
169
- </div>
170
- <form id="ee_plugin_form" class="tvc_ee_plugin_form" name="google-analytic-setting-form" method="post" >
171
- <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_advset">
172
- <?php esc_html_e("Advance Setting","enhanced-e-commerce-for-woocommerce-store"); ?>
173
- <div class="tvc-tooltip">
174
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" Advance Setting.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
175
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
176
- </div>
177
- <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
178
- </div>
179
- <div class="sec_con_integration advance-setting" id="sec_con_integration_advset">
180
- <table class="table">
181
- <tbody>
182
- <tr>
183
- <th width="155px">
184
- <label class="ga-title align-middle" for="tracking_code"><?php esc_html_e("Tracking Code","enhanced-e-commerce-for-woocommerce-store"); ?></label>
185
- </th>
186
- <td>
187
- <label class="align-middle">
188
- <?php $ga_ST = !empty($data['ga_ST']) ? 'checked' : ''; ?>
189
- <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo esc_attr($ga_ST); ?> >
190
- <label class="custom-control-label" for="ga_ST"><?php esc_html_e("Add Global Site Tracking Code 'gtag.js'","enhanced-e-commerce-for-woocommerce-store"); ?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  <div class="tvc-tooltip">
192
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
193
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
194
  </div>
195
- </label><br/>
196
- <label class="align-middle">
197
- <?php $ga_eeT = !empty($data['ga_eeT']) ? 'checked' : ''; ?>
198
- <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo esc_attr($ga_eeT); ?> >
199
- <label class="custom-control-label" for="ga_eeT"><?php esc_html_e("Add Enhanced Ecommerce Tracking Code","enhanced-e-commerce-for-woocommerce-store"); ?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  <div class="tvc-tooltip">
201
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature adds Enhanced Ecommerce Tracking Code to your Store.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
202
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
203
  </div>
204
- </label><br/>
205
- <label class="align-middle">
206
- <?php $ga_gUser = !empty($data['ga_gUser']) ? 'checked' : ''; ?>
207
- <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo esc_attr($ga_gUser); ?> >
208
- <label class="custom-control-label" for="ga_gUser"><?php esc_html_e("Add Code to Track the Login Step of Guest Users (Optional)","enhanced-e-commerce-for-woocommerce-store"); ?></label>
 
 
 
 
 
209
  <div class="tvc-tooltip">
210
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you have Guest Check out enable, we recommend you to add this code.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
211
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
212
- </div>
213
- </label>
214
- </td>
215
- </tr>
216
- <?php if(isset($data['gm_id']) && $data['gm_id'] != '' && $plan_id != 1){ ?>
217
- <tr>
218
- <th>
219
- <label class="ga-title align-middle"><?php esc_html_e("GA4 - API secrets ","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></label>
220
- </th>
221
- <td>
222
- <?php $ga4_api_secret = isset($data['ga4_api_secret'])?$data['ga4_api_secret']:""; ?>
223
- <input type="text" class="fromfiled" name="ga4_api_secret" id="ga4_api_secret" value="<?php echo esc_attr($ga4_api_secret); ?>">
224
- <div class="tvc-tooltip">
225
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("How to get 'Measurement Protocol API Secret' in GA4: Click Admin > Click Data streams (Under Property) > Select the stream > Additional Settings - Measurement Protocol API secrets > Create a new API secret.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
226
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
227
- </div>
228
- <br>To track refund order
229
- </td>
230
- </tr>
231
- <?php } ?>
232
- <tr>
233
- <th>
234
- <label class="ga-title align-middle" for= "ga_CG" ><?php esc_html_e("Content Grouping","enhanced-e-commerce-for-woocommerce-store"); ?> <span class="tvc-pro"> (PRO)</span></label>
235
- </th>
236
- <td>
237
- <label class="align-middle">
238
- <?php $ga_CG = (!empty($data['ga_CG'])) ? 'checked' : '';
239
- if($plan_id==1){ $ga_CG ="";}?>
240
- <input type="checkbox" name="ga_CG" id="ga_CG" <?php if($plan_id==1){?> onclick="return false;"<?php } ?> <?php echo esc_attr($ga_CG);?> >
241
- <label class="custom-control-label" for="ga_CG"><?php esc_html_e("Add Code to enable content grouping","enhanced-e-commerce-for-woocommerce-store"); ?></label>
242
- <div class="tvc-tooltip">
243
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Content grouping helps you group your web pages (content).","enhanced-e-commerce-for-woocommerce-store"); ?></span>
244
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
245
- </div>
246
- </label>
247
- </td>
248
- </tr>
249
- <tr>
250
- <th>
251
- <label class="ga-title align-middle" for= "ga_optimize" ><?php esc_html_e("Google Optimize","enhanced-e-commerce-for-woocommerce-store"); ?> <span class="tvc-pro"> (PRO)</span></label>
252
- </th>
253
- <td>
254
- <?php
255
- if($plan_id==1){?>
256
- <input type="text" name="ga_optimize_id" id="ga_optimize_id" value = "<?php echo !empty($data['ga_optimize_id']) ? esc_attr($data['ga_optimize_id']) : '';?>" placeholder="<?php esc_html_e("Google Optimize ID","enhanced-e-commerce-for-woocommerce-store"); ?>" disabled>
257
- <?php }else{ ?>
258
- <input type="text" name="ga_optimize_id" id="ga_optimize_id" value = "<?php echo !empty($data['ga_optimize_id']) ? esc_attr($data['ga_optimize_id']) : '';?>" placeholder="<?php esc_html_e("Google Optimize ID","enhanced-e-commerce-for-woocommerce-store"); ?>">
259
- <?php } ?>
260
- <div class="tvc-tooltip">
261
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter a valid google optimize container ID.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
262
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
263
- </div>
264
-
265
- </td>
266
- </tr>
267
- <tr>
268
- <th>
269
- <label class="ga-title align-middle" for="ga_Impr"><?php esc_html_e("Impression Thresold","enhanced-e-commerce-for-woocommerce-store"); ?></label>
270
- </th>
271
- <td>
272
- <?php $ga_Impr = !empty($data['ga_Impr']) ? $data['ga_Impr'] : 6; ?>
273
- <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo esc_attr($ga_Impr); ?>">
274
- <label for="ga_Impr"></label>
275
- <div class="tvc-tooltip">
276
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
277
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
278
- </div>
279
- <p class="description"><b><?php esc_html_e("Note : To avoid processing load on server we recommend upto 6 Impression Thresold.","enhanced-e-commerce-for-woocommerce-store"); ?></b></p>
280
- </td>
281
- </tr>
282
- <tr>
283
- <th>
284
- <label class="ga-title align-middle" for="ga_IPA"><?php esc_html_e("I.P. Anoymization","enhanced-e-commerce-for-woocommerce-store"); ?></label>
285
- </th>
286
- <td>
287
- <label class="align-middle">
288
- <?php $ga_IPA = !empty($data['ga_IPA']) ? 'checked' : ''; ?>
289
- <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo esc_attr($ga_IPA); ?>>
290
- <label class="custom-control-label" for="ga_IPA"><?php esc_html_e("Enable I.P. Anonymization","enhanced-e-commerce-for-woocommerce-store"); ?></label>
291
  <div class="tvc-tooltip">
292
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
293
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
294
  </div>
295
- </label>
296
- </td>
297
- </tr>
298
- </tbody>
299
- </table>
300
- </div>
301
- <br />
302
- <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration">
303
- <?php esc_html_e("Google Analytics Event Tracking - Custom Integration","enhanced-e-commerce-for-woocommerce-store"); ?>
304
- <div class="tvc-tooltip">
305
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature is for the woocommerce store which has changed standard woocommerce hooks or implemented custom woocommerce hooks.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
306
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
307
- </div>
308
- <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" ></div>
309
- <div class="sec_con_integration" id="sec_con_integration">
310
- <table class="tracking-trigger">
311
- <tr><th colspan="2">
312
- <span>
313
- <?php esc_html_e("Product data collection method ","enhanced-e-commerce-for-woocommerce-store"); ?>
314
- <div class="tvc-tooltip">
315
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When you have custom woocommerce implementation and you have modified standard woocommerce hooks, you can configure/select your custom hooks from below to enable google analytics tracking for specific events.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
316
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
317
- </div>
318
- </span>
319
- <span style="float: right;"><a href="<?php echo esc_url_raw("https://".TVC_AUTH_CONNECT_URL."/help-center/event-tracking-custom-integration.pdf"); ?>" target="_blank">Detailed Document</a></span>
320
- </th></tr>
321
- <tr>
322
- <th style="padding: 0 1rem; width: 35%;">
323
- <label class="ga-title align-middle"><?php esc_html_e("Product list","enhanced-e-commerce-for-woocommerce-store"); ?></label>
324
  </th>
325
- <td>
326
- <?php $tvc_product_list_data_collection_method = isset($data['tvc_product_list_data_collection_method'])?$data['tvc_product_list_data_collection_method']:"woocommerce_after_shop_loop_item";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  $list = array(
328
- "woocommerce_before_shop_loop_item" => "woocommerce_before_shop_loop_item (default hook)",
329
- "woocommerce_after_shop_loop_item" => "woocommerce_after_shop_loop_item (default hook)",
330
- "woocommerce_before_shop_loop_item_title" => "woocommerce_before_shop_loop_item_title (default hook)",
331
- "woocommerce_shop_loop_item_title" => "woocommerce_shop_loop_item_title (default hook)",
332
- "woocommerce_after_shop_loop_item_title" => "woocommerce_after_shop_loop_item_title (default hook)",
333
- "conversios_shop_loop_item" => "conversios_shop_loop_item (conversios hook)"
 
334
  ); ?>
335
- <select name="tvc_product_list_data_collection_method" class="data_collection_method">
336
  <?php if(!empty($list)){
337
  foreach($list as $key => $val){
338
- $selected = ($tvc_product_list_data_collection_method == $key)?"selected":"";
339
  ?>
340
  <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
341
  <?php
@@ -343,119 +627,57 @@ if(isset($google_detail['setting'])){
343
  }?>
344
  </select>
345
  <div class="tvc-tooltip">
346
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When product impressions, clicks or add to cart google analytics ecommerce events are not working on your store, select the implemented hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
347
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
348
  </div>
349
- <small>(At home, collection, shop, product details and cart page)</small>
350
- </td>
351
- </tr>
352
- <tr>
353
- <th style="padding: 0 1rem;">
354
- <label class="ga-title align-middle"><?php esc_html_e("Product detail page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
355
- </th>
356
- <td>
357
- <?php $tvc_product_detail_data_collection_method = isset($data['tvc_product_detail_data_collection_method'])?$data['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
358
  $list = array(
359
- "woocommerce_before_single_product" => "woocommerce_before_single_product (default hook)",
360
- "woocommerce_after_single_product" => "woocommerce_after_single_product (default hook)",
361
- "woocommerce_single_product_summary" => "woocommerce_single_product_summary (default hook)",
362
- "conversios_single_product" => "conversios_single_product (conversios hook)",
363
- "on_page" => "On page load"
364
  ); ?>
365
- <select name="tvc_product_detail_data_collection_method" class="data_collection_method">
366
  <?php if(!empty($list)){
367
  foreach($list as $key => $val){
368
- $selected = ($tvc_product_detail_data_collection_method == $key)?"selected":"";
369
  ?>
370
  <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
371
  <?php
372
  }
373
  }?>
374
  </select>
375
- <div class="tvc-tooltip">
376
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your product detail page is not being tracked in google analytics (view_item), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
377
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
378
  </div>
379
- </td>
380
- </tr>
381
- <tr>
382
- <th style="padding: 0 1rem;">
383
- <label class="ga-title align-middle"><?php esc_html_e("Checkout page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
384
- </th>
385
- <td>
386
- <?php
387
- $tvc_checkout_data_collection_method = isset($data['tvc_checkout_data_collection_method'])?$data['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
388
- $list = array(
389
- "woocommerce_before_checkout_form" => "woocommerce_before_checkout_form (default hook)",
390
- "woocommerce_after_checkout_form" => "woocommerce_after_checkout_form (default hook)",
391
- "woocommerce_checkout_billing" => "woocommerce_checkout_billing (default hook)",
392
- "woocommerce_checkout_shipping" => "woocommerce_checkout_shipping (default hook)",
393
- "woocommerce_checkout_order_review" => "woocommerce_checkout_order_review (default hook)",
394
- "conversios_checkout_form" => "conversios_checkout_form (conversios hook)",
395
- "on_page" =>"On page load"
396
- ); ?>
397
- <select name="tvc_checkout_data_collection_method" class="data_collection_method">
398
- <?php if(!empty($list)){
399
- foreach($list as $key => $val){
400
- $selected = ($tvc_checkout_data_collection_method == $key)?"selected":"";
401
- ?>
402
- <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
403
- <?php
404
- }
405
- }?>
406
- </select>
407
- <div class="tvc-tooltip">
408
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your checkout is not being tracked in google analytics (checkout events), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
409
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
410
- </div>
411
- </td>
412
- </tr>
413
-
414
- <tr>
415
- <th style="padding: 0 1rem;">
416
- <label class="ga-title align-middle"><?php esc_html_e("Order confirmation page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
417
- </th>
418
- <td>
419
- <?php
420
- $tvc_thankyou_data_collection_method = isset($data['tvc_thankyou_data_collection_method'])?$data['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
421
- $list = array(
422
- "woocommerce_thankyou" => "woocommerce_thankyou (default hook)",
423
- "woocommerce_before_thankyou" => "woocommerce_before_thankyou (default hook)",
424
- "conversios_thankyou" => "conversios_thankyou (conversios hook)",
425
- "on_page" =>"On page load"
426
- ); ?>
427
- <select name="tvc_thankyou_data_collection_method" class="data_collection_method">
428
- <?php if(!empty($list)){
429
- foreach($list as $key => $val){
430
- $selected = ($tvc_thankyou_data_collection_method == $key)?"selected":"";
431
- ?>
432
- <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
433
- <?php
434
- }
435
- }?>
436
- </select>
437
- <div class="tvc-tooltip">
438
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your transactions are not being tracked in google analytics (purchase event), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
439
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
440
- </div>
441
- </td>
442
- </tr>
443
-
444
- <tr><th colspan="2">
445
- <span>
446
- <?php esc_html_e("Event selector","enhanced-e-commerce-for-woocommerce-store"); ?>
447
- <div class="tvc-tooltip">
448
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you change your front end class or id for below events, select/input the changed class or id.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
449
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
450
- </div>
451
- </span>
452
- </th></tr>
453
- <tr>
454
- <th style="padding: 0 1rem;">
455
- <label class="ga-title align-middle"><?php esc_html_e("Product page AddToCart button","enhanced-e-commerce-for-woocommerce-store"); ?></label>
456
- </th>
457
- <td>
458
- <?php $tvc_product_detail_addtocart_selector = isset($data['tvc_product_detail_addtocart_selector'])?$data['tvc_product_detail_addtocart_selector']:"default";
459
  $list = array(
460
  "default" => "default",
461
  "custom" => "custom"
@@ -499,16 +721,15 @@ if(isset($google_detail['setting'])){
499
  <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter your button selector (id or calss) value. You can add multiple classes using comma separated string.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
500
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
501
  </div>
502
- </span>
503
-
504
- </td>
505
- </tr>
506
- <tr>
507
- <th style="padding: 0 1rem;">
508
- <label class="ga-title align-middle"><?php esc_html_e("Checkout Step 2","enhanced-e-commerce-for-woocommerce-store"); ?></label>
509
- </th>
510
- <td>
511
- <?php $tvc_checkout_step_2_selector = isset($data['tvc_checkout_step_2_selector'])?$data['tvc_checkout_step_2_selector']:"default";
512
  $list = array(
513
  "default" => "default",
514
  "custom" => "custom"
@@ -551,14 +772,14 @@ if(isset($google_detail['setting'])){
551
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
552
  </div>
553
  </span>
554
- </td>
555
- </tr>
556
- <tr>
557
- <th style="padding: 0 1rem;">
558
- <label class="ga-title align-middle"><?php esc_html_e("Checkout Step 3","enhanced-e-commerce-for-woocommerce-store"); ?></label>
559
- </th>
560
- <td>
561
- <?php $tvc_checkout_step_3_selector = isset($data['tvc_checkout_step_3_selector'])?$data['tvc_checkout_step_3_selector']:"default";
562
  $list = array(
563
  "default" => "default",
564
  "custom" => "custom"
@@ -601,97 +822,69 @@ if(isset($google_detail['setting'])){
601
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
602
  </div>
603
  </span>
604
- </td>
605
- </tr>
606
- </table>
607
- </div>
608
- <br />
609
- <hr>
610
-
611
- <div class="row mb-3">
612
- <div class="col-6 col-md-6 col-lg-6">
613
- <h2 class="ga-title"><?php esc_html_e("Linked Google Ads Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
614
- </div>
615
- <div class="col-6 col-md-6 col-lg-6 text-right">
616
- <div class="acc-num">
617
- <p class="ga-text">
618
- <?php echo (isset($data['google_ads_id']) && $data['google_ads_id'] != '') ? esc_attr($data['google_ads_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
619
- </p>
620
- <?php
621
- if (isset($data['google_ads_id']) && esc_attr($data['google_ads_id']) != '') {
622
- echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
623
- } else {
624
- echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
625
- }?>
626
- </div>
627
- </div>
628
  </div>
629
-
630
- <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_GAds">
631
- <?php esc_html_e("Google Ads Setting","enhanced-e-commerce-for-woocommerce-store"); ?>
632
- <div class="tvc-tooltip">
633
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" Advance Setting.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
634
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
 
 
 
 
 
 
 
 
 
 
 
635
  </div>
636
- <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
 
 
 
 
637
  </div>
638
- <div class="sec_con_integration" id="sec_con_integration_GAds">
639
- <?php //google ads code start
640
-
641
- if (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != '') { ?>
642
- <label class="align-middle">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
  <div class="tvc-custom-control tvc-custom-checkbox">
644
- <input type="checkbox" class="tvc-custom-control-input" id="customCheck1" name="remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->remarketing_tags) == 1) ? 'checked="checked"' : ''; ?> >
645
- <label class="custom-control-label" for="customCheck1"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
646
- </div>
647
- </label>
648
- <br />
 
649
  <label class="align-middle">
650
  <div class="tvc-custom-control tvc-custom-checkbox">
651
- <input type="checkbox" class="tvc-custom-control-input" id="customCheck2" name="dynamic_remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->dynamic_remarketing_tags) == 1) ? 'checked="checked"' : ''; ?>>
652
- <label class="custom-control-label" for="customCheck2"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
653
- </div>
 
654
  </label>
655
- <br />
656
  <label class="align-middle">
657
- <div class="tvc-custom-control tvc-custom-checkbox">
658
- <input type="checkbox" class="tvc-custom-control-input" id="customCheck3" name="link_google_analytics_with_google_ads" value="1" <?php echo (esc_attr($googleDetail->link_google_analytics_with_google_ads) == 1) ? 'checked="checked"' : ''; ?> >
659
- <label class="custom-control-label" for="customCheck3"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></label>
660
- </div>
661
- </label>
662
- <?php }else{ ?>
663
- <h2 class="ga-title"><?php esc_html_e("Connect Google Ads account to enable below features.","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
664
- <br>
665
- <ul>
666
- <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
667
- <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
668
- <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></li>
669
- <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></li>
670
- </ul>
671
- <?php
672
- } ?>
673
- <?php if($this->plan_id != 1 && isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ''){ ?>
674
- <br/>
675
-
676
- <label class="align-middle">
677
- <div class="tvc-custom-control tvc-custom-checkbox">
678
- <input type="checkbox" class="tvc-custom-control-input" id="google_ads_conversion_tracking" class="google_ads_conversion_tracking" name="google_ads_conversion_tracking" value="1" <?php echo (esc_attr($googleDetail->google_ads_conversion_tracking) == 1) ? 'checked="checked"' : ''; ?>>
679
- <label for="google_ads_conversion_tracking"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?></label>
680
- </div>
681
- </label>
682
- <br />
683
- <div class="form-group google_ads_conversion_sec" id="google_ads_conversion_sec">
684
- <?php $ga_EC = get_option("ga_EC"); ?>
685
- <label class="align-middle">
686
- <div class="tvc-custom-control tvc-custom-checkbox">
687
- <input type="checkbox" class="tvc-custom-control-input" id="ga_EC" name="ga_EC" value="1"<?php if(!empty($ga_EC)){ echo (esc_attr($ga_EC) == 1) ? 'checked="checked"' : '';}?> <?php if($googleDetail->google_ads_conversion_tracking!=1){ echo 'disabled'; } ?>>
688
- <label for="ga_EC"><?php esc_html_e("Enable Google Ads Enhanced Conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?>
689
- </label>
690
- </div>
691
- </label>
692
- <br>
693
- <label class="align-middle">
694
- <?php
695
  if($this->current_customer_id != ""){
696
  $response = $this->customApiObj->get_conversion_list($this->current_customer_id);
697
  if(property_exists($response,"error") && $response->error == true){
@@ -719,57 +912,37 @@ if(isset($google_detail['setting'])){
719
  }
720
  }
721
  ?>
722
- </label>
723
- </div>
724
- <?php }else{?>
725
-
726
- <ul>
727
- <li>
728
- <label class="align-middle">
729
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
730
  </label>
731
- </li>
732
- <li>
733
-
734
- <label class="align-middle">
735
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads Enhanced conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
736
- </label>
737
- </li>
738
- </ul>
739
- <?php } ?>
740
  </div>
741
- <hr>
742
- <table class="table">
743
- <tbody>
744
- <tr>
745
- <th>
746
- <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/fb-icon.png"); ?>" > <?php esc_html_e("Facebook pixel ID","enhanced-e-commerce-for-woocommerce-store"); ?></label>
747
- </th>
748
- <td>
749
- <?php $fb_pixel_id = isset($data['fb_pixel_id'])?$data['fb_pixel_id']:""; ?>
750
- <input type="text" class="fromfiled" name="fb_pixel_id" id="fb_pixel_id" value="<?php echo esc_attr($fb_pixel_id); ?>">
751
- <div class="tvc-tooltip">
752
- <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Facebook pixel ID looks like. 518896233175751","enhanced-e-commerce-for-woocommerce-store"); ?></span>
753
- <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
754
- </div>
755
- </td>
756
- </tr>
757
- <tr>
758
- <th>
759
- <label class="ga-title align-middle" for="ga_PrivacyPolicy"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></label>
760
- </th>
761
- <td>
762
- <label class="align-middle">
763
- <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy']) ? 'checked' : ''; ?>
764
- <input type="checkbox" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo esc_attr($ga_PrivacyPolicy); ?>>
765
- <label class="custom-control-label" for="ga_PrivacyPolicy"><?php esc_html_e("Accept Privacy Policy of Plugin","enhanced-e-commerce-for-woocommerce-store"); ?></label>
766
 
767
- <p class="description"><?php esc_html_e("By using Conversios plugin, you agree to Conversios plugin's","enhanced-e-commerce-for-woocommerce-store"); ?> <a href= "<?php echo esc_url_raw("https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins"); ?>" target="_blank"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></a></p>
768
- </label>
769
- </td>
770
- </tr>
771
- </tbody>
772
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
773
  <p class="submit save-for-later" id="save-for-later">
774
  <input type="hidden" id="ga_id" name = "ga_id" value="<?= esc_attr((!empty($data['ga_id']))?$data['ga_id']:""); ?>"/>
775
  <input type="hidden" id="gm_id" name = "gm_id" value="<?= esc_attr((!empty($data['gm_id']))?$data['gm_id']:""); ?>"/>
@@ -777,7 +950,7 @@ if(isset($google_detail['setting'])){
777
  <input type="hidden" id="google_merchant_id" name = "google_merchant_id" value="<?= esc_attr((!empty($data['google_merchant_id']))?$data['google_merchant_id']:""); ?>"/>
778
  <input type="hidden" name="subscription_id" value="<?php echo esc_attr((!empty($data['subscription_id']))?$data['subscription_id']:""); ?>">
779
  <button type="submit" class="btn btn-primary" id="ee_submit_plugin" name="ee_submit_plugin"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
780
- </p>
781
  </form>
782
  </div>
783
  <div class="col-md-6 col-lg-4">
@@ -815,6 +988,29 @@ jQuery(document).ready(function () {
815
  jQuery(this).next().removeClass("tvc-hide");
816
  }
817
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
 
819
  jQuery(document).on('submit','form#ee_plugin_form',function(event){
820
  if(jQuery('select[name="tvc_product_detail_addtocart_selector"]').val() == "custom" ){
4
  $this->customApiObj = new CustomApi();
5
  $class="";
6
  $message_p = "";
7
+ $validate_pixels = array();
8
+ $google_detail = $TVC_Admin_Helper->get_ee_options_data();
9
+ $plan_id = 1;
10
+ $googleDetail = "";
11
+ if(isset($google_detail['setting'])){
12
+ $googleDetail = $google_detail['setting'];
13
+ if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
14
+ $plan_id = $googleDetail->plan_id;
15
+ }
16
+ }
17
+ if(isset($_POST['ee_submit_plugin'])){
18
+ $validate_pixels = $this->validate_pixels();
19
+ $settings = $TVC_Admin_Helper->get_ee_options_settings();
20
+ if(!empty(sanitize_text_field($_POST['ga_id']))){
21
+ $settings['tracking_option'] = "UA";
22
+ }
23
+ if(!empty(sanitize_text_field($_POST['gm_id']))){
24
+ $settings['tracking_option'] = "GA4";
25
+ }
26
+ if(!empty(sanitize_text_field($_POST['gm_id'])) && !empty(sanitize_text_field($_POST['ga_id']))){
27
+ $settings['tracking_option'] = "BOTH";
28
+ }
29
+ update_option('ads_tracking_id', sanitize_text_field($_POST['google_ads_id']));
30
+
31
+ $settings['ga_eeT'] = isset($_POST["ga_eeT"])?sanitize_text_field($_POST["ga_eeT"]):"";
32
+ //content grouping start
33
+ $settings['ga_CG'] = isset($_POST["ga_CG"])?sanitize_text_field($_POST["ga_CG"]):"";
34
+ $settings['ga_optimize_id'] = isset($_POST["ga_optimize_id"])?sanitize_text_field($_POST["ga_optimize_id"]):"";
35
+ //content grouping end
36
+ $settings['ga_ST'] = isset($_POST["ga_ST"])?sanitize_text_field($_POST["ga_ST"]):"";
37
+ $settings['gm_id'] = isset($_POST["gm_id"])?sanitize_text_field($_POST["gm_id"]):"";
38
+ $settings['ga_id'] = isset($_POST["ga_id"])?sanitize_text_field($_POST["ga_id"]):"";
39
+ $settings['google_ads_id'] = isset($_POST["google_ads_id"])?sanitize_text_field($_POST["google_ads_id"]):"";
40
+ $settings['google_merchant_id'] = isset($_POST["google_merchant_id"])?sanitize_text_field($_POST["google_merchant_id"]):"";
41
+ $settings['ga_gUser'] = isset($_POST["ga_gUser"])?sanitize_text_field($_POST["ga_gUser"]):"";
42
+ //$_POST['ga_gCkout'] = 'on';
43
+ $settings['ga_Impr'] = isset($_POST["ga_Impr"])?sanitize_text_field($_POST["ga_Impr"]):"1";
44
+ $settings['ga_IPA'] = isset($_POST["ga_IPA"])?sanitize_text_field($_POST["ga_IPA"]):"";
45
+ $settings['ga_PrivacyPolicy'] = isset($_POST["ga_PrivacyPolicy"])?sanitize_text_field($_POST["ga_PrivacyPolicy"]):"";
46
+ $settings['google-analytic'] = '';
47
+ $tracking_integration = array("tracking_method", "want_to_use_your_gtm", "use_your_gtm_id", "tvc_product_list_data_collection_method", "tvc_product_detail_data_collection_method", "tvc_checkout_data_collection_method", "tvc_thankyou_data_collection_method", "tvc_product_detail_addtocart_selector", "tvc_product_detail_addtocart_selector_type", "tvc_product_detail_addtocart_selector_val", "tvc_checkout_step_2_selector", "tvc_checkout_step_2_selector_type", "tvc_checkout_step_2_selector_val", "tvc_checkout_step_3_selector", "tvc_checkout_step_3_selector_type", "tvc_checkout_step_3_selector_val", "microsoft_ads_pixel_id", "twitter_ads_pixel_id", "pinterest_ads_pixel_id", "snapchat_ads_pixel_id", "tiKtok_ads_pixel_id");
48
+ foreach($tracking_integration as $val){
49
+ $settings[$val] = isset($_POST[$val])?sanitize_text_field($_POST[$val]):"";
50
+ }
51
+
52
+ $settings['fb_pixel_id'] = isset($_POST["fb_pixel_id"])?sanitize_text_field($_POST["fb_pixel_id"]):"";
53
+ $settings['ga4_api_secret'] = isset($_POST["ga4_api_secret"])?sanitize_text_field($_POST["ga4_api_secret"]):"";
54
+
55
+ $TVC_Admin_Helper->save_ee_options_settings($settings);
56
+ $TVC_Admin_Helper->update_app_status();
57
+ //google ads start
58
+ $response = $this->customApiObj->updateTrackingOption($_POST);
59
+ //$googleDetail = $this->google_detail;
60
+ $googleDetail_setting = $googleDetail;
61
+ if (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != '') {
62
+ if(isset($_POST['remarketing_tags'])){
63
+ update_option('ads_ert', sanitize_text_field($_POST['remarketing_tags']) );
64
+ $googleDetail_setting->remarketing_tags = sanitize_text_field($_POST['remarketing_tags']);
65
+ }else{
66
+ update_option('ads_ert', 0);
67
+ $googleDetail_setting->remarketing_tags = 0;
68
  }
69
+ if(isset($_POST['dynamic_remarketing_tags'])){
70
+ update_option('ads_edrt', sanitize_text_field($_POST['dynamic_remarketing_tags']) );
71
+ $googleDetail_setting->dynamic_remarketing_tags = sanitize_text_field($_POST['dynamic_remarketing_tags']);
72
+ }else{
73
+ update_option('ads_edrt', 0);
74
+ $googleDetail_setting->dynamic_remarketing_tags = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
76
+ if($plan_id != 1){
77
+ if(isset($_POST['google_ads_conversion_tracking'])){
78
+ update_option('google_ads_conversion_tracking', sanitize_text_field($_POST['google_ads_conversion_tracking']) );
79
+ $googleDetail_setting->google_ads_conversion_tracking = sanitize_text_field($_POST['google_ads_conversion_tracking']);
 
 
 
 
 
 
 
 
 
80
  }else{
81
+ update_option('google_ads_conversion_tracking', 0);
82
+ $googleDetail_setting->google_ads_conversion_tracking = 0;
83
  }
84
+ if(isset($_POST['ga_EC'])){
85
+ update_option('ga_EC', sanitize_text_field($_POST['ga_EC']) );
 
86
  }else{
87
+ update_option('ga_EC', 0);
 
88
  }
89
+ if(isset($_POST['ee_conversio_send_to'])){
90
+ update_option('ee_conversio_send_to', sanitize_text_field($_POST['ee_conversio_send_to']) );
91
+ $googleDetail_setting->ee_conversio_send_to = sanitize_text_field($_POST['ee_conversio_send_to']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
+ }
94
+ if(isset($_POST['link_google_analytics_with_google_ads'])){
95
+ $googleDetail_setting->link_google_analytics_with_google_ads = sanitize_text_field($_POST['link_google_analytics_with_google_ads']);
96
+ }else{
97
+ $googleDetail_setting->link_google_analytics_with_google_ads = 0;
98
+ }
99
+
100
+ $google_detail['setting'] = $googleDetail_setting;
101
+ $googleDetail = $googleDetail_setting;
102
+ $TVC_Admin_Helper->set_ee_options_data($google_detail);
103
+ }
104
+ //google ads end
105
+ $class='alert-message tvc-alert-success';
106
+ $message_p = esc_html__( 'Your settings have been saved.', 'enhanced-e-commerce-for-woocommerce-store' );
107
  }
108
  $data = unserialize(get_option('ee_options'));
109
  $this->current_customer_id = $TVC_Admin_Helper->get_currentCustomerId();
110
  $subscription_id = $TVC_Admin_Helper->get_subscriptionId();
111
  $TVC_Admin_Helper->add_spinner_html();
112
+
113
+ //$googleDetail = "";
 
 
 
 
 
 
 
114
  ?>
115
  <div class="tab-content">
116
+ <?php
117
+ if(!empty($validate_pixels)){
118
+ foreach($validate_pixels as $erkey => $erval){
119
+ //print_r($erval);
120
+ if(isset($erval["error"]) && $erval["error"] && isset($erval["message"]) && $erval["message"]){
121
+ printf('<div class="alert-message tvc-alert-error"><div class="alert">%1$s</div></div>', esc_html($erval["message"]));
122
+ }
123
+ }
124
+ }
125
+ if($message_p){
126
  printf('<div class="%1$s"><div class="alert">%2$s</div></div>', esc_attr($class), esc_html($message_p));
127
  }?>
128
  <div class="tab-pane show active" id="googleShoppingFeed">
141
  <button type="submit" class="btn btn-primary" name="verify-licence-key"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/right-arrow.svg'); ?>" alt="active licence key"></button>
142
  </div>
143
  </div>
144
+ </form>
 
145
  </div>
146
  </div>
147
+ <?php }?>
148
+ <!-- start setting form-->
149
+ <form id="ee_plugin_form" class="tvc_ee_plugin_form" name="google-analytic-setting-form" method="post">
150
+ <h4>Implementation Method</h4>
151
+ <div class="con-setting-container">
152
+ <table class="table">
153
+ <tbody>
154
+ <tr>
155
+ <th width="155px">
156
+ <label class="ga-title align-middle" for="tracking_method"><?php esc_html_e("Tracking Method","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
157
+ </th>
158
+ <td>
159
+ <label class="align-middle">
160
+ <?php $tracking_method = isset($data['tracking_method'])?$data['tracking_method']:"gtag";
161
+ $list = array(
162
+ "gtag" => "gtag.js",
163
+ "gtm" => "Google Tag Manager"
164
+ );?>
165
+ <select name="tracking_method" id="tracking_method" class="select-lsm css-selector">
166
+ <?php if(!empty($list)){
167
+ foreach($list as $key => $val){
168
+ $selected = ($tracking_method == $key)?"selected":"";
169
+ ?>
170
+ <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
171
+ <?php
172
+ }
173
+ }?>
174
+ </select>
175
+ <div class="tvc-tooltip">
176
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" We recommend using Google Tag Manager for speed and 95% accuracy.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
177
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
178
+ </div>
179
+ </label>
180
+ </td>
181
+ </tr>
182
+
183
+ <tr class="only-for-gtm <?php echo ($tracking_method != "gtm")?"tvc-hide":""; ?>">
184
+ <th>
185
+ <label class="ga-title align-middle"><?php esc_html_e("Use Your Own Google Tag Manager Account","enhanced-e-commerce-for-woocommerce-store"); ?></label>
186
+ </th>
187
+ <td>
188
+ <?php if($plan_id != 1){?>
189
+ <?php $use_your_gtm_id = isset($data['use_your_gtm_id'])?$data['use_your_gtm_id']:"";
190
+ $want_to_use_your_gtm = isset($data['want_to_use_your_gtm'])?$data['want_to_use_your_gtm']:"";
191
+ ?>
192
+
193
+ <label class="align-middle">
194
+ <div class="tvc-custom-control tvc-custom-checkbox">
195
+ <input type="checkbox" class="tvc-custom-control-input" id="want_to_use_your_gtm" name="want_to_use_your_gtm" value="1"<?php echo (esc_attr($want_to_use_your_gtm) == 1) ? 'checked="checked"' : ''; ?>>
196
+ <label class="custom-control-label" for="want_to_use_your_gtm"><?php esc_html_e("Add Your GTM ID","enhanced-e-commerce-for-woocommerce-store"); ?>
197
+ </label>
198
+ </div>
199
+ </label>
200
+ <div class="tvc-tooltip">
201
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("First, import our GTM container in your GTM account then add your GTM container ID","enhanced-e-commerce-for-woocommerce-store"); ?></span>
202
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
203
+ </div>
204
+ <div class="use_your_gtm_id" id="use_your_gtm_id">
205
+ <input type="text" class="fromfiled" name="use_your_gtm_id" value="<?php echo esc_attr($use_your_gtm_id); ?>">
206
+ <span style="float: right;"><strong><a href="<?php echo esc_url_raw("https://".TVC_AUTH_CONNECT_URL."/help-center/configure_our_plugin_with_your_gtm.pdf"); ?>" target="_blank">How to import Conversios GTM container?</a></strong></span>
207
+ </div>
208
+
209
+ <?php }else{
210
+ ?>
211
+ <a target="_blank" href="<?php echo esc_url_raw($this->get_pro_plan_site().'?utm_source=EE+Plugin+User+Interface&utm_medium=Pixel+Settings+upgrading+Pro+to+Use+Own+GTM&utm_campaign=Upsell+at+Conversios'); ?>" class="upgradebtn">Upgrade PRO to Use Your Own GTM</a>
212
+ <?php
213
  }?>
214
+ </td>
215
+ </tr>
216
+
217
+ </tbody>
218
+ </table>
219
+ </div>
220
+ <!-- start Google Analytics section -->
221
+ <h4>Google Analytics</h4>
222
+ <div class="con-setting-container">
223
+ <table class="table">
224
+ <tbody>
225
+ <tr>
226
+ <th>
227
+ <h2 class="ga-title"><?php esc_html_e("Google Analytics 3 Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
228
+ </th>
229
+ <td>
230
  <div class="acc-num">
231
  <p class="ga-text">
232
+ <?php echo (isset($data['ga_id']) && $data['ga_id'] != '') ? $data['ga_id'] : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
233
  </p>
234
  <?php
235
+ if (isset($data['ga_id']) && $data['ga_id'] != '') {
236
+ echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'.esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
237
+ } else {
238
+ echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
239
+ }?>
240
+ </div>
241
+ </td>
242
+ </tr>
243
+ <tr>
244
+ <th>
245
+ <h2 class="ga-title"><?php esc_html_e("Google Analytics 4 Account :","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
246
+ </th>
247
+ <td>
248
+ <div class="acc-num">
249
+ <p class="ga-text"><?php echo (isset($data['gm_id']) && $data['gm_id'] != '') ? esc_attr($data['gm_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?></p>
250
+ <?php
251
  if (isset($data['gm_id']) && esc_attr($data['gm_id']) != '') {
252
  echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
253
  } else {
254
  echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
255
  }?>
256
  </div>
257
+ </td>
258
+ </tr>
259
+ </tbody>
260
+ </table>
261
+ </div>
262
+ <!-- End Google Analytics section -->
263
+ <!-- start Google Ads section -->
264
+ <h4>Google Ads</h4>
265
+ <div class="con-setting-container">
266
+ <table class="table">
267
+ <tbody>
268
+ <tr>
269
+ <th>
270
+ <h2 class="ga-title"><?php esc_html_e("Google Ads Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
271
+ </th>
272
+ <td>
273
+ <div class="acc-num">
274
+ <p class="ga-text">
275
+ <?php echo (isset($data['google_ads_id']) && $data['google_ads_id'] != '') ? esc_attr($data['google_ads_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
276
+ </p>
277
+ <?php
278
+ if (isset($data['google_ads_id']) && esc_attr($data['google_ads_id']) != '') {
279
+ echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
280
+ } else {
281
+ echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
282
+ }?>
283
+ </div>
284
+ </td>
285
+ </tr>
286
+ </tbody>
287
+ </table>
288
+ </div>
289
+ <!-- End Google Ads section -->
290
+ <!-- start Google Ads section -->
291
+ <h4>Pixel Integrations</h4>
292
+ <div class="con-setting-container">
293
+ <table class="table" style="margin-bottom: 0;">
294
+ <tbody>
295
+ <!-- Start Other Pixel Settings section -->
296
+ <tr>
297
+ <th>
298
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/fb-icon.png"); ?>" > <?php esc_html_e("Facebook pixel ID","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
299
+ </th>
300
+ <td>
301
+ <?php $fb_pixel_id = isset($data['fb_pixel_id'])?$data['fb_pixel_id']:""; ?>
302
+ <input type="text" class="fromfiled" name="fb_pixel_id" id="fb_pixel_id" value="<?php echo esc_attr($fb_pixel_id); ?>">
303
  <div class="tvc-tooltip">
304
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Facebook pixel ID looks like. 518896233175751","enhanced-e-commerce-for-woocommerce-store"); ?></span>
305
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
306
  </div>
307
+ </td>
308
+ </tr>
309
+ <!-- End Other Pixel Settings section -->
310
+ </tbody>
311
+ </table>
312
+ <table class="table only-for-gtm <?php echo ($tracking_method != "gtm")?"tvc-hide":""; ?>" id="only-for-gtm">
313
+ <tbody>
314
+ <!-- Start Other Pixel Settings section -->
315
+ <tr>
316
+ <th>
317
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/bing_icon.png"); ?>" > <?php esc_html_e("Microsoft Ads pixel","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
318
+ </th>
319
+ <td>
320
+ <?php $microsoft_ads_pixel_id = isset($data['microsoft_ads_pixel_id'])?$data['microsoft_ads_pixel_id']:""; ?>
321
+ <input type="text" class="fromfiled" name="microsoft_ads_pixel_id" id="microsoft_ads_pixel_id" value="<?php echo esc_attr($microsoft_ads_pixel_id); ?>">
322
+ <div class="tvc-tooltip">
323
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Microsoft Ads pixel ID looks like. 343003931 ","enhanced-e-commerce-for-woocommerce-store"); ?></span>
324
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
325
+ </div>
326
+ </td>
327
+ </tr>
328
+ <tr>
329
+ <th>
330
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/twitter_icon.png"); ?>" > <?php esc_html_e("Twitter Ads pixel","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
331
+ </th>
332
+ <td>
333
+ <?php $twitter_ads_pixel_id = isset($data['twitter_ads_pixel_id'])?$data['twitter_ads_pixel_id']:""; ?>
334
+ <input type="text" class="fromfiled" name="twitter_ads_pixel_id" id="twitter_ads_pixel_id" value="<?php echo esc_attr($twitter_ads_pixel_id); ?>">
335
+ <div class="tvc-tooltip">
336
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Twitter Ads pixel ID looks like. ocihb","enhanced-e-commerce-for-woocommerce-store"); ?></span>
337
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
338
+ </div>
339
+ </td>
340
+ </tr>
341
+ <tr>
342
+ <th>
343
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/pinterest_icon.png"); ?>" > <?php esc_html_e("Pinterest Ads pixel","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
344
+ </th>
345
+ <td>
346
+ <?php $pinterest_ads_pixel_id = isset($data['pinterest_ads_pixel_id'])?$data['pinterest_ads_pixel_id']:""; ?>
347
+ <input type="text" class="fromfiled" name="pinterest_ads_pixel_id" id="pinterest_ads_pixel_id" value="<?php echo esc_attr($pinterest_ads_pixel_id); ?>">
348
+ <div class="tvc-tooltip">
349
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Pinterest Ads pixel ID looks like. 2612831678022","enhanced-e-commerce-for-woocommerce-store"); ?></span>
350
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
351
+ </div>
352
+ </td>
353
+ </tr>
354
+ <tr>
355
+ <th>
356
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/snapchat_icon.png"); ?>" > <?php esc_html_e("Snapchat Ads pixel","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
357
+ </th>
358
+ <td>
359
+ <?php $snapchat_ads_pixel_id = isset($data['snapchat_ads_pixel_id'])?$data['snapchat_ads_pixel_id']:""; ?>
360
+ <input type="text" class="fromfiled" name="snapchat_ads_pixel_id" id="snapchat_ads_pixel_id" value="<?php echo esc_attr($snapchat_ads_pixel_id); ?>">
361
+ <div class="tvc-tooltip">
362
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Snapchat Ads pixel ID looks like. 12e1ec0a-90aa-4267-b1a0-182c455711e9","enhanced-e-commerce-for-woocommerce-store"); ?></span>
363
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
364
+ </div>
365
+ </td>
366
+ </tr>
367
+ <tr>
368
+ <th>
369
+ <label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/tiKtok_icon.png"); ?>" > <?php esc_html_e("TiKTok Ads pixel","enhanced-e-commerce-for-woocommerce-store"); ?></label><span class="con_new_features">New</span>
370
+ </th>
371
+ <td>
372
+ <?php $tiKtok_ads_pixel_id = isset($data['tiKtok_ads_pixel_id'])?$data['tiKtok_ads_pixel_id']:""; ?>
373
+ <input type="text" class="fromfiled" name="tiKtok_ads_pixel_id" id="tiKtok_ads_pixel_id" value="<?php echo esc_attr($tiKtok_ads_pixel_id); ?>">
374
+ <div class="tvc-tooltip">
375
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The TiKTok Ads pixel ID looks like. CBET743C77U5BM7P178N","enhanced-e-commerce-for-woocommerce-store"); ?></span>
376
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
377
+ </div>
378
+ </td>
379
+ </tr>
380
+ <!-- End Other Pixel Settings section -->
381
+ </tbody>
382
+ </table>
383
+ </div>
384
+
385
+ <!-- Start Advance settings section -->
386
+ <h4>Advanced Options</h4>
387
+ <div class="con-setting-container">
388
+ <!-- start Advance Setting for GA-->
389
+ <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_advset">
390
+ <?php esc_html_e("Gogole Analytics Settings","enhanced-e-commerce-for-woocommerce-store"); ?>
391
+ <div class="tvc-tooltip">
392
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Gogole Analytics Settings.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
393
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
394
+ </div>
395
+ <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
396
+ </div>
397
+ <div class="sec_con_integration advance-setting" id="sec_con_integration_advset">
398
+ <table class="table">
399
+ <tbody>
400
+ <tr>
401
+ <th>
402
+ <label class="ga-title align-middle" for="tracking_code"><?php esc_html_e("Tracking Code","enhanced-e-commerce-for-woocommerce-store"); ?></label>
403
+ </th>
404
+ <td>
405
+ <label class="align-middle">
406
+ <?php $ga_ST = !empty($data['ga_ST']) ? 'checked' : ''; ?>
407
+ <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo esc_attr($ga_ST); ?> >
408
+ <label class="custom-control-label" for="ga_ST"><?php esc_html_e("Add Global Site Tracking Code 'gtag.js'","enhanced-e-commerce-for-woocommerce-store"); ?></label>
409
+ <div class="tvc-tooltip">
410
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
411
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
412
+ </div>
413
+ </label>
414
+ <label class="align-middle">
415
+ <?php $ga_eeT = !empty($data['ga_eeT']) ? 'checked' : ''; ?>
416
+ <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo esc_attr($ga_eeT); ?> >
417
+ <label class="custom-control-label" for="ga_eeT"><?php esc_html_e("Add Enhanced Ecommerce Tracking Code","enhanced-e-commerce-for-woocommerce-store"); ?></label>
418
+ <div class="tvc-tooltip">
419
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature adds Enhanced Ecommerce Tracking Code to your Store.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
420
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
421
+ </div>
422
+ </label>
423
+ <label class="align-middle">
424
+ <?php $ga_gUser = !empty($data['ga_gUser']) ? 'checked' : ''; ?>
425
+ <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo esc_attr($ga_gUser); ?> >
426
+ <label class="custom-control-label" for="ga_gUser"><?php esc_html_e("Add Code to Track the Login Step of Guest Users (Optional)","enhanced-e-commerce-for-woocommerce-store"); ?></label>
427
+ <div class="tvc-tooltip">
428
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you have Guest Check out enable, we recommend you to add this code.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
429
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
430
+ </div>
431
+ </label>
432
+ </td>
433
+ </tr>
434
+ <?php // For Paid user only
435
+ if(isset($data['gm_id']) && $data['gm_id'] != '' && $plan_id != 1){ ?>
436
+ <tr>
437
+ <th>
438
+ <label class="ga-title align-middle"><?php esc_html_e("GA4 - API secrets ","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></label>
439
+ </th>
440
+ <td>
441
+ <?php $ga4_api_secret = isset($data['ga4_api_secret'])?$data['ga4_api_secret']:""; ?>
442
+ <input type="text" class="fromfiled" name="ga4_api_secret" id="ga4_api_secret" value="<?php echo esc_attr($ga4_api_secret); ?>">
443
+ <div class="tvc-tooltip">
444
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("How to get 'Measurement Protocol API Secret' in GA4: Click Admin > Click Data streams (Under Property) > Select the stream > Additional Settings - Measurement Protocol API secrets > Create a new API secret.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
445
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
446
+ </div>
447
+ <br>To track refund order
448
+ </td>
449
+ </tr>
450
+ <?php } ?>
451
+ <tr>
452
+ <th>
453
+ <label class="ga-title align-middle" for= "ga_CG" ><?php esc_html_e("Content Grouping","enhanced-e-commerce-for-woocommerce-store"); ?> <span class="tvc-pro"> (PRO)</span></label>
454
+ </th>
455
+ <td>
456
+ <label class="align-middle">
457
+ <?php $ga_CG = (!empty($data['ga_CG'])) ? 'checked' : '';
458
+ if($plan_id==1){ $ga_CG ="";}?>
459
+ <input type="checkbox" name="ga_CG" id="ga_CG" <?php if($plan_id==1){?> onclick="return false;"<?php } ?> <?php echo esc_attr($ga_CG);?> >
460
+ <label class="custom-control-label" for="ga_CG"><?php esc_html_e("Add Code to enable content grouping","enhanced-e-commerce-for-woocommerce-store"); ?></label>
461
+ <div class="tvc-tooltip">
462
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Content grouping helps you group your web pages (content).","enhanced-e-commerce-for-woocommerce-store"); ?></span>
463
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
464
+ </div>
465
+ </label>
466
+ </td>
467
+ </tr>
468
+ <tr>
469
+ <th>
470
+ <label class="ga-title align-middle" for= "ga_optimize" ><?php esc_html_e("Google Optimize","enhanced-e-commerce-for-woocommerce-store"); ?> <span class="tvc-pro"> (PRO)</span></label>
471
+ </th>
472
+ <td>
473
+ <?php
474
+ if($plan_id==1){?>
475
+ <input type="text" name="ga_optimize_id" id="ga_optimize_id" value = "<?php echo !empty($data['ga_optimize_id']) ? esc_attr($data['ga_optimize_id']) : '';?>" placeholder="<?php esc_html_e("Google Optimize ID","enhanced-e-commerce-for-woocommerce-store"); ?>" disabled>
476
+ <?php }else{ ?>
477
+ <input type="text" name="ga_optimize_id" id="ga_optimize_id" value = "<?php echo !empty($data['ga_optimize_id']) ? esc_attr($data['ga_optimize_id']) : '';?>" placeholder="<?php esc_html_e("Google Optimize ID","enhanced-e-commerce-for-woocommerce-store"); ?>">
478
+ <?php } ?>
479
  <div class="tvc-tooltip">
480
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter a valid google optimize container ID.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
481
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
482
  </div>
483
+ </td>
484
+ </tr>
485
+ <tr>
486
+ <th>
487
+ <label class="ga-title align-middle" for="ga_Impr"><?php esc_html_e("Impression Thresold","enhanced-e-commerce-for-woocommerce-store"); ?></label>
488
+ </th>
489
+ <td>
490
+ <?php $ga_Impr = !empty($data['ga_Impr']) ? $data['ga_Impr'] : 6; ?>
491
+ <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo esc_attr($ga_Impr); ?>">
492
+ <label for="ga_Impr"></label>
493
  <div class="tvc-tooltip">
494
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
495
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
496
+ </div>
497
+ <p class="description"><b><?php esc_html_e("Note : To avoid processing load on server we recommend upto 6 Impression Thresold.","enhanced-e-commerce-for-woocommerce-store"); ?></b></p>
498
+ </td>
499
+ </tr>
500
+ <tr>
501
+ <th>
502
+ <label class="ga-title align-middle" for="ga_IPA"><?php esc_html_e("I.P. Anoymization","enhanced-e-commerce-for-woocommerce-store"); ?></label>
503
+ </th>
504
+ <td>
505
+ <label class="align-middle">
506
+ <?php $ga_IPA = !empty($data['ga_IPA']) ? 'checked' : ''; ?>
507
+ <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo esc_attr($ga_IPA); ?>>
508
+ <label class="custom-control-label" for="ga_IPA"><?php esc_html_e("Enable I.P. Anonymization","enhanced-e-commerce-for-woocommerce-store"); ?></label>
509
+ <div class="tvc-tooltip">
510
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
511
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
512
+ </div>
513
+ </label>
514
+ </td>
515
+ </tr>
516
+ </tbody>
517
+ </table>
518
+ </div>
519
+ <!-- End Advance Setting for GA-->
520
+ <!-- start Google Analytics Event Tracking - Custom Integration settings for GA-->
521
+ <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration">
522
+ <?php esc_html_e("Event Tracking - Custom Integration","enhanced-e-commerce-for-woocommerce-store"); ?>
523
+ <div class="tvc-tooltip">
524
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature is for the woocommerce store which has changed standard woocommerce hooks or implemented custom woocommerce hooks.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
525
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
526
+ </div>
527
+ <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
528
+ </div>
529
+ <div class="sec_con_integration" id="sec_con_integration">
530
+ <table class="table tracking-trigger">
531
+ <tr>
532
+ <th colspan="2">
533
+ <span>
534
+ <?php esc_html_e("Product data collection method ","enhanced-e-commerce-for-woocommerce-store"); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  <div class="tvc-tooltip">
536
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When you have custom woocommerce implementation and you have modified standard woocommerce hooks, you can configure/select your custom hooks from below to enable google analytics tracking for specific events.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
537
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
538
  </div>
539
+ </span>
540
+ <span style="float: right;"><a href="<?php echo esc_url_raw("https://".TVC_AUTH_CONNECT_URL."/help-center/event-tracking-custom-integration.pdf"); ?>" target="_blank">Detailed Document</a></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  </th>
542
+ </tr>
543
+ <tr>
544
+ <th style="padding: 0 1rem; width: 35%;">
545
+ <label class="ga-title align-middle"><?php esc_html_e("Product list","enhanced-e-commerce-for-woocommerce-store"); ?></label>
546
+ </th>
547
+ <td>
548
+ <?php $tvc_product_list_data_collection_method = isset($data['tvc_product_list_data_collection_method'])?$data['tvc_product_list_data_collection_method']:"woocommerce_after_shop_loop_item";
549
+ $list = array(
550
+ "woocommerce_before_shop_loop_item" => "woocommerce_before_shop_loop_item (default hook)",
551
+ "woocommerce_after_shop_loop_item" => "woocommerce_after_shop_loop_item (default hook)",
552
+ "woocommerce_before_shop_loop_item_title" => "woocommerce_before_shop_loop_item_title (default hook)",
553
+ "woocommerce_shop_loop_item_title" => "woocommerce_shop_loop_item_title (default hook)",
554
+ "woocommerce_after_shop_loop_item_title" => "woocommerce_after_shop_loop_item_title (default hook)",
555
+ "conversios_shop_loop_item" => "conversios_shop_loop_item (conversios hook)"
556
+ ); ?>
557
+ <select name="tvc_product_list_data_collection_method" class="data_collection_method">
558
+ <?php if(!empty($list)){
559
+ foreach($list as $key => $val){
560
+ $selected = ($tvc_product_list_data_collection_method == $key)?"selected":"";
561
+ ?>
562
+ <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
563
+ <?php
564
+ }
565
+ }?>
566
+ </select>
567
+ <div class="tvc-tooltip">
568
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When product impressions, clicks or add to cart google analytics ecommerce events are not working on your store, select the implemented hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
569
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
570
+ </div>
571
+ <small>(At home, collection, shop, product details and cart page)</small>
572
+ </td>
573
+ </tr>
574
+ <tr>
575
+ <th style="padding: 0 1rem;">
576
+ <label class="ga-title align-middle"><?php esc_html_e("Product detail page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
577
+ </th>
578
+ <td>
579
+ <?php $tvc_product_detail_data_collection_method = isset($data['tvc_product_detail_data_collection_method'])?$data['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
580
+ $list = array(
581
+ "woocommerce_before_single_product" => "woocommerce_before_single_product (default hook)",
582
+ "woocommerce_after_single_product" => "woocommerce_after_single_product (default hook)",
583
+ "woocommerce_single_product_summary" => "woocommerce_single_product_summary (default hook)",
584
+ "conversios_single_product" => "conversios_single_product (conversios hook)",
585
+ "on_page" => "On page load"
586
+ ); ?>
587
+ <select name="tvc_product_detail_data_collection_method" class="data_collection_method">
588
+ <?php if(!empty($list)){
589
+ foreach($list as $key => $val){
590
+ $selected = ($tvc_product_detail_data_collection_method == $key)?"selected":"";
591
+ ?>
592
+ <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
593
+ <?php
594
+ }
595
+ }?>
596
+ </select>
597
+ <div class="tvc-tooltip">
598
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your product detail page is not being tracked in google analytics (view_item), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
599
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
600
+ </div>
601
+ </td>
602
+ </tr>
603
+ <tr>
604
+ <th style="padding: 0 1rem;">
605
+ <label class="ga-title align-middle"><?php esc_html_e("Checkout page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
606
+ </th>
607
+ <td>
608
+ <?php
609
+ $tvc_checkout_data_collection_method = isset($data['tvc_checkout_data_collection_method'])?$data['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
610
  $list = array(
611
+ "woocommerce_before_checkout_form" => "woocommerce_before_checkout_form (default hook)",
612
+ "woocommerce_after_checkout_form" => "woocommerce_after_checkout_form (default hook)",
613
+ "woocommerce_checkout_billing" => "woocommerce_checkout_billing (default hook)",
614
+ "woocommerce_checkout_shipping" => "woocommerce_checkout_shipping (default hook)",
615
+ "woocommerce_checkout_order_review" => "woocommerce_checkout_order_review (default hook)",
616
+ "conversios_checkout_form" => "conversios_checkout_form (conversios hook)",
617
+ "on_page" =>"On page load"
618
  ); ?>
619
+ <select name="tvc_checkout_data_collection_method" class="data_collection_method">
620
  <?php if(!empty($list)){
621
  foreach($list as $key => $val){
622
+ $selected = ($tvc_checkout_data_collection_method == $key)?"selected":"";
623
  ?>
624
  <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
625
  <?php
627
  }?>
628
  </select>
629
  <div class="tvc-tooltip">
630
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your checkout is not being tracked in google analytics (checkout events), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
631
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
632
  </div>
633
+ </td>
634
+ </tr>
635
+ <tr>
636
+ <th style="padding: 0 1rem;">
637
+ <label class="ga-title align-middle"><?php esc_html_e("Order confirmation page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
638
+ </th>
639
+ <td>
640
+ <?php
641
+ $tvc_thankyou_data_collection_method = isset($data['tvc_thankyou_data_collection_method'])?$data['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
642
  $list = array(
643
+ "woocommerce_thankyou" => "woocommerce_thankyou (default hook)",
644
+ "woocommerce_before_thankyou" => "woocommerce_before_thankyou (default hook)",
645
+ "conversios_thankyou" => "conversios_thankyou (conversios hook)",
646
+ "on_page" =>"On page load"
 
647
  ); ?>
648
+ <select name="tvc_thankyou_data_collection_method" class="data_collection_method">
649
  <?php if(!empty($list)){
650
  foreach($list as $key => $val){
651
+ $selected = ($tvc_thankyou_data_collection_method == $key)?"selected":"";
652
  ?>
653
  <option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
654
  <?php
655
  }
656
  }?>
657
  </select>
658
+ <div class="tvc-tooltip">
659
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your transactions are not being tracked in google analytics (purchase event), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
660
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
661
  </div>
662
+ </td>
663
+ </tr>
664
+ <tr>
665
+ <th colspan="2">
666
+ <span>
667
+ <?php esc_html_e("Event selector","enhanced-e-commerce-for-woocommerce-store"); ?>
668
+ <div class="tvc-tooltip">
669
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you change your front end class or id for below events, select/input the changed class or id.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
670
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
671
+ </div>
672
+ </span>
673
+ </th>
674
+ </tr>
675
+ <tr>
676
+ <th style="padding: 0 1rem;">
677
+ <label class="ga-title align-middle"><?php esc_html_e("Product page AddToCart button","enhanced-e-commerce-for-woocommerce-store"); ?></label>
678
+ </th>
679
+ <td>
680
+ <?php $tvc_product_detail_addtocart_selector = isset($data['tvc_product_detail_addtocart_selector'])?$data['tvc_product_detail_addtocart_selector']:"default";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
  $list = array(
682
  "default" => "default",
683
  "custom" => "custom"
721
  <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter your button selector (id or calss) value. You can add multiple classes using comma separated string.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
722
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
723
  </div>
724
+ </span>
725
+ </td>
726
+ </tr>
727
+ <tr>
728
+ <th style="padding: 0 1rem;">
729
+ <label class="ga-title align-middle"><?php esc_html_e("Checkout Step 2","enhanced-e-commerce-for-woocommerce-store"); ?></label>
730
+ </th>
731
+ <td>
732
+ <?php $tvc_checkout_step_2_selector = isset($data['tvc_checkout_step_2_selector'])?$data['tvc_checkout_step_2_selector']:"default";
 
733
  $list = array(
734
  "default" => "default",
735
  "custom" => "custom"
772
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
773
  </div>
774
  </span>
775
+ </td>
776
+ </tr>
777
+ <tr>
778
+ <th style="padding: 0 1rem;">
779
+ <label class="ga-title align-middle"><?php esc_html_e("Checkout Step 3","enhanced-e-commerce-for-woocommerce-store"); ?></label>
780
+ </th>
781
+ <td>
782
+ <?php $tvc_checkout_step_3_selector = isset($data['tvc_checkout_step_3_selector'])?$data['tvc_checkout_step_3_selector']:"default";
783
  $list = array(
784
  "default" => "default",
785
  "custom" => "custom"
822
  <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
823
  </div>
824
  </span>
825
+ </td>
826
+ </tr>
827
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
  </div>
829
+ <!-- End Google Analytics Event Tracking - Custom Integration settings for GA-->
830
+ <!-- start Google Ads Setting section -->
831
+ <div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_GAds">
832
+ <?php esc_html_e("Google Ads Settings","enhanced-e-commerce-for-woocommerce-store"); ?>
833
+ <div class="tvc-tooltip">
834
+ <span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" Advance Setting.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
835
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
836
+ </div>
837
+ <img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
838
+ </div>
839
+ <div class="sec_con_integration" id="sec_con_integration_GAds">
840
+ <?php //google ads code start
841
+ if (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != '') { ?>
842
+ <label class="align-middle">
843
+ <div class="tvc-custom-control tvc-custom-checkbox">
844
+ <input type="checkbox" class="tvc-custom-control-input" id="customCheck1" name="remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->remarketing_tags) == 1) ? 'checked="checked"' : ''; ?> >
845
+ <label class="custom-control-label" for="customCheck1"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
846
  </div>
847
+ </label>
848
+ <label class="align-middle">
849
+ <div class="tvc-custom-control tvc-custom-checkbox">
850
+ <input type="checkbox" class="tvc-custom-control-input" id="customCheck2" name="dynamic_remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->dynamic_remarketing_tags) == 1) ? 'checked="checked"' : ''; ?>>
851
+ <label class="custom-control-label" for="customCheck2"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
852
  </div>
853
+ </label>
854
+ <label class="align-middle">
855
+ <div class="tvc-custom-control tvc-custom-checkbox">
856
+ <input type="checkbox" class="tvc-custom-control-input" id="customCheck3" name="link_google_analytics_with_google_ads" value="1" <?php echo (esc_attr($googleDetail->link_google_analytics_with_google_ads) == 1) ? 'checked="checked"' : ''; ?> >
857
+ <label class="custom-control-label" for="customCheck3"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></label>
858
+ </div>
859
+ </label>
860
+ <?php }else{ ?>
861
+ <h2 class="ga-title"><?php esc_html_e("Connect Google Ads account to enable below features.","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
862
+ <ul>
863
+ <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
864
+ <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
865
+ <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></li>
866
+ <li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></li>
867
+ </ul>
868
+ <?php
869
+ } ?>
870
+ <?php if($plan_id != 1 && isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ''){ ?>
871
+ <label class="align-middle">
872
  <div class="tvc-custom-control tvc-custom-checkbox">
873
+ <input type="checkbox" class="tvc-custom-control-input" id="google_ads_conversion_tracking" class="google_ads_conversion_tracking" name="google_ads_conversion_tracking" value="1" <?php echo (esc_attr($googleDetail->google_ads_conversion_tracking) == 1) ? 'checked="checked"' : ''; ?>>
874
+ <label for="google_ads_conversion_tracking"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?></label>
875
+ </div>
876
+ </label>
877
+ <div class="form-group google_ads_conversion_sec" id="google_ads_conversion_sec">
878
+ <?php $ga_EC = get_option("ga_EC"); ?>
879
  <label class="align-middle">
880
  <div class="tvc-custom-control tvc-custom-checkbox">
881
+ <input type="checkbox" class="tvc-custom-control-input" id="ga_EC" name="ga_EC" value="1"<?php if(!empty($ga_EC)){ echo (esc_attr($ga_EC) == 1) ? 'checked="checked"' : '';}?> <?php if($googleDetail->google_ads_conversion_tracking!=1){ echo 'disabled'; } ?>>
882
+ <label for="ga_EC"><?php esc_html_e("Enable Google Ads Enhanced Conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?>
883
+ </label>
884
+ </div>
885
  </label>
 
886
  <label class="align-middle">
887
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
888
  if($this->current_customer_id != ""){
889
  $response = $this->customApiObj->get_conversion_list($this->current_customer_id);
890
  if(property_exists($response,"error") && $response->error == true){
912
  }
913
  }
914
  ?>
 
 
 
 
 
 
 
 
915
  </label>
 
 
 
 
 
 
 
 
 
916
  </div>
917
+ <?php }else{?>
918
+ <ul>
919
+ <li>
920
+ <label class="align-middle">
921
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
922
+ </label>
923
+ </li>
924
+ <li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
 
926
+ <label class="align-middle">
927
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads Enhanced conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
928
+ </label>
929
+ </li>
930
+ </ul>
931
+ <?php } ?>
932
+ </div>
933
+ <!-- End Google Ads Setting section -->
934
+ </div>
935
+ <!-- End Advance settings section -->
936
+ <h4><label for="ga_PrivacyPolicy"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></label></h4>
937
+ <div class="con-setting-container-last">
938
+ <label class="align-middle">
939
+ <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy']) ? 'checked' : ''; ?>
940
+ <input type="checkbox" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo esc_attr($ga_PrivacyPolicy); ?>>
941
+ <label class="custom-control-label" for="ga_PrivacyPolicy"><?php esc_html_e("Accept Privacy Policy of Plugin","enhanced-e-commerce-for-woocommerce-store"); ?></label>
942
+
943
+ <p class="description"><?php esc_html_e("By using Conversios plugin, you agree to Conversios plugin's","enhanced-e-commerce-for-woocommerce-store"); ?> <a href= "<?php echo esc_url_raw("https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins"); ?>" target="_blank"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></a></p>
944
+ </label>
945
+ </div>
946
  <p class="submit save-for-later" id="save-for-later">
947
  <input type="hidden" id="ga_id" name = "ga_id" value="<?= esc_attr((!empty($data['ga_id']))?$data['ga_id']:""); ?>"/>
948
  <input type="hidden" id="gm_id" name = "gm_id" value="<?= esc_attr((!empty($data['gm_id']))?$data['gm_id']:""); ?>"/>
950
  <input type="hidden" id="google_merchant_id" name = "google_merchant_id" value="<?= esc_attr((!empty($data['google_merchant_id']))?$data['google_merchant_id']:""); ?>"/>
951
  <input type="hidden" name="subscription_id" value="<?php echo esc_attr((!empty($data['subscription_id']))?$data['subscription_id']:""); ?>">
952
  <button type="submit" class="btn btn-primary" id="ee_submit_plugin" name="ee_submit_plugin"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
953
+ </p>
954
  </form>
955
  </div>
956
  <div class="col-md-6 col-lg-4">
988
  jQuery(this).next().removeClass("tvc-hide");
989
  }
990
  });
991
+ //Event Tracking on change hide additional pixels for GTM
992
+ jQuery(document).on('change','#tracking_method',function(event){
993
+ if(jQuery(this).val() != "gtm"){
994
+ jQuery(".only-for-gtm").addClass("tvc-hide");
995
+ }else{
996
+ jQuery(".only-for-gtm").removeClass("tvc-hide");
997
+ }
998
+ });
999
+ if (jQuery("#want_to_use_your_gtm").is(":checked")) {
1000
+ jQuery("#use_your_gtm_id").removeClass("tvc-hide");
1001
+ }else{
1002
+ jQuery("#use_your_gtm_id").addClass("tvc-hide");
1003
+ }
1004
+
1005
+ jQuery("#want_to_use_your_gtm").click(function (){
1006
+ console.log("cafdfsd");
1007
+ if (jQuery("#want_to_use_your_gtm").is(":checked")) {
1008
+ jQuery("#use_your_gtm_id").removeClass("tvc-hide");
1009
+ }else{
1010
+ jQuery("#use_your_gtm_id").addClass("tvc-hide");
1011
+ //jQuery("#use_your_gtm_id").val("");
1012
+ }
1013
+ });
1014
 
1015
  jQuery(document).on('submit','form#ee_plugin_form',function(event){
1016
  if(jQuery('select[name="tvc_product_detail_addtocart_selector"]').val() == "custom" ){
enhanced-ecommerce-google-analytics.php CHANGED
@@ -12,10 +12,10 @@
12
  * @package Enhanced E-commerce for Woocommerce store
13
  *
14
  * @wordpress-plugin
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.9.4
19
  * Author: Conversios
20
  * Author URI: conversios.io
21
  * License: GPL-2.0+
@@ -23,7 +23,7 @@
23
  * Text Domain: enhanced-e-commerce-for-woocommerce-store
24
  * Domain Path: /languages
25
  * WC requires at least: 3.5.0
26
- * WC tested up to: 6.9.1
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.9.4' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
@@ -63,6 +63,10 @@ if(!defined('TVC_Admin_Helper')){
63
  include(ENHANCAD_PLUGIN_DIR . '/admin/class-tvc-admin-helper.php');
64
  }
65
 
 
 
 
 
66
  add_action( 'upgrader_process_complete', 'tvc_upgrade_function',10, 2);
67
  function tvc_upgrade_function( $upgrader_object, $options ) {
68
  if ($options['action'] == 'update' && $options['type'] == 'plugin' ) {
@@ -92,6 +96,7 @@ function activate_enhanced_ecommerce_google_analytics() {
92
  function deactivate_enhanced_ecommerce_google_analytics() {
93
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-deactivator.php';
94
  Enhanced_Ecommerce_Google_Analytics_Deactivator::deactivate();
 
95
  }
96
  register_activation_hook( __FILE__, 'activate_enhanced_ecommerce_google_analytics' );
97
  register_deactivation_hook( __FILE__, 'deactivate_enhanced_ecommerce_google_analytics' );
12
  * @package Enhanced E-commerce for Woocommerce store
13
  *
14
  * @wordpress-plugin
15
+ * Plugin Name: Conversios.io - All-in-one Analytics, Pixels and Product Feed Manager for WooCommerce
16
+ * Plugin URI: https://www.conversios.io/
17
+ * Description: Track visitors,conversions and build audiences for WooCommerce Google Analytics,Google Ads,FB Pixel,Bing,Snapchat,Pinterest,Tiktok via Google Tag Manager. Automate your product feed to Google Merchant Center for running performance max campaigns for your products to boost ROAS (Revenue on Ad Spends).
18
+ * Version: 5.0.0
19
  * Author: Conversios
20
  * Author URI: conversios.io
21
  * License: GPL-2.0+
23
  * Text Domain: enhanced-e-commerce-for-woocommerce-store
24
  * Domain Path: /languages
25
  * WC requires at least: 3.5.0
26
+ * WC tested up to: 7.0.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', '5.0.0' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
63
  include(ENHANCAD_PLUGIN_DIR . '/admin/class-tvc-admin-helper.php');
64
  }
65
 
66
+ if(!defined('CNVS_LOG')){
67
+ define('CNVS_LOG', ENHANCAD_PLUGIN_DIR.'logs/');
68
+ }
69
+
70
  add_action( 'upgrader_process_complete', 'tvc_upgrade_function',10, 2);
71
  function tvc_upgrade_function( $upgrader_object, $options ) {
72
  if ($options['action'] == 'update' && $options['type'] == 'plugin' ) {
96
  function deactivate_enhanced_ecommerce_google_analytics() {
97
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-deactivator.php';
98
  Enhanced_Ecommerce_Google_Analytics_Deactivator::deactivate();
99
+ wp_clear_scheduled_hook( 'tvc_add_cron_interval_for_product_sync' );
100
  }
101
  register_activation_hook( __FILE__, 'activate_enhanced_ecommerce_google_analytics' );
102
  register_deactivation_hook( __FILE__, 'deactivate_enhanced_ecommerce_google_analytics' );
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -181,7 +181,12 @@ class Enhanced_Ecommerce_Google_Analytics {
181
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
182
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
183
  $this->loader->add_action( 'admin_notices', $plugin_admin, 'tvc_admin_notice' );
184
- if ( is_admin() ) {
 
 
 
 
 
185
  new TVC_Survey( esc_html__("Enhanced ecommerce google analytics plugin for woocommerce"), ENHANCAD_PLUGIN_NAME );
186
  }
187
 
181
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
182
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
183
  $this->loader->add_action( 'admin_notices', $plugin_admin, 'tvc_admin_notice' );
184
+ $this->loader->add_action( 'admin_notice_message', $plugin_admin, 'tvc_add_admin_notice' );
185
+ $this->loader->add_action( 'admin_notices', $plugin_admin, 'tvc_display_admin_notices' );
186
+ $this->loader->add_action( 'admin_notices', $plugin_admin, 'tvc_add_data_admin_notice' );
187
+
188
+
189
+ if ( is_admin() ) {
190
  new TVC_Survey( esc_html__("Enhanced ecommerce google analytics plugin for woocommerce"), ENHANCAD_PLUGIN_NAME );
191
  }
192
 
includes/data/class-tvc-ajax-file.php CHANGED
@@ -34,6 +34,7 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
34
  add_action('wp_ajax_tvc_call_domain_claim', array($this, 'tvc_call_domain_claim'));
35
  add_action('wp_ajax_tvc_call_site_verified', array($this, 'tvc_call_site_verified'));
36
  add_action('wp_ajax_tvc_call_notice_dismiss', array($this, 'tvc_call_notice_dismiss'));
 
37
  add_action('wp_ajax_tvc_call_notification_dismiss', array($this, 'tvc_call_notification_dismiss'));
38
  add_action('wp_ajax_auto_product_sync_setting', array($this, 'auto_product_sync_setting'));
39
  add_action('wp_ajax_tvc_call_active_licence', array($this, 'tvc_call_active_licence'));
@@ -41,8 +42,13 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
41
 
42
  add_action('wp_ajax_tvc_call_add_customer_feedback', array($this, 'tvc_call_add_customer_feedback'));
43
 
 
 
44
  add_action('wp_ajax_tvcajax_product_sync_bantch_wise', array($this, 'tvcajax_product_sync_bantch_wise'));
45
  add_action('wp_ajax_update_user_tracking_data', array($this,'update_user_tracking_data') );
 
 
 
46
  }
47
 
48
  public function update_user_tracking_data(){
@@ -77,7 +83,8 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
77
  wp_die();
78
  }
79
 
80
- public function tvcajax_product_sync_bantch_wise(){
 
81
  global $wpdb;
82
  $rs = array();
83
  // barch size for inser data in DB
@@ -255,6 +262,221 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
255
  echo json_encode(array('status'=>'success', "sync_progressive_data" => $sync_progressive_data, "api_rs"=>$rs));
256
  exit;
257
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  public function tvc_call_add_customer_feedback(){
259
  if( isset($_POST['que_one']) && isset($_POST['que_two']) && isset($_POST['que_three']) ){
260
  $formdata = array();
@@ -294,7 +516,7 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
294
 
295
  if($response->error== false){
296
  //$key, $html, $title = null, $link = null, $link_title = null, $overwrite= false
297
- //$TVC_Admin_Helper->add_ee_msg_nofification("active_licence_key", esc_html__("Your plan is now successfully activated.","enhanced-e-commerce-for-woocommerce-store"), esc_html__("Congratulations!!","conversios"), "", "", true);
298
  $TVC_Admin_Helper->update_subscription_details_api_to_db();
299
  echo json_encode(array('error' => false, "is_connect"=>true, 'message' => esc_html__("The licence key has been activated.","enhanced-e-commerce-for-woocommerce-store") ));
300
  }else{
@@ -323,7 +545,8 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
323
  $ee_additional_data['product_sync_duration'] = $product_sync_duration;
324
  $ee_additional_data['pro_snyc_time_limit'] = $pro_snyc_time_limit;
325
  $ee_additional_data['product_sync_batch_size'] = $product_sync_batch_size;
326
- $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
 
327
  echo json_encode(array('error' => false, 'message' => esc_html__("Time interval and batch size successfully saved.","enhanced-e-commerce-for-woocommerce-store")));
328
  }else{
329
  echo json_encode(array('error' => true, 'message' => esc_html__("Error occured while saving the settings.","enhanced-e-commerce-for-woocommerce-store")));
@@ -361,6 +584,23 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
361
  }
362
  exit;
363
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  public function tvc_call_import_gmc_product(){
365
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiSyncupNonce'), 'tvc_call_api_sync-nonce')){
366
  $next_page_token = isset($_POST['next_page_token'])?sanitize_text_field($_POST['next_page_token']):"";
34
  add_action('wp_ajax_tvc_call_domain_claim', array($this, 'tvc_call_domain_claim'));
35
  add_action('wp_ajax_tvc_call_site_verified', array($this, 'tvc_call_site_verified'));
36
  add_action('wp_ajax_tvc_call_notice_dismiss', array($this, 'tvc_call_notice_dismiss'));
37
+ add_action('wp_ajax_tvc_call_notice_dismiss_trigger', array($this, 'tvc_call_notice_dismiss_trigger'));
38
  add_action('wp_ajax_tvc_call_notification_dismiss', array($this, 'tvc_call_notification_dismiss'));
39
  add_action('wp_ajax_auto_product_sync_setting', array($this, 'auto_product_sync_setting'));
40
  add_action('wp_ajax_tvc_call_active_licence', array($this, 'tvc_call_active_licence'));
42
 
43
  add_action('wp_ajax_tvc_call_add_customer_feedback', array($this, 'tvc_call_add_customer_feedback'));
44
 
45
+ // Not in use after product sync from backend
46
+ //add_action('wp_ajax_tvcajax_product_sync_bantch_wise', array($this, 'tvcajax_product_sync_bantch_wise_old'));
47
  add_action('wp_ajax_tvcajax_product_sync_bantch_wise', array($this, 'tvcajax_product_sync_bantch_wise'));
48
  add_action('wp_ajax_update_user_tracking_data', array($this,'update_user_tracking_data') );
49
+ add_action('init_product_sync_process_scheduler', array($this,'tvc_call_start_product_sync_process'), 10, 1 );
50
+ add_action('auto_product_sync_process_scheduler', array($this,'tvc_call_auto_product_sync_process') );
51
+ add_action('wp_ajax_auto_product_sync_process_scheduler', array($this,'tvc_call_auto_product_sync_process') );
52
  }
53
 
54
  public function update_user_tracking_data(){
83
  wp_die();
84
  }
85
 
86
+ // Not in use after product sync from backend
87
+ public function tvcajax_product_sync_bantch_wise_old(){
88
  global $wpdb;
89
  $rs = array();
90
  // barch size for inser data in DB
262
  echo json_encode(array('status'=>'success', "sync_progressive_data" => $sync_progressive_data, "api_rs"=>$rs));
263
  exit;
264
  }
265
+
266
+ public function tvcajax_product_sync_bantch_wise(){
267
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
268
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
269
+ try {
270
+ $mappedCats = [];
271
+ $mappedAttrs = [];
272
+ $mappedCatsDB = [];
273
+ $product_batch_size = isset($_POST['product_batch_size'])?sanitize_text_field($_POST['product_batch_size']):"25";// barch size for inser product in GMC
274
+ $data = isset($_POST['tvc_data'])?$_POST['tvc_data']:"";
275
+
276
+ $TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
277
+ parse_str($data, $formArray);
278
+ if(!empty($formArray)){
279
+ foreach ($formArray as $key => $value) {
280
+ $formArray[$key] = sanitize_text_field($value);
281
+ }
282
+ }
283
+
284
+ /*
285
+ * Collect Attribute/Categories Mapping
286
+ */
287
+ foreach($formArray as $key => $value){
288
+ if(preg_match("/^category-name-/i", $key)){
289
+ if($value != ''){
290
+ $keyArray = explode("name-", $key);
291
+ $mappedCatsDB[$keyArray[1]]['name'] = $value;
292
+ }
293
+ unset($formArray[$key]);
294
+ }else if(preg_match("/^category-/i", $key)){
295
+ if($value != '' && $value > 0){
296
+ $keyArray = explode("-", $key);
297
+ $mappedCats[$keyArray[1]] = $value;
298
+ $mappedCatsDB[$keyArray[1]]['id'] = $value;
299
+ }
300
+ unset($formArray[$key]);
301
+ }else{
302
+ if($value){
303
+ $mappedAttrs[$key] = $value;
304
+ }
305
+ }
306
+ }
307
+
308
+ //add/update data in default profile
309
+ $profile_data = array("profile_title"=>esc_sql("Default"),"g_attribute_mapping"=>json_encode($mappedAttrs),"update_date"=>date('Y-m-d'));
310
+ if($TVC_Admin_DB_Helper->tvc_row_count("ee_product_sync_profile") ==0){
311
+ $TVC_Admin_DB_Helper->tvc_add_row("ee_product_sync_profile", $profile_data, array("%s", "%s","%s"));
312
+ }else{
313
+ $TVC_Admin_DB_Helper->tvc_update_row("ee_product_sync_profile", $profile_data, array("id" => 1));
314
+ }
315
+ // Update settings
316
+ update_option("ee_prod_mapped_cats", serialize($mappedCatsDB));
317
+ update_option("ee_prod_mapped_attrs", serialize($mappedAttrs));
318
+
319
+ // Batch settings
320
+ $ee_additional_data['is_mapping_update'] = true;
321
+ $ee_additional_data['is_process_start'] = false;
322
+ $ee_additional_data['is_auto_sync_start'] = false;
323
+ $ee_additional_data['product_sync_batch_size'] = $product_batch_size;
324
+ $ee_additional_data['product_sync_alert'] = "Product sync settings updated successfully";
325
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
326
+
327
+ // add scheduled cron job
328
+ //wp_schedule_single_event(time()+1, 'init_product_sync_process_scheduler', array(time()));
329
+ as_unschedule_all_actions( 'auto_product_sync_process_scheduler' );
330
+ as_unschedule_all_actions( 'init_product_sync_process_scheduler' );
331
+ as_enqueue_async_action('init_product_sync_process_scheduler');
332
+ $TVC_Admin_Helper->plugin_log("mapping saved and product sync process scheduled", 'product_sync');// Add logs
333
+
334
+ $sync_message = esc_html__("Initiated, products are being synced to Merchant Center.Do not refresh..","enhanced-e-commerce-for-woocommerce-store");
335
+ $sync_progressive_data = array("sync_message"=>$sync_message);
336
+ echo json_encode(array('status'=>'success', "sync_progressive_data" => $sync_progressive_data));
337
+ } catch (Exception $e) {
338
+ $ee_additional_data['product_sync_alert'] = $e->getMessage();
339
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
340
+ $TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
341
+ }
342
+ wp_die();
343
+ }
344
+
345
+ function tvc_call_start_product_sync_process(){
346
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
347
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
348
+ try {
349
+ global $wpdb;
350
+ $product_db_batch_size = 200; // batch size to insert in database
351
+ $TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
352
+ $prouct_pre_sync_table = esc_sql( $wpdb->prefix ."ee_prouct_pre_sync_data" );
353
+ $mappedCats = unserialize(get_option('ee_prod_mapped_cats'));
354
+ if (!empty($ee_additional_data) && isset($ee_additional_data['is_mapping_update']) && $ee_additional_data['is_mapping_update'] == true) {
355
+ // Add products in product pre sync table
356
+ if(!empty($mappedCats)){
357
+ // truncate data from product pre sync table
358
+ if( $TVC_Admin_DB_Helper->tvc_row_count("ee_prouct_pre_sync_data") > 0 ){
359
+ $TVC_Admin_DB_Helper->tvc_safe_truncate_table($prouct_pre_sync_table);
360
+ }
361
+
362
+ $batch_count =0;
363
+ $values = array();
364
+ $place_holders = array();
365
+ foreach($mappedCats as $mc_key => $mappedCat){
366
+ $all_products = get_posts(array(
367
+ 'post_type' => 'product',
368
+ 'posts_per_page' => 1500,
369
+ 'numberposts' => -1,
370
+ 'post_status' => 'publish',
371
+ 'tax_query' => array(
372
+ array(
373
+ 'taxonomy' => 'product_cat',
374
+ 'field' => 'term_id',
375
+ 'terms' => $mc_key, /* category name */
376
+ 'operator' => 'IN',
377
+ 'include_children' => false
378
+ )
379
+ )
380
+ ));
381
+ $TVC_Admin_Helper->plugin_log("category id ".$mc_key." gmc product name ".$mappedCat['name']." - product count - ".count($all_products), 'product_sync'); // Add logs
382
+ if(!empty($all_products)){
383
+ foreach($all_products as $postvalue){
384
+ $batch_count++;
385
+ array_push( $values, esc_sql($postvalue->ID), esc_sql($mc_key), esc_sql($mappedCat['id']), 1, date( 'Y-m-d H:i:s', current_time( 'timestamp') ) );
386
+ $place_holders[] = "('%d', '%d', '%d','%d', '%s')";
387
+ if($batch_count >= $product_db_batch_size){
388
+ $query = "INSERT INTO `$prouct_pre_sync_table` (w_product_id, w_cat_id, g_cat_id, product_sync_profile_id, create_date) VALUES ";
389
+ $query .= implode( ', ', $place_holders );
390
+ $wpdb->query($wpdb->prepare( $query, $values ));
391
+ $batch_count = 0;
392
+ $values = array();
393
+ $place_holders = array();
394
+ }
395
+ } //end product list loop
396
+ }// end products if
397
+ }//end category loop
398
+
399
+ // Add products in database
400
+ if($batch_count > 0){
401
+ $query = "INSERT INTO `$prouct_pre_sync_table` (w_product_id, w_cat_id, g_cat_id, product_sync_profile_id, create_date) VALUES ";
402
+ $query .= implode( ', ', $place_holders );
403
+ $wpdb->query($wpdb->prepare( $query, $values ));
404
+ }
405
+
406
+ // add scheduled cron job
407
+ if ( false === as_next_scheduled_action( 'tvc_add_cron_interval_for_product_sync' ) ) {
408
+ as_schedule_single_action( time()+5, 'auto_product_sync_process_scheduler' );
409
+ }
410
+ }
411
+
412
+ $ee_additional_data['is_mapping_update'] = false;
413
+ $ee_additional_data['is_process_start'] = true;
414
+ $ee_additional_data['product_sync_alert'] = "Product sync process is ready to start";
415
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
416
+ }
417
+ } catch (Exception $e) {
418
+ $ee_additional_data['product_sync_alert'] = $e->getMessage();
419
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
420
+ $TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
421
+ }
422
+ return true;
423
+ }
424
+
425
+ function tvc_call_auto_product_sync_process(){
426
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
427
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
428
+ $ee_additional_data['product_sync_alert'] = NULL;
429
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
430
+ try {
431
+ // add scheduled cron job
432
+ as_unschedule_all_actions( 'auto_product_sync_process_scheduler' );
433
+ $TVC_Admin_Helper->plugin_log("auto product sync process start", 'product_sync');
434
+ global $wpdb;
435
+ if (!empty($ee_additional_data) && isset($ee_additional_data['is_process_start']) && $ee_additional_data['is_process_start'] == true) {
436
+ if(!class_exists('TVCProductSyncHelper')){
437
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/class-tvc-product-sync-helper.php');
438
+ }
439
+ $TVCProductSyncHelper = new TVCProductSyncHelper();
440
+ $response = $TVCProductSyncHelper->call_batch_wise_auto_sync_product();
441
+ if (!empty($response) && isset($response['message'])) {
442
+ $TVC_Admin_Helper->plugin_log("Batch wise auto sync process response ".$response['message'], 'product_sync');
443
+ }
444
+
445
+ $tablename = esc_sql( $wpdb->prefix ."ee_prouct_pre_sync_data" );
446
+ $total_pending_pro = $wpdb->get_var("SELECT COUNT(*) as a FROM $tablename where `status` = 0");
447
+ if($total_pending_pro == 0){
448
+ // Truncate pre sync table
449
+ $TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
450
+ $TVC_Admin_DB_Helper->tvc_safe_truncate_table($tablename);
451
+
452
+ $ee_additional_data['is_process_start'] = false;
453
+ $ee_additional_data['is_auto_sync_start'] = true;
454
+ $ee_additional_data['product_sync_alert'] = NULL;
455
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
456
+ $TVC_Admin_Helper->plugin_log("product sync process done", 'product_sync');
457
+ } else {
458
+ // add scheduled cron job
459
+ if ( false === as_next_scheduled_action( 'tvc_add_cron_interval_for_product_sync' ) ) {
460
+ // as_schedule_cron_action( time(), '0/3 * * * *', 'auto_product_sync_process_scheduler' );
461
+ as_schedule_single_action( time()+5, 'auto_product_sync_process_scheduler' );
462
+ }
463
+ $TVC_Admin_Helper->plugin_log("recall product sync process", 'product_sync');
464
+ // $this->tvc_call_auto_product_sync_process();
465
+ }
466
+ } else {
467
+ // add scheduled cron job
468
+ as_unschedule_all_actions( 'auto_product_sync_process_scheduler' );
469
+ }
470
+ echo json_encode(array('status'=>'success', "message" => esc_html__("Product sync process started successfully")));
471
+ return true;
472
+ } catch (Exception $e) {
473
+ $ee_additional_data['product_sync_alert'] = $e->getMessage();
474
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
475
+ $TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
476
+ return true;
477
+ }
478
+ }
479
+
480
  public function tvc_call_add_customer_feedback(){
481
  if( isset($_POST['que_one']) && isset($_POST['que_two']) && isset($_POST['que_three']) ){
482
  $formdata = array();
516
 
517
  if($response->error== false){
518
  //$key, $html, $title = null, $link = null, $link_title = null, $overwrite= false
519
+ //$TVC_Admin_Helper->add_ee_msg_nofification("active_licence_key", esc_html__("Your plan is now successfully activated.","enhanced-e-commerce-for-woocommerce-store"), esc_html__("Congratulations!!","enhanced-e-commerce-for-woocommerce-store"), "", "", true);
520
  $TVC_Admin_Helper->update_subscription_details_api_to_db();
521
  echo json_encode(array('error' => false, "is_connect"=>true, 'message' => esc_html__("The licence key has been activated.","enhanced-e-commerce-for-woocommerce-store") ));
522
  }else{
545
  $ee_additional_data['product_sync_duration'] = $product_sync_duration;
546
  $ee_additional_data['pro_snyc_time_limit'] = $pro_snyc_time_limit;
547
  $ee_additional_data['product_sync_batch_size'] = $product_sync_batch_size;
548
+ $TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
549
+ new TVC_Admin_Auto_Product_sync_Helper();
550
  echo json_encode(array('error' => false, 'message' => esc_html__("Time interval and batch size successfully saved.","enhanced-e-commerce-for-woocommerce-store")));
551
  }else{
552
  echo json_encode(array('error' => true, 'message' => esc_html__("Error occured while saving the settings.","enhanced-e-commerce-for-woocommerce-store")));
584
  }
585
  exit;
586
  }
587
+
588
+ public function tvc_call_notice_dismiss_trigger(){
589
+ if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiNoticDismissNonce'), 'tvc_call_notice_dismiss-nonce')){
590
+ $ee_notice_dismiss_id_trigger = isset($_POST['data']['ee_notice_dismiss_id_trigger'])?sanitize_text_field($_POST['data']['ee_notice_dismiss_id_trigger']):"";
591
+ $ee_notice_dismiss_id_trigger = sanitize_text_field($ee_notice_dismiss_id_trigger);
592
+ if($ee_notice_dismiss_id_trigger != ""){
593
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
594
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
595
+ $slug = $ee_notice_dismiss_id_trigger;
596
+ $title = "";
597
+ $content = "";
598
+ $status = "0";
599
+ $TVC_Admin_Helper->tvc_dismiss_admin_notice($slug, $title, $content, $status);
600
+ }
601
+ }
602
+ exit;
603
+ }
604
  public function tvc_call_import_gmc_product(){
605
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiSyncupNonce'), 'tvc_call_api_sync-nonce')){
606
  $next_page_token = isset($_POST['next_page_token'])?sanitize_text_field($_POST['next_page_token']):"";
includes/setup/CustomApi.php CHANGED
@@ -652,10 +652,12 @@ class CustomApi{
652
  }else{
653
  $return->error = true;
654
  $return->arges = $args;
655
- foreach($response->errors as $err){
656
- $return->message = $err;
657
- break;
658
- }
 
 
659
  return $return;
660
  }
661
  } catch (Exception $e) {
@@ -697,10 +699,12 @@ class CustomApi{
697
  }else{
698
  $return->status = $response_code;
699
  $return->error = true;
700
- foreach($response->errors as $err){
701
- $return->message = $err;
702
- break;
703
- }
 
 
704
  return $return;
705
  }
706
 
652
  }else{
653
  $return->error = true;
654
  $return->arges = $args;
655
+ if (isset($response->errors)) {
656
+ foreach($response->errors as $err){
657
+ $return->message = $err;
658
+ break;
659
+ }
660
+ }
661
  return $return;
662
  }
663
  } catch (Exception $e) {
699
  }else{
700
  $return->status = $response_code;
701
  $return->error = true;
702
+ if (isset($response->errors)) {
703
+ foreach($response->errors as $err){
704
+ $return->message = $err;
705
+ break;
706
+ }
707
+ }
708
  return $return;
709
  }
710
 
includes/setup/class-tatvic-category-selector-element.php CHANGED
@@ -20,7 +20,7 @@ if ( ! class_exists( 'Tatvic_Category_Selector_Element' ) ) :
20
  */
21
 
22
 
23
- public static function category_mapping_row( $category, $category_children, $level_indicator, $mode, $ee_prod_mapped_cats) {
24
  $category_row_class = 'mapping' === $mode ? 'tvc-category-mapping-selector' : 'tvc-category-selector';
25
  $mode_column = 'mapping' === $mode ? self::category_mapping_selector( 'catmap', $category->term_id, true, $ee_prod_mapped_cats ) : self::category_description_data_item( $category->term_id );
26
  return '<div class="row">
20
  */
21
 
22
 
23
+ public static function category_mapping_row( $category, $level_indicator, $mode, $ee_prod_mapped_cats) {
24
  $category_row_class = 'mapping' === $mode ? 'tvc-category-mapping-selector' : 'tvc-category-selector';
25
  $mode_column = 'mapping' === $mode ? self::category_mapping_selector( 'catmap', $category->term_id, true, $ee_prod_mapped_cats ) : self::category_description_data_item( $category->term_id );
26
  return '<div class="row">
includes/setup/class-tvc-product-sync-helper.php CHANGED
@@ -77,13 +77,16 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
77
  * careate products object for product sync
78
  */
79
  public function tvc_get_map_product_attribute($products, $tvc_currency, $merchantId, $product_batch_size = 100){
 
80
  if(!empty($products)){
81
  global $wpdb;
82
  $tve_table_prefix = $wpdb->prefix;
83
  $plan_id = $this->TVC_Admin_Helper->get_plan_id();
84
  $items = [];
 
85
  $skipProducts = [];
86
  $product_ids = [];
 
87
  $batchId = time();
88
  $sync_profile = $this->TVC_Admin_DB_Helper->tvc_get_results('ee_product_sync_profile');
89
  // set profile id in array key
@@ -147,7 +150,7 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
147
  if($prd->get_type() == "variable"){
148
  /*$variation_attributes = $prd->get_variation_attributes();*/
149
  //$p_variations = $prd->get_available_variations();
150
- $p_variations = $prd->get_children();
151
  if(!empty($p_variations)){
152
  foreach ($p_variations as $v_key => $variation_id) {
153
  $variation = wc_get_product( $variation_id );
@@ -262,8 +265,12 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
262
  'product' => $product
263
  ];
264
  $items[] = $item;
 
265
  }
266
- }
 
 
 
267
 
268
  }else{
269
  //simpleproduct:
@@ -342,17 +349,21 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
342
  'batch_id' => sanitize_text_field(++$batchId),
343
  'method' => 'insert',
344
  'product' => $product
345
- ];
346
  $items[] = $item;
 
347
  }
348
 
349
  $products_sync++;
350
  if(count($items) >= $product_batch_size){
351
- return array('error'=>false, 'items' => $items, 'skip_products'=> $skipProducts, 'product_ids'=>$product_ids, 'last_sync_product_id'=> $postvalue->id, 'products_sync' => $products_sync);
352
  }
353
  }
354
- return array('error'=>false, 'items' => $items, 'skip_products'=> $skipProducts, 'product_ids'=>$product_ids, 'last_sync_product_id'=> $postvalue->id, 'products_sync' => $products_sync);
355
  }
 
 
 
356
  }
357
  /*
358
  * batch wise sync product, its call from ajax fuction
@@ -412,6 +423,87 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
412
  }
413
 
414
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  public function wooCommerceAttributes() {
416
  global $wpdb;
417
  $tve_table_prefix = $wpdb->prefix;
@@ -448,7 +540,7 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
448
  <div class="col-6">
449
  <h6 class="heading-tbl gmc-image-heading"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/google-shopping.svg'); ?>" alt="google-shopping"/><?php esc_html_e("Google Merchant Center Category","enhanced-e-commerce-for-woocommerce-store"); ?></h6>
450
  </div>
451
- </div><?php echo $this->category_wrapper_obj->category_table_content('mapping'); ?>
452
  </div>
453
  </section>
454
  <!-- Step 2 -->
@@ -532,7 +624,11 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
532
  <option value="25">25</option>
533
  <option selected="selected" value="50">50</option>
534
  <option value="100">100</option>
 
535
  </select>
 
 
 
536
  </div>
537
  </section>
538
  </form>
@@ -564,14 +660,14 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
564
  $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
565
  ?>
566
  <script>
567
- jQuery(document).ready(function() {
568
- jQuery('#syncProduct .select2').each(function() {
569
- var $p = jQuery(this).parent();
570
- jQuery(this).select2({
571
- dropdownParent: $p
572
- });
573
- });
574
- });
575
 
576
  jQuery(".tab-wizard").steps({
577
  headerTag: "h5",
@@ -619,97 +715,159 @@ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
619
  }//check for required fields end
620
  }
621
  });
622
-
623
- function submitProductSyncUp(sync_progressive_data = null){
624
- jQuery("#feed-spinner").css("display", "block");
625
- jQuery('.progress-bar-wapper').addClass('open');
626
- user_tracking_data('click', 'null','sync_product_page','sync_products');
627
- var data = {
628
- action:'tvcajax_product_sync_bantch_wise',
629
- merchant_id:'<?php echo esc_attr($this->merchantId); ?>',
630
- account_id:'<?php echo esc_attr($this->accountId); ?>',
631
- customer_id: '<?php echo esc_attr($this->currentCustomerId); ?>',
632
- subscription_id: '<?php echo esc_attr($this->subscriptionId); ?>',
633
- tvc_data: jQuery("#productSync").serialize(),
634
- product_batch_size: jQuery("#product_batch_size").val(),
635
- sync_progressive_data:sync_progressive_data
636
- }
637
- jQuery.ajax({
638
- type: "POST",
639
- dataType: "json",
640
- url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
641
- data: data,
642
- beforeSend: function(){
643
- },
644
- success: function(response){
645
- //console.log(response);
646
- jQuery("#feed-spinner").css("display", "none");
647
- if(response.status == "success"){
648
- //var rs = JSON.parse(response);
649
- let sync_produt_p = Math.round(response.sync_progressive_data.sync_produt_p);
650
- let total_product = response.sync_progressive_data.total_product;
651
- let sync_produt = response.sync_progressive_data.sync_produt;
652
- let sync_message = response.sync_progressive_data.sync_message;
653
- let sync_step = response.sync_progressive_data.sync_step;
654
- let is_synced_up = response.sync_progressive_data.is_synced_up;
655
- let last_sync_product_id = response.sync_progressive_data.last_sync_product_id;
656
- let skip_products = response.sync_progressive_data.last_sync_product_id;
657
- let tvc_sync_progress_bar_class = "tvc-sync-progress-bar";
658
- if(sync_step == 1){
659
- jQuery(".tvc-sync-progress-db").css("display","flex");
660
- }else if(sync_step == 2){
661
- jQuery(".tvc-sync-progress-db").hide();
662
- jQuery(".tvc-sync-progress-gmc").css("display","flex");
663
- tvc_sync_progress_bar_class = "tvc-sync-success-progress-bar";
664
- }
 
665
 
666
- jQuery("."+tvc_sync_progress_bar_class).css("width",sync_produt_p+"%");
667
- jQuery("."+tvc_sync_progress_bar_class).html(sync_produt_p+"%");
668
- jQuery("."+tvc_sync_progress_bar_class).attr("aria-valuenow",sync_produt_p);
669
- jQuery(".tvc-progress-info").show();
670
- jQuery(".tvc-sync-count").html(sync_produt);
671
- jQuery(".tvc-total-count").html(total_product);
672
- jQuery(".tvc-sync-message").html(sync_message);
673
- if(sync_step == 1 && is_synced_up == true){
674
- is_synced_up = false;
675
- }
676
 
677
- if(is_synced_up == false && sync_step <= 2){
678
- submitProductSyncUp(response.sync_progressive_data);
679
- }else if(sync_step == 2 ){
680
- setTimeout(function(){
681
- jQuery('.progress-bar-wapper').removeClass('open');
682
- jQuery(".tvc-sync-progress-bar").css("width","0%");
683
- jQuery(".tvc-sync-success-progress-bar").css("width","0%");
684
- jQuery(".tvc-sync-progress-bar").html("0%");
685
- jQuery(".tvc-sync-success-progress-bar").html("0%");
686
- jQuery(".tvc-sync-progress-bar").attr("aria-valuenow","0");
687
- jQuery(".tvc-sync-success-progress-bar").attr("aria-valuenow","0");
688
- jQuery(".tvc-sync-count").html("0");
689
- jQuery(".tvc-total-count").html("--");
690
- jQuery(".tvc-sync-message").html("Initialization of products data for push data in Google shopping");
691
- if (response.api_rs.error == false) {
692
- var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
693
- if (response.sync_progressive_data.skip_products.length > 0) {
694
- message = message + "\n Because of pricing issues, " + response.sync_progressive_data.skip_products.length + " products did not sync.";
695
- }
696
- tvc_helper.tvc_alert("success","",message);
697
- window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
698
- }else {
699
- tvc_helper.tvc_alert("error","",response.api_rs.message);
700
- }
701
- }, 2000);
702
- }
703
- }else{
704
- tvc_helper.tvc_alert("error","",response.message);
705
- setTimeout(function(){
706
- window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
707
- }, 2000);
708
- }
709
 
710
- }
711
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
713
 
714
  jQuery(document).on("show.bs.modal", "#syncProduct", function (e) {
715
  jQuery("#feed-spinner").css("display", "block");
77
  * careate products object for product sync
78
  */
79
  public function tvc_get_map_product_attribute($products, $tvc_currency, $merchantId, $product_batch_size = 100){
80
+ try{
81
  if(!empty($products)){
82
  global $wpdb;
83
  $tve_table_prefix = $wpdb->prefix;
84
  $plan_id = $this->TVC_Admin_Helper->get_plan_id();
85
  $items = [];
86
+ $validProducts = [];
87
  $skipProducts = [];
88
  $product_ids = [];
89
+ $deletedIds = [];
90
  $batchId = time();
91
  $sync_profile = $this->TVC_Admin_DB_Helper->tvc_get_results('ee_product_sync_profile');
92
  // set profile id in array key
150
  if($prd->get_type() == "variable"){
151
  /*$variation_attributes = $prd->get_variation_attributes();*/
152
  //$p_variations = $prd->get_available_variations();
153
+ $p_variations = $prd->get_children();
154
  if(!empty($p_variations)){
155
  foreach ($p_variations as $v_key => $variation_id) {
156
  $variation = wc_get_product( $variation_id );
265
  'product' => $product
266
  ];
267
  $items[] = $item;
268
+ $validProducts[] = $postvalue;
269
  }
270
+ } else {
271
+ //Delete the variant product which does not have children
272
+ $deletedIds[] = $postvalue->w_product_id;
273
+ }
274
 
275
  }else{
276
  //simpleproduct:
349
  'batch_id' => sanitize_text_field(++$batchId),
350
  'method' => 'insert',
351
  'product' => $product
352
+ ];
353
  $items[] = $item;
354
+ $validProducts[] = $postvalue;
355
  }
356
 
357
  $products_sync++;
358
  if(count($items) >= $product_batch_size){
359
+ return array('error'=>false, 'items' => $items, 'valid_products'=>$validProducts, 'deleted_products'=> $deletedIds, 'skip_products'=> $skipProducts, 'product_ids'=>$product_ids, 'last_sync_product_id'=> $postvalue->id, 'products_sync' => $products_sync);
360
  }
361
  }
362
+ return array('error'=>false, 'items' => $items, 'valid_products'=>$validProducts, 'deleted_products'=> $deletedIds, 'skip_products'=> $skipProducts, 'product_ids'=>$product_ids, 'last_sync_product_id'=> $postvalue->id, 'products_sync' => $products_sync);
363
  }
364
+ } catch (Exception $e) {
365
+ $this->TVC_Admin_Helper ->plugin_log($e->getMessage(), 'product_sync');
366
+ }
367
  }
368
  /*
369
  * batch wise sync product, its call from ajax fuction
423
  }
424
 
425
  }
426
+
427
+ /*
428
+ * Batch wise sync product, its call from ajax fuction
429
+ */
430
+ public function call_batch_wise_auto_sync_product(){
431
+ $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
432
+ try {
433
+ global $wpdb;
434
+ $startTime = new DateTime();
435
+ if (!class_exists('CustomApi')) {
436
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
437
+ }
438
+ $CustomApi = new CustomApi();
439
+ $tablename = esc_sql( $wpdb->prefix ."ee_prouct_pre_sync_data" );
440
+ $product_count = $wpdb->get_var("SELECT COUNT(*) as a FROM $tablename where status = 0");
441
+ if( $product_count > 0 ){
442
+ $product_batch_size = (isset($ee_additional_data['product_sync_batch_size']) && $ee_additional_data['product_sync_batch_size']) ? $ee_additional_data['product_sync_batch_size'] : 100;
443
+ $tvc_currency = sanitize_text_field($this->TVC_Admin_Helper->get_woo_currency());
444
+ $merchantId = sanitize_text_field($this->merchantId);
445
+ $accountId = sanitize_text_field($this->accountId);
446
+ $subscriptionId = sanitize_text_field($this->subscriptionId);
447
+ $product_batch_size = esc_sql(intval($product_batch_size));
448
+ //$product_batch_size = 1000;
449
+ $products = $wpdb->get_results( $wpdb->prepare("select * from `$tablename` where `status` = 0 LIMIT %d", $product_batch_size), OBJECT);
450
+ if(!empty($products)){
451
+ $p_map_attribute = $this->tvc_get_map_product_attribute($products, $tvc_currency, $merchantId, $product_batch_size);
452
+
453
+ //Delete the variant product which does not have children
454
+ if(!empty($p_map_attribute) && isset($p_map_attribute['deleted_products']) && !empty($p_map_attribute['deleted_products'])){
455
+ $dids = esc_sql(implode(', ', $p_map_attribute['deleted_products']));
456
+ $wpdb->query("DELETE FROM $tablename where `w_product_id` in ($dids)");
457
+ }
458
+ $TVC_Admin_Auto_Product_sync_Helper = new TVC_Admin_Auto_Product_sync_Helper();
459
+ $TVC_Admin_Auto_Product_sync_Helper->update_last_sync_in_db_batch_wise($p_map_attribute['valid_products']);//Add data in sync product database
460
+ if(!empty($p_map_attribute) && isset($p_map_attribute['items']) && !empty($p_map_attribute['items'])){
461
+ // call product sync API
462
+ $data = [
463
+ 'merchant_id' => sanitize_text_field($accountId),
464
+ 'account_id' => sanitize_text_field($merchantId),
465
+ 'subscription_id' => sanitize_text_field($subscriptionId),
466
+ 'entries' => $p_map_attribute['items']
467
+ ];
468
+ $this->TVC_Admin_Helper->plugin_log("Before product sync API Call for ".count($p_map_attribute['items']). " products", 'product_sync');
469
+ $response = $CustomApi->products_sync($data);
470
+ $endTime = new DateTime();
471
+ $diff = $endTime->diff($startTime);
472
+ $this->TVC_Admin_Helper->plugin_log("Products sync API duration time ".$diff->i." minutes".$diff->s." seconds", 'product_sync');
473
+ $responseData['time_duration'] = $diff;
474
+ update_option("ee_prod_response", serialize($responseData));
475
+
476
+ if($response->error== false){
477
+ // Update status in pre sync product database
478
+ $TVC_Admin_Auto_Product_sync_Helper->update_product_status_pre_sync_data($products);
479
+ $products_sync = $p_map_attribute['products_sync'];
480
+
481
+ $ee_additional_data['product_sync_alert'] = NULL;
482
+ $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
483
+ return array('error'=> false, 'message' => esc_attr("Sync successfully"), "products" => $products, "p_map_attribute" => $p_map_attribute, 'products_sync' => $products_sync, 'skip_products' => $p_map_attribute['skip_products'] );
484
+ }else{
485
+ if(isset($response->message) && $response->message != ""){
486
+ $this->TVC_Admin_Helper->plugin_log($response->message, 'product_sync');
487
+ //$ee_additional_data['product_sync_alert'] = $response->message;
488
+ //$TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
489
+ }
490
+ return array('error'=> true, 'message' => isset($response->message)?esc_attr($response->message):"", "products" => $products, "p_map_attribute" => $p_map_attribute);
491
+ }
492
+ }else if(!empty($p_map_attribute['message'])){
493
+ return array('error'=> true, 'message' => esc_attr($p_map_attribute['message']) );
494
+ }
495
+ }
496
+ } else {
497
+ // add scheduled cron job
498
+ as_unschedule_all_actions( 'auto_product_sync_process_scheduler' );
499
+ }
500
+ } catch (Exception $e) {
501
+ $ee_additional_data['product_sync_alert'] = $e->getMessage();
502
+ $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
503
+ $this->TVC_Admin_Helper->plugin_log($e->getMessage(), 'product_sync');
504
+ }
505
+ }
506
+
507
  public function wooCommerceAttributes() {
508
  global $wpdb;
509
  $tve_table_prefix = $wpdb->prefix;
540
  <div class="col-6">
541
  <h6 class="heading-tbl gmc-image-heading"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/google-shopping.svg'); ?>" alt="google-shopping"/><?php esc_html_e("Google Merchant Center Category","enhanced-e-commerce-for-woocommerce-store"); ?></h6>
542
  </div>
543
+ </div><?php echo $this->category_wrapper_obj->category_table_content(0, 0, 'mapping'); ?>
544
  </div>
545
  </section>
546
  <!-- Step 2 -->
624
  <option value="25">25</option>
625
  <option selected="selected" value="50">50</option>
626
  <option value="100">100</option>
627
+ <option value="500">500</option>
628
  </select>
629
+ </div>
630
+ <div class="product_batch_size">
631
+ <p>We are using WooCommerce's action schedulers to make the product sync process go smoothly, Please confirm with your hosting provider to ensure CRON is activated/running and confirm that CRON is enabled on your server.</p>
632
  </div>
633
  </section>
634
  </form>
660
  $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
661
  ?>
662
  <script>
663
+ // jQuery(document).ready(function() {
664
+ // jQuery('#syncProduct .select2').each(function() {
665
+ // var $p = jQuery(this).parent();
666
+ // jQuery(this).select2({
667
+ // dropdownParent: $p
668
+ // });
669
+ // });
670
+ // });
671
 
672
  jQuery(".tab-wizard").steps({
673
  headerTag: "h5",
715
  }//check for required fields end
716
  }
717
  });
718
+
719
+ // Not in use after product sync from backend
720
+ // function submitProductSyncUp(sync_progressive_data = null){
721
+ // jQuery("#feed-spinner").css("display", "block");
722
+ // jQuery('.progress-bar-wapper').addClass('open');
723
+ // user_tracking_data('click', 'null','sync_product_page','sync_products');
724
+ // var data = {
725
+ // action:'tvcajax_product_sync_bantch_wise',
726
+ // merchant_id:'<?php echo esc_attr($this->merchantId); ?>',
727
+ // account_id:'<?php echo esc_attr($this->accountId); ?>',
728
+ // customer_id: '<?php echo esc_attr($this->currentCustomerId); ?>',
729
+ // subscription_id: '<?php echo esc_attr($this->subscriptionId); ?>',
730
+ // tvc_data: jQuery("#productSync").serialize(),
731
+ // product_batch_size: jQuery("#product_batch_size").val(),
732
+ // sync_progressive_data:sync_progressive_data
733
+ // }
734
+ // jQuery.ajax({
735
+ // type: "POST",
736
+ // dataType: "json",
737
+ // url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
738
+ // data: data,
739
+ // beforeSend: function(){
740
+ // },
741
+ // success: function(response){
742
+ // //console.log(response);
743
+ // jQuery("#feed-spinner").css("display", "none");
744
+ // if(response.status == "success"){
745
+ // //var rs = JSON.parse(response);
746
+ // let sync_produt_p = Math.round(response.sync_progressive_data.sync_produt_p);
747
+ // let total_product = response.sync_progressive_data.total_product;
748
+ // let sync_produt = response.sync_progressive_data.sync_produt;
749
+ // let sync_message = response.sync_progressive_data.sync_message;
750
+ // let sync_step = response.sync_progressive_data.sync_step;
751
+ // let is_synced_up = response.sync_progressive_data.is_synced_up;
752
+ // let last_sync_product_id = response.sync_progressive_data.last_sync_product_id;
753
+ // let skip_products = response.sync_progressive_data.last_sync_product_id;
754
+ // let tvc_sync_progress_bar_class = "tvc-sync-progress-bar";
755
+ // if(sync_step == 1){
756
+ // jQuery(".tvc-sync-progress-db").css("display","flex");
757
+ // }else if(sync_step == 2){
758
+ // jQuery(".tvc-sync-progress-db").hide();
759
+ // jQuery(".tvc-sync-progress-gmc").css("display","flex");
760
+ // tvc_sync_progress_bar_class = "tvc-sync-success-progress-bar";
761
+ // }
762
 
763
+ // jQuery("."+tvc_sync_progress_bar_class).css("width",sync_produt_p+"%");
764
+ // jQuery("."+tvc_sync_progress_bar_class).html(sync_produt_p+"%");
765
+ // jQuery("."+tvc_sync_progress_bar_class).attr("aria-valuenow",sync_produt_p);
766
+ // jQuery(".tvc-progress-info").show();
767
+ // jQuery(".tvc-sync-count").html(sync_produt);
768
+ // jQuery(".tvc-total-count").html(total_product);
769
+ // jQuery(".tvc-sync-message").html(sync_message);
770
+ // if(sync_step == 1 && is_synced_up == true){
771
+ // is_synced_up = false;
772
+ // }
773
 
774
+ // if(is_synced_up == false && sync_step <= 2){
775
+ // submitProductSyncUp(response.sync_progressive_data);
776
+ // }else if(sync_step == 2 ){
777
+ // setTimeout(function(){
778
+ // jQuery('.progress-bar-wapper').removeClass('open');
779
+ // jQuery(".tvc-sync-progress-bar").css("width","0%");
780
+ // jQuery(".tvc-sync-success-progress-bar").css("width","0%");
781
+ // jQuery(".tvc-sync-progress-bar").html("0%");
782
+ // jQuery(".tvc-sync-success-progress-bar").html("0%");
783
+ // jQuery(".tvc-sync-progress-bar").attr("aria-valuenow","0");
784
+ // jQuery(".tvc-sync-success-progress-bar").attr("aria-valuenow","0");
785
+ // jQuery(".tvc-sync-count").html("0");
786
+ // jQuery(".tvc-total-count").html("--");
787
+ // jQuery(".tvc-sync-message").html("Initialization of products data for push data in Google shopping");
788
+ // if (response.api_rs.error == false) {
789
+ // var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
790
+ // if (response.sync_progressive_data.skip_products.length > 0) {
791
+ // message = message + "\n Because of pricing issues, " + response.sync_progressive_data.skip_products.length + " products did not sync.";
792
+ // }
793
+ // tvc_helper.tvc_alert("success","",message);
794
+ // window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
795
+ // }else {
796
+ // tvc_helper.tvc_alert("error","",response.api_rs.message);
797
+ // }
798
+ // }, 2000);
799
+ // }
800
+ // }else{
801
+ // tvc_helper.tvc_alert("error","",response.message);
802
+ // setTimeout(function(){
803
+ // window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
804
+ // }, 2000);
805
+ // }
806
 
807
+ // }
808
+ // });
809
+ // }
810
+
811
+ function submitProductSyncUp(sync_progressive_data = null){
812
+ jQuery("#feed-spinner").css("display", "block");
813
+ jQuery('.progress-bar-wapper').addClass('open');
814
+ user_tracking_data('click', 'null','sync_product_page','sync_products');
815
+ var data = {
816
+ action:'tvcajax_product_sync_bantch_wise',
817
+ merchant_id:'<?php echo esc_attr($this->merchantId); ?>',
818
+ account_id:'<?php echo esc_attr($this->accountId); ?>',
819
+ customer_id: '<?php echo esc_attr($this->currentCustomerId); ?>',
820
+ subscription_id: '<?php echo esc_attr($this->subscriptionId); ?>',
821
+ tvc_data: jQuery("#productSync").find("input[value!=''], select:not(:empty), input[type='number']").serialize(),
822
+ product_batch_size: jQuery("#product_batch_size").val(),
823
+ sync_progressive_data:sync_progressive_data
824
  }
825
+ jQuery.ajax({
826
+ type: "POST",
827
+ dataType: "json",
828
+ url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
829
+ data: data,
830
+ beforeSend: function(){
831
+ },
832
+ success: function(response){
833
+ //console.log(response);
834
+ jQuery("#feed-spinner").css("display", "none");
835
+ if(response.status == "success"){
836
+ let sync_message = response.sync_progressive_data.sync_message;
837
+ let tvc_sync_progress_bar_class = "tvc-sync-progress-bar";
838
+ setTimeout(function(){
839
+ jQuery(".tvc-sync-progress-db").css("display","flex");
840
+ jQuery("."+tvc_sync_progress_bar_class).css("width",100+"%");
841
+ jQuery("."+tvc_sync_progress_bar_class).html(100+"%");
842
+ jQuery("."+tvc_sync_progress_bar_class).attr("aria-valuenow",100);
843
+ jQuery(".tvc-progress-info").show();
844
+ jQuery(".tvc-sync-count").html();
845
+ jQuery(".tvc-total-count").html();
846
+ jQuery(".tvc-sync-message").html(sync_message);
847
+ }, 1000);
848
+ setTimeout(function(){
849
+ jQuery(".tvc-sync-progress-db").hide();
850
+ jQuery('.progress-bar-wapper').removeClass('open');
851
+ jQuery(".tvc-sync-progress-bar").css("width","0%");
852
+ jQuery(".tvc-sync-success-progress-bar").css("width","0%");
853
+ jQuery(".tvc-sync-progress-bar").html("0%");
854
+ jQuery(".tvc-sync-success-progress-bar").html("0%");
855
+ jQuery(".tvc-sync-progress-bar").attr("aria-valuenow","0");
856
+ jQuery(".tvc-sync-success-progress-bar").attr("aria-valuenow","0");
857
+ jQuery(".tvc-sync-message").html("Initialization of products data for push data in Google shopping");
858
+ var message = "Your products are being synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center once the product sync gets completed. As soon as they are updated, they will be shown in the \"Product Feed\" dashboard.";
859
+ tvc_helper.tvc_alert("success","",message);
860
+ window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
861
+ }, 2000);
862
+ }else{
863
+ tvc_helper.tvc_alert("error","",response.message);
864
+ setTimeout(function(){
865
+ window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
866
+ }, 2000);
867
+ }
868
+ }
869
+ });
870
+ }
871
 
872
  jQuery(document).on("show.bs.modal", "#syncProduct", function (e) {
873
  jQuery("#feed-spinner").css("display", "block");
includes/setup/google-shopping-feed-gaa-config.php CHANGED
@@ -27,41 +27,37 @@ class GAAConfiguration {
27
 
28
  public function configuration_list_html($title, $val){
29
  $imge = (isset($val) && $val != "" && $val != 0) ? esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg') : esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png');
30
- return '<li>
31
- <div class="row">
32
- <div class="col-7 col-md-7 col-lg-9 align-self-center pr-0">
33
- <span class="text">'.esc_attr($title).'</span>
34
  </div>
35
- <div class="col-5 col-md-5 col-lg-3 text-end">
36
- <div class="list-image"><img src="'.esc_url_raw($imge).'"></div>
37
  </div>
38
- </div>
39
- </li>';
40
  }
41
 
42
  public function configuration_error_list_html($title, $val, $call_domain_claim, $googleDetail){
43
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" ){
44
- return '<li>
45
- <div class="row">
46
  <div class="col-6 col-md-6 col-lg-6">
47
- <span class="text"><b>'.esc_attr($title).'</b></span>
48
  </div>
49
  <div class="col-4 col-md-4 col-lg-4 text-right">
50
- <div class="list-image"><img id="refresh_'.esc_attr($call_domain_claim).'" onclick="'.esc_attr($call_domain_claim).'();" src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png').'"><img src="' .esc_url_raw( ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
51
  </div>
52
- </div>
53
- </li>';
54
  }else{
55
- return '<li>
56
- <div class="row">
57
- <div class="col-7 col-md-7 col-lg-7 align-self-center pr-0">
58
- <span class="text">'.esc_attr($title).'</span>
59
  </div>
60
- <div class="col-5 col-md-5 col-lg-5 align-self-center text-left">
61
- <div class="list-image"><img src="' . esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
62
  </div>
63
- </div>
64
- </li>';
65
  }
66
  }
67
 
@@ -79,11 +75,11 @@ class GAAConfiguration {
79
  </script>
80
  <?php
81
  }
82
- $category_wrapper_obj = new Tatvic_Category_Wrapper();
83
- $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
84
  $googleDetail = [];
85
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
86
- $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
87
  $product_sync_duration = isset($ee_additional_data['product_sync_duration'])?sanitize_text_field($ee_additional_data['product_sync_duration']):"";
88
  $pro_snyc_time_limit = (isset($ee_additional_data['pro_snyc_time_limit']) && $ee_additional_data['pro_snyc_time_limit'] > 0) ? sanitize_text_field($ee_additional_data['pro_snyc_time_limit']):"25";
89
  $product_sync_batch_size = (isset($ee_additional_data['product_sync_batch_size']) && $ee_additional_data['product_sync_batch_size'] > 0) ? sanitize_text_field($ee_additional_data['product_sync_batch_size']):"50";
@@ -102,10 +98,7 @@ class GAAConfiguration {
102
  $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
103
  }
104
  $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
105
- $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
106
- $products = new WP_Query($args);
107
- $woo_product = $products->found_posts;
108
- ?>
109
  <div class="tab-content">
110
  <div class="tab-pane show active" id="googleShoppingFeed">
111
  <div class="tab-card">
@@ -229,27 +222,26 @@ class GAAConfiguration {
229
  <option value="25" <?php echo esc_attr($product_sync_batch_size) == '25' ? 'selected' : ''?>>25</option>
230
  <option value="50" <?php echo esc_attr($product_sync_batch_size) == '50' ? 'selected' : ''?>>50</option>
231
  <option value="100" <?php echo esc_attr($product_sync_batch_size) == '100' ? 'selected' : ''?>>100</option>
232
-
233
  </select>
234
  </div>
235
  </div>
236
- <div class="card-body">
237
- <ul class="list-unstyled"><?php
238
- $is_domain_claim = (isset($googleDetail->is_domain_claim))?esc_attr($googleDetail->is_domain_claim):"";
239
- $is_site_verified = (isset($googleDetail->is_site_verified))?esc_attr($googleDetail->is_site_verified):"";
240
- if($is_site_verified ==1){
241
- echo $this->configuration_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"), esc_attr($is_site_verified));
242
- }else{
243
- echo $this->configuration_error_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_site_verified),"call_site_verified", $googleDetail);
244
- }
245
- if($is_domain_claim ==1){
246
- echo $this->configuration_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim));
247
- }else{
248
- echo $this->configuration_error_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim), 'call_domain_claim', $googleDetail);
249
- }
250
- ?>
251
- </ul>
252
- </div>
253
  <div class="auto_product_sync_save_button mb-3">
254
  <div class="col-12 col-md-12 col-lg-12">
255
  <button type="submit" id="auto_product_sync_save" class="auto_product_sync_save btn btn-primary btn-success" name="auto_product_sync_setting_save"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
27
 
28
  public function configuration_list_html($title, $val){
29
  $imge = (isset($val) && $val != "" && $val != 0) ? esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg') : esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png');
30
+ return '
31
+ <div class="row mb-3">
32
+ <div class="col-6 col-md-6 col-lg-6">
33
+ <h2 class="ga-title">'.esc_attr($title).'</h2>
34
  </div>
35
+ <div class="col-6 col-md-6 col-lg-6 text-right">
36
+ <div class="list-image"><img src="'.esc_url_raw($imge).'"></div>
37
  </div>
38
+ </div>';
 
39
  }
40
 
41
  public function configuration_error_list_html($title, $val, $call_domain_claim, $googleDetail){
42
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" ){
43
+ return '<div class="row mb-3">
 
44
  <div class="col-6 col-md-6 col-lg-6">
45
+ <h2 class="ga-title">'.esc_attr($title).'</h2>
46
  </div>
47
  <div class="col-4 col-md-4 col-lg-4 text-right">
48
+ <div class="list-image"><img id="refresh_'.esc_attr($call_domain_claim).'" onclick="'.esc_attr($call_domain_claim).'();" src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png').'"><img src="' .esc_url_raw( ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
49
  </div>
50
+ </div>';
 
51
  }else{
52
+ return '
53
+ <div class="row mb-3">
54
+ <div class="col-6 col-md-6 col-lg-6">
55
+ <h2 class="ga-title">'.esc_attr($title).'</h2>
56
  </div>
57
+ <div class="col-6 col-md-6 col-lg-6 text-right">
58
+ <div class="list-image"><img src="' . esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
59
  </div>
60
+ </div>';
 
61
  }
62
  }
63
 
75
  </script>
76
  <?php
77
  }
78
+ // $category_wrapper_obj = new Tatvic_Category_Wrapper();
79
+ // $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
80
  $googleDetail = [];
81
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
82
+ $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
83
  $product_sync_duration = isset($ee_additional_data['product_sync_duration'])?sanitize_text_field($ee_additional_data['product_sync_duration']):"";
84
  $pro_snyc_time_limit = (isset($ee_additional_data['pro_snyc_time_limit']) && $ee_additional_data['pro_snyc_time_limit'] > 0) ? sanitize_text_field($ee_additional_data['pro_snyc_time_limit']):"25";
85
  $product_sync_batch_size = (isset($ee_additional_data['product_sync_batch_size']) && $ee_additional_data['product_sync_batch_size'] > 0) ? sanitize_text_field($ee_additional_data['product_sync_batch_size']):"50";
98
  $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
99
  }
100
  $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
101
+ ?>
 
 
 
102
  <div class="tab-content">
103
  <div class="tab-pane show active" id="googleShoppingFeed">
104
  <div class="tab-card">
222
  <option value="25" <?php echo esc_attr($product_sync_batch_size) == '25' ? 'selected' : ''?>>25</option>
223
  <option value="50" <?php echo esc_attr($product_sync_batch_size) == '50' ? 'selected' : ''?>>50</option>
224
  <option value="100" <?php echo esc_attr($product_sync_batch_size) == '100' ? 'selected' : ''?>>100</option>
225
+ <option value="500" <?php echo esc_attr($product_sync_batch_size) == '500' ? 'selected' : ''?>>500</option>
226
  </select>
227
  </div>
228
  </div>
229
+
230
+ <?php
231
+ $is_domain_claim = (isset($googleDetail->is_domain_claim))?esc_attr($googleDetail->is_domain_claim):"";
232
+ $is_site_verified = (isset($googleDetail->is_site_verified))?esc_attr($googleDetail->is_site_verified):"";
233
+ if($is_site_verified ==1){
234
+ echo $this->configuration_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"), esc_attr($is_site_verified));
235
+ }else{
236
+ echo $this->configuration_error_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_site_verified),"call_site_verified", $googleDetail);
237
+ }
238
+ if($is_domain_claim ==1){
239
+ echo $this->configuration_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim));
240
+ }else{
241
+ echo $this->configuration_error_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim), 'call_domain_claim', $googleDetail);
242
+ }
243
+ ?>
244
+
 
245
  <div class="auto_product_sync_save_button mb-3">
246
  <div class="col-12 col-md-12 col-lg-12">
247
  <button type="submit" id="auto_product_sync_save" class="auto_product_sync_save btn btn-primary btn-success" name="auto_product_sync_setting_save"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
includes/setup/google-shopping-feed-sync-product.php CHANGED
@@ -42,7 +42,7 @@ public function create_form(){
42
  <?php
43
  }
44
 
45
- $syncProductStat = [];
46
  $syncProductList = [];
47
  $last_api_sync_up ="";
48
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
@@ -51,8 +51,9 @@ public function create_form(){
51
  $syncProductStat = $google_detail['prod_sync_status'];
52
  }
53
  }
54
-
55
- $syncProductList = $this->TVC_Admin_DB_Helper->tvc_get_results("ee_products_sync_list");
 
56
  if(isset($google_detail['setting'])){
57
  if ($google_detail['setting']) {
58
  $googleDetail = $google_detail['setting'];
@@ -67,9 +68,69 @@ public function create_form(){
67
  $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
68
  }
69
  $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
70
- $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
71
- $products = new WP_Query($args);
72
- $woo_product = $products->found_posts;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  ?>
74
 
75
  <div class="tab-content">
@@ -98,6 +159,19 @@ public function create_form(){
98
  <p class="mb-0 align-self-center product-title"><?php esc_html_e("Products in your Merchant Center account","enhanced-e-commerce-for-woocommerce-store"); ?></p>
99
  <button id="tvc_btn_product_sync" class="btn btn-outline-primary align-self-center" data-bs-toggle="modal" data-bs-target="#syncProduct"><?php esc_html_e("Sync New Products","enhanced-e-commerce-for-woocommerce-store"); ?></button>
100
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  </div>
102
  </div>
103
  <?php
@@ -268,6 +342,22 @@ function ImportGMCProduct(next_page_token = null){
268
 
269
  });
270
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  </script>
272
  <?php
273
  }
42
  <?php
43
  }
44
 
45
+ $syncProductStat = (object)[];
46
  $syncProductList = [];
47
  $last_api_sync_up ="";
48
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
51
  $syncProductStat = $google_detail['prod_sync_status'];
52
  }
53
  }
54
+ global $wpdb;
55
+ // $syncProductList = $this->TVC_Admin_DB_Helper->tvc_get_results("ee_products_sync_list");
56
+ $syncProductList = $wpdb->get_results("select * from ".$wpdb->prefix."ee_products_sync_list LIMIT 2000");
57
  if(isset($google_detail['setting'])){
58
  if ($google_detail['setting']) {
59
  $googleDetail = $google_detail['setting'];
68
  $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
69
  }
70
  $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
71
+ // $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
72
+ // $products = new WP_Query($args);
73
+ // $woo_product = $products->found_posts;
74
+ $woo_product = wp_count_posts( 'product' )->publish;
75
+
76
+ $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
77
+ // print_r($ee_additional_data );
78
+ // echo "=========";
79
+ // print_r(_get_cron_array());
80
+ $tablename = esc_sql( $wpdb->prefix ."ee_prouct_pre_sync_data" );
81
+ $total_que_products = $wpdb->get_var("SELECT COUNT(*) as a FROM $tablename");
82
+ $total_sync_products = $wpdb->get_var("SELECT COUNT(*) as a FROM $tablename where `status` = 1");
83
+ $last_update_date_obj = $wpdb->get_row("SELECT update_date FROM $tablename where `status` = 1 ORDER BY update_date DESC");
84
+ $prod_batch_response = unserialize(get_option('ee_prod_response'));
85
+ $imin = $rhr = $rsec = $rmin = $sec = $total_batch_size = $total_pending_pro = $total_batches = $total_seconds = 0;
86
+ $min = 1;
87
+ if (!empty($last_update_date_obj)) {
88
+ $last_update_date = $last_update_date_obj->update_date;
89
+ //$interval = (new DateTime($last_update_date))->diff(new DateTime());
90
+ $interval = (new DateTime($last_update_date))->diff(new DateTime(date('Y-m-d H:i:s', current_time( 'timestamp' ))));
91
+ $imin = $interval->days * 24 * 60;
92
+ $imin += $interval->h * 60;
93
+ $imin += $interval->i;
94
+ }
95
+
96
+ if (isset($prod_batch_response['time_duration'])) {
97
+ $minutes = $prod_batch_response['time_duration']->i;
98
+ $seconds = $prod_batch_response['time_duration']->s;
99
+ if ($minutes > 0) {
100
+ $total_seconds = $minutes*60;
101
+ }
102
+ if ($seconds > 0) {
103
+ $total_seconds = $total_seconds+$seconds;
104
+ }
105
+ }
106
+ if (isset($ee_additional_data['product_sync_batch_size'])) {
107
+ if ($total_que_products > 0) {
108
+ $total_batch_size = $ee_additional_data['product_sync_batch_size'];
109
+ $total_pending_pro = $total_que_products - $total_sync_products;
110
+ $total_batches = ($total_pending_pro/$total_batch_size);
111
+ }
112
+ if ($total_pending_pro == 0) {
113
+ // add scheduled cron job
114
+ as_unschedule_all_actions( 'auto_product_sync_process_scheduler' );
115
+ }
116
+ }
117
+ if ($total_batches > 0 && $total_seconds > 0) {
118
+ if ($total_seconds > 60 ) {
119
+ $sec = $total_seconds %60;
120
+ $min = floor(($total_seconds%3600)/60);
121
+ } else {
122
+ //$sec = $total_seconds;
123
+ }
124
+
125
+ $total_require_secs = ($total_batches*($total_seconds));
126
+ if ($total_require_secs > 60 ) {
127
+ $rsec = $total_require_secs %60;
128
+ $rmin = floor(($total_require_secs%3600)/60);
129
+ $rhr = floor(($total_require_secs%86400)/3600);
130
+ }
131
+ }
132
+ //$message = "Your WooCommerce products are being synced (".$total_sync_products."/".$total_que_products."). It is taking ".$min." Minutes and ".$sec." Seconds to sync [".$total_batch_size."] products. The remaining ".$total_pending_pro." products will be synced in ".$rhr." Hrs ".$rmin." Minutes and ".$rsec." Seconds.";
133
+ $message = "Your WooCommerce products are being synced (".$total_sync_products."/".$total_que_products."). It is taking ".$min." Minutes to sync [".$total_batch_size."] products. The remaining ".$total_pending_pro." products will be synced in ".$rhr." Hrs ".$rmin." Minutes";
134
  ?>
135
 
136
  <div class="tab-content">
159
  <p class="mb-0 align-self-center product-title"><?php esc_html_e("Products in your Merchant Center account","enhanced-e-commerce-for-woocommerce-store"); ?></p>
160
  <button id="tvc_btn_product_sync" class="btn btn-outline-primary align-self-center" data-bs-toggle="modal" data-bs-target="#syncProduct"><?php esc_html_e("Sync New Products","enhanced-e-commerce-for-woocommerce-store"); ?></button>
161
  </div>
162
+ <?php
163
+ if (!empty($ee_additional_data) && isset($ee_additional_data['product_sync_alert']) && !empty($ee_additional_data['product_sync_alert'])) {
164
+ echo "<p style='color:#2D62ED'>".esc_attr($ee_additional_data['product_sync_alert'])."</p>";
165
+ }
166
+ if (!empty($ee_additional_data) && isset($ee_additional_data['is_process_start']) && ($ee_additional_data['is_process_start'] == true) && $total_seconds > 0) {
167
+ ?>
168
+ <p style='color:#2D62ED'><?php echo esc_attr($message,"enhanced-e-commerce-for-woocommerce-store"); ?></p>
169
+ <?php
170
+ if ($imin > 30) {
171
+ echo "<p style='color:red'>It seems like product sync failed, please try again <button id='tvc_btn_retry_sync' class='btn btn-outline-primary align-self-center'>Retry</button></p>";
172
+ }
173
+ }
174
+ ?>
175
  </div>
176
  </div>
177
  <?php
342
 
343
  });
344
  }
345
+
346
+ jQuery(document).on("click", "#tvc_btn_retry_sync", function(event){
347
+ reTrySycnProcess();
348
+ });
349
+ function reTrySycnProcess(){
350
+ jQuery("#feed-spinner").css("display", "block");
351
+ jQuery.post(tvc_ajax_url,{
352
+ action: "auto_product_sync_process_scheduler",
353
+ dataType: "json",
354
+ },function( response ){
355
+ var rsp = JSON.parse(response);
356
+ jQuery("#feed-spinner").css("display", "none");
357
+ tvc_helper.tvc_alert("success","",rsp.message);
358
+ window.location.replace("<?php echo esc_url_raw($this->site_url.'sync_product_page'); ?>");
359
+ });
360
+ }
361
  </script>
362
  <?php
363
  }
includes/setup/plugins/datepicker/jquery-ui.css ADDED
@@ -0,0 +1,1311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.12.1 - 2016-09-14
2
+ * http://jqueryui.com
3
+ * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-zfix {
42
+ width: 100%;
43
+ height: 100%;
44
+ top: 0;
45
+ left: 0;
46
+ position: absolute;
47
+ opacity: 0;
48
+ filter:Alpha(Opacity=0); /* support: IE8 */
49
+ }
50
+
51
+ .ui-front {
52
+ z-index: 100;
53
+ }
54
+
55
+
56
+ /* Interaction Cues
57
+ ----------------------------------*/
58
+ .ui-state-disabled {
59
+ cursor: default !important;
60
+ pointer-events: none;
61
+ }
62
+
63
+
64
+ /* Icons
65
+ ----------------------------------*/
66
+ .ui-icon {
67
+ display: inline-block;
68
+ vertical-align: middle;
69
+ margin-top: -.25em;
70
+ position: relative;
71
+ text-indent: -99999px;
72
+ overflow: hidden;
73
+ background-repeat: no-repeat;
74
+ }
75
+
76
+ .ui-widget-icon-block {
77
+ left: 50%;
78
+ margin-left: -8px;
79
+ display: block;
80
+ }
81
+
82
+ /* Misc visuals
83
+ ----------------------------------*/
84
+
85
+ /* Overlays */
86
+ .ui-widget-overlay {
87
+ position: fixed;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ }
93
+ .ui-accordion .ui-accordion-header {
94
+ display: block;
95
+ cursor: pointer;
96
+ position: relative;
97
+ margin: 2px 0 0 0;
98
+ padding: .5em .5em .5em .7em;
99
+ font-size: 100%;
100
+ }
101
+ .ui-accordion .ui-accordion-content {
102
+ padding: 1em 2.2em;
103
+ border-top: 0;
104
+ overflow: auto;
105
+ }
106
+ .ui-autocomplete {
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ cursor: default;
111
+ }
112
+ .ui-menu {
113
+ list-style: none;
114
+ padding: 0;
115
+ margin: 0;
116
+ display: block;
117
+ outline: 0;
118
+ }
119
+ .ui-menu .ui-menu {
120
+ position: absolute;
121
+ }
122
+ .ui-menu .ui-menu-item {
123
+ margin: 0;
124
+ cursor: pointer;
125
+ /* support: IE10, see #8844 */
126
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
127
+ }
128
+ .ui-menu .ui-menu-item-wrapper {
129
+ position: relative;
130
+ padding: 3px 1em 3px .4em;
131
+ }
132
+ .ui-menu .ui-menu-divider {
133
+ margin: 5px 0;
134
+ height: 0;
135
+ font-size: 0;
136
+ line-height: 0;
137
+ border-width: 1px 0 0 0;
138
+ }
139
+ .ui-menu .ui-state-focus,
140
+ .ui-menu .ui-state-active {
141
+ margin: -1px;
142
+ }
143
+
144
+ /* icon support */
145
+ .ui-menu-icons {
146
+ position: relative;
147
+ }
148
+ .ui-menu-icons .ui-menu-item-wrapper {
149
+ padding-left: 2em;
150
+ }
151
+
152
+ /* left-aligned */
153
+ .ui-menu .ui-icon {
154
+ position: absolute;
155
+ top: 0;
156
+ bottom: 0;
157
+ left: .2em;
158
+ margin: auto 0;
159
+ }
160
+
161
+ /* right-aligned */
162
+ .ui-menu .ui-menu-icon {
163
+ left: auto;
164
+ right: 0;
165
+ }
166
+ .ui-button {
167
+ padding: .4em 1em;
168
+ display: inline-block;
169
+ position: relative;
170
+ line-height: normal;
171
+ margin-right: .1em;
172
+ cursor: pointer;
173
+ vertical-align: middle;
174
+ text-align: center;
175
+ -webkit-user-select: none;
176
+ -moz-user-select: none;
177
+ -ms-user-select: none;
178
+ user-select: none;
179
+
180
+ /* Support: IE <= 11 */
181
+ overflow: visible;
182
+ }
183
+
184
+ .ui-button,
185
+ .ui-button:link,
186
+ .ui-button:visited,
187
+ .ui-button:hover,
188
+ .ui-button:active {
189
+ text-decoration: none;
190
+ }
191
+
192
+ /* to make room for the icon, a width needs to be set here */
193
+ .ui-button-icon-only {
194
+ width: 2em;
195
+ box-sizing: border-box;
196
+ text-indent: -9999px;
197
+ white-space: nowrap;
198
+ }
199
+
200
+ /* no icon support for input elements */
201
+ input.ui-button.ui-button-icon-only {
202
+ text-indent: 0;
203
+ }
204
+
205
+ /* button icon element(s) */
206
+ .ui-button-icon-only .ui-icon {
207
+ position: absolute;
208
+ top: 50%;
209
+ left: 50%;
210
+ margin-top: -8px;
211
+ margin-left: -8px;
212
+ }
213
+
214
+ .ui-button.ui-icon-notext .ui-icon {
215
+ padding: 0;
216
+ width: 2.1em;
217
+ height: 2.1em;
218
+ text-indent: -9999px;
219
+ white-space: nowrap;
220
+
221
+ }
222
+
223
+ input.ui-button.ui-icon-notext .ui-icon {
224
+ width: auto;
225
+ height: auto;
226
+ text-indent: 0;
227
+ white-space: normal;
228
+ padding: .4em 1em;
229
+ }
230
+
231
+ /* workarounds */
232
+ /* Support: Firefox 5 - 40 */
233
+ input.ui-button::-moz-focus-inner,
234
+ button.ui-button::-moz-focus-inner {
235
+ border: 0;
236
+ padding: 0;
237
+ }
238
+ .ui-controlgroup {
239
+ vertical-align: middle;
240
+ display: inline-block;
241
+ }
242
+ .ui-controlgroup > .ui-controlgroup-item {
243
+ float: left;
244
+ margin-left: 0;
245
+ margin-right: 0;
246
+ }
247
+ .ui-controlgroup > .ui-controlgroup-item:focus,
248
+ .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
249
+ z-index: 9999;
250
+ }
251
+ .ui-controlgroup-vertical > .ui-controlgroup-item {
252
+ display: block;
253
+ float: none;
254
+ width: 100%;
255
+ margin-top: 0;
256
+ margin-bottom: 0;
257
+ text-align: left;
258
+ }
259
+ .ui-controlgroup-vertical .ui-controlgroup-item {
260
+ box-sizing: border-box;
261
+ }
262
+ .ui-controlgroup .ui-controlgroup-label {
263
+ padding: .4em 1em;
264
+ }
265
+ .ui-controlgroup .ui-controlgroup-label span {
266
+ font-size: 80%;
267
+ }
268
+ .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
269
+ border-left: none;
270
+ }
271
+ .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
272
+ border-top: none;
273
+ }
274
+ .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
275
+ border-right: none;
276
+ }
277
+ .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
278
+ border-bottom: none;
279
+ }
280
+
281
+ /* Spinner specific style fixes */
282
+ .ui-controlgroup-vertical .ui-spinner-input {
283
+
284
+ /* Support: IE8 only, Android < 4.4 only */
285
+ width: 75%;
286
+ width: calc( 100% - 2.4em );
287
+ }
288
+ .ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
289
+ border-top-style: solid;
290
+ }
291
+
292
+ .ui-checkboxradio-label .ui-icon-background {
293
+ box-shadow: inset 1px 1px 1px #ccc;
294
+ border-radius: .12em;
295
+ border: none;
296
+ }
297
+ .ui-checkboxradio-radio-label .ui-icon-background {
298
+ width: 16px;
299
+ height: 16px;
300
+ border-radius: 1em;
301
+ overflow: visible;
302
+ border: none;
303
+ }
304
+ .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
305
+ .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
306
+ background-image: none;
307
+ width: 8px;
308
+ height: 8px;
309
+ border-width: 4px;
310
+ border-style: solid;
311
+ }
312
+ .ui-checkboxradio-disabled {
313
+ pointer-events: none;
314
+ }
315
+ .ui-datepicker {
316
+ width: 17em;
317
+ padding: .2em .2em 0;
318
+ display: none;
319
+ }
320
+ .ui-datepicker .ui-datepicker-header {
321
+ position: relative;
322
+ padding: .2em 0;
323
+ }
324
+ .ui-datepicker .ui-datepicker-prev,
325
+ .ui-datepicker .ui-datepicker-next {
326
+ position: absolute;
327
+ top: 2px;
328
+ width: 1.8em;
329
+ height: 1.8em;
330
+ }
331
+ .ui-datepicker .ui-datepicker-prev-hover,
332
+ .ui-datepicker .ui-datepicker-next-hover {
333
+ top: 1px;
334
+ }
335
+ .ui-datepicker .ui-datepicker-prev {
336
+ left: 2px;
337
+ }
338
+ .ui-datepicker .ui-datepicker-next {
339
+ right: 2px;
340
+ }
341
+ .ui-datepicker .ui-datepicker-prev-hover {
342
+ left: 1px;
343
+ }
344
+ .ui-datepicker .ui-datepicker-next-hover {
345
+ right: 1px;
346
+ }
347
+ .ui-datepicker .ui-datepicker-prev span,
348
+ .ui-datepicker .ui-datepicker-next span {
349
+ display: block;
350
+ position: absolute;
351
+ left: 50%;
352
+ margin-left: -8px;
353
+ top: 50%;
354
+ margin-top: -8px;
355
+ }
356
+ .ui-datepicker .ui-datepicker-title {
357
+ margin: 0 2.3em;
358
+ line-height: 1.8em;
359
+ text-align: center;
360
+ }
361
+ .ui-datepicker .ui-datepicker-title select {
362
+ font-size: 1em;
363
+ margin: 1px 0;
364
+ }
365
+ .ui-datepicker select.ui-datepicker-month,
366
+ .ui-datepicker select.ui-datepicker-year {
367
+ width: 45%;
368
+ }
369
+ .ui-datepicker table {
370
+ width: 100%;
371
+ font-size: .9em;
372
+ border-collapse: collapse;
373
+ margin: 0 0 .4em;
374
+ }
375
+ .ui-datepicker th {
376
+ padding: .7em .3em;
377
+ text-align: center;
378
+ font-weight: bold;
379
+ border: 0;
380
+ }
381
+ .ui-datepicker td {
382
+ border: 0;
383
+ padding: 1px;
384
+ }
385
+ .ui-datepicker td span,
386
+ .ui-datepicker td a {
387
+ display: block;
388
+ padding: .2em;
389
+ text-align: right;
390
+ text-decoration: none;
391
+ }
392
+ .ui-datepicker .ui-datepicker-buttonpane {
393
+ background-image: none;
394
+ margin: .7em 0 0 0;
395
+ padding: 0 .2em;
396
+ border-left: 0;
397
+ border-right: 0;
398
+ border-bottom: 0;
399
+ }
400
+ .ui-datepicker .ui-datepicker-buttonpane button {
401
+ float: right;
402
+ margin: .5em .2em .4em;
403
+ cursor: pointer;
404
+ padding: .2em .6em .3em .6em;
405
+ width: auto;
406
+ overflow: visible;
407
+ }
408
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
409
+ float: left;
410
+ }
411
+
412
+ /* with multiple calendars */
413
+ .ui-datepicker.ui-datepicker-multi {
414
+ width: auto;
415
+ }
416
+ .ui-datepicker-multi .ui-datepicker-group {
417
+ float: left;
418
+ }
419
+ .ui-datepicker-multi .ui-datepicker-group table {
420
+ width: 95%;
421
+ margin: 0 auto .4em;
422
+ }
423
+ .ui-datepicker-multi-2 .ui-datepicker-group {
424
+ width: 50%;
425
+ }
426
+ .ui-datepicker-multi-3 .ui-datepicker-group {
427
+ width: 33.3%;
428
+ }
429
+ .ui-datepicker-multi-4 .ui-datepicker-group {
430
+ width: 25%;
431
+ }
432
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
433
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
434
+ border-left-width: 0;
435
+ }
436
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
437
+ clear: left;
438
+ }
439
+ .ui-datepicker-row-break {
440
+ clear: both;
441
+ width: 100%;
442
+ font-size: 0;
443
+ }
444
+
445
+ /* RTL support */
446
+ .ui-datepicker-rtl {
447
+ direction: rtl;
448
+ }
449
+ .ui-datepicker-rtl .ui-datepicker-prev {
450
+ right: 2px;
451
+ left: auto;
452
+ }
453
+ .ui-datepicker-rtl .ui-datepicker-next {
454
+ left: 2px;
455
+ right: auto;
456
+ }
457
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
458
+ right: 1px;
459
+ left: auto;
460
+ }
461
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
462
+ left: 1px;
463
+ right: auto;
464
+ }
465
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
466
+ clear: right;
467
+ }
468
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
469
+ float: left;
470
+ }
471
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
472
+ .ui-datepicker-rtl .ui-datepicker-group {
473
+ float: right;
474
+ }
475
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
476
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
477
+ border-right-width: 0;
478
+ border-left-width: 1px;
479
+ }
480
+
481
+ /* Icons */
482
+ .ui-datepicker .ui-icon {
483
+ display: block;
484
+ text-indent: -99999px;
485
+ overflow: hidden;
486
+ background-repeat: no-repeat;
487
+ left: .5em;
488
+ top: .3em;
489
+ }
490
+ .ui-dialog {
491
+ position: absolute;
492
+ top: 0;
493
+ left: 0;
494
+ padding: .2em;
495
+ outline: 0;
496
+ }
497
+ .ui-dialog .ui-dialog-titlebar {
498
+ padding: .4em 1em;
499
+ position: relative;
500
+ }
501
+ .ui-dialog .ui-dialog-title {
502
+ float: left;
503
+ margin: .1em 0;
504
+ white-space: nowrap;
505
+ width: 90%;
506
+ overflow: hidden;
507
+ text-overflow: ellipsis;
508
+ }
509
+ .ui-dialog .ui-dialog-titlebar-close {
510
+ position: absolute;
511
+ right: .3em;
512
+ top: 50%;
513
+ width: 20px;
514
+ margin: -10px 0 0 0;
515
+ padding: 1px;
516
+ height: 20px;
517
+ }
518
+ .ui-dialog .ui-dialog-content {
519
+ position: relative;
520
+ border: 0;
521
+ padding: .5em 1em;
522
+ background: none;
523
+ overflow: auto;
524
+ }
525
+ .ui-dialog .ui-dialog-buttonpane {
526
+ text-align: left;
527
+ border-width: 1px 0 0 0;
528
+ background-image: none;
529
+ margin-top: .5em;
530
+ padding: .3em 1em .5em .4em;
531
+ }
532
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
533
+ float: right;
534
+ }
535
+ .ui-dialog .ui-dialog-buttonpane button {
536
+ margin: .5em .4em .5em 0;
537
+ cursor: pointer;
538
+ }
539
+ .ui-dialog .ui-resizable-n {
540
+ height: 2px;
541
+ top: 0;
542
+ }
543
+ .ui-dialog .ui-resizable-e {
544
+ width: 2px;
545
+ right: 0;
546
+ }
547
+ .ui-dialog .ui-resizable-s {
548
+ height: 2px;
549
+ bottom: 0;
550
+ }
551
+ .ui-dialog .ui-resizable-w {
552
+ width: 2px;
553
+ left: 0;
554
+ }
555
+ .ui-dialog .ui-resizable-se,
556
+ .ui-dialog .ui-resizable-sw,
557
+ .ui-dialog .ui-resizable-ne,
558
+ .ui-dialog .ui-resizable-nw {
559
+ width: 7px;
560
+ height: 7px;
561
+ }
562
+ .ui-dialog .ui-resizable-se {
563
+ right: 0;
564
+ bottom: 0;
565
+ }
566
+ .ui-dialog .ui-resizable-sw {
567
+ left: 0;
568
+ bottom: 0;
569
+ }
570
+ .ui-dialog .ui-resizable-ne {
571
+ right: 0;
572
+ top: 0;
573
+ }
574
+ .ui-dialog .ui-resizable-nw {
575
+ left: 0;
576
+ top: 0;
577
+ }
578
+ .ui-draggable .ui-dialog-titlebar {
579
+ cursor: move;
580
+ }
581
+ .ui-draggable-handle {
582
+ -ms-touch-action: none;
583
+ touch-action: none;
584
+ }
585
+ .ui-resizable {
586
+ position: relative;
587
+ }
588
+ .ui-resizable-handle {
589
+ position: absolute;
590
+ font-size: 0.1px;
591
+ display: block;
592
+ -ms-touch-action: none;
593
+ touch-action: none;
594
+ }
595
+ .ui-resizable-disabled .ui-resizable-handle,
596
+ .ui-resizable-autohide .ui-resizable-handle {
597
+ display: none;
598
+ }
599
+ .ui-resizable-n {
600
+ cursor: n-resize;
601
+ height: 7px;
602
+ width: 100%;
603
+ top: -5px;
604
+ left: 0;
605
+ }
606
+ .ui-resizable-s {
607
+ cursor: s-resize;
608
+ height: 7px;
609
+ width: 100%;
610
+ bottom: -5px;
611
+ left: 0;
612
+ }
613
+ .ui-resizable-e {
614
+ cursor: e-resize;
615
+ width: 7px;
616
+ right: -5px;
617
+ top: 0;
618
+ height: 100%;
619
+ }
620
+ .ui-resizable-w {
621
+ cursor: w-resize;
622
+ width: 7px;
623
+ left: -5px;
624
+ top: 0;
625
+ height: 100%;
626
+ }
627
+ .ui-resizable-se {
628
+ cursor: se-resize;
629
+ width: 12px;
630
+ height: 12px;
631
+ right: 1px;
632
+ bottom: 1px;
633
+ }
634
+ .ui-resizable-sw {
635
+ cursor: sw-resize;
636
+ width: 9px;
637
+ height: 9px;
638
+ left: -5px;
639
+ bottom: -5px;
640
+ }
641
+ .ui-resizable-nw {
642
+ cursor: nw-resize;
643
+ width: 9px;
644
+ height: 9px;
645
+ left: -5px;
646
+ top: -5px;
647
+ }
648
+ .ui-resizable-ne {
649
+ cursor: ne-resize;
650
+ width: 9px;
651
+ height: 9px;
652
+ right: -5px;
653
+ top: -5px;
654
+ }
655
+ .ui-progressbar {
656
+ height: 2em;
657
+ text-align: left;
658
+ overflow: hidden;
659
+ }
660
+ .ui-progressbar .ui-progressbar-value {
661
+ margin: -1px;
662
+ height: 100%;
663
+ }
664
+ .ui-progressbar .ui-progressbar-overlay {
665
+ background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
666
+ height: 100%;
667
+ filter: alpha(opacity=25); /* support: IE8 */
668
+ opacity: 0.25;
669
+ }
670
+ .ui-progressbar-indeterminate .ui-progressbar-value {
671
+ background-image: none;
672
+ }
673
+ .ui-selectable {
674
+ -ms-touch-action: none;
675
+ touch-action: none;
676
+ }
677
+ .ui-selectable-helper {
678
+ position: absolute;
679
+ z-index: 100;
680
+ border: 1px dotted black;
681
+ }
682
+ .ui-selectmenu-menu {
683
+ padding: 0;
684
+ margin: 0;
685
+ position: absolute;
686
+ top: 0;
687
+ left: 0;
688
+ display: none;
689
+ }
690
+ .ui-selectmenu-menu .ui-menu {
691
+ overflow: auto;
692
+ overflow-x: hidden;
693
+ padding-bottom: 1px;
694
+ }
695
+ .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
696
+ font-size: 1em;
697
+ font-weight: bold;
698
+ line-height: 1.5;
699
+ padding: 2px 0.4em;
700
+ margin: 0.5em 0 0 0;
701
+ height: auto;
702
+ border: 0;
703
+ }
704
+ .ui-selectmenu-open {
705
+ display: block;
706
+ }
707
+ .ui-selectmenu-text {
708
+ display: block;
709
+ margin-right: 20px;
710
+ overflow: hidden;
711
+ text-overflow: ellipsis;
712
+ }
713
+ .ui-selectmenu-button.ui-button {
714
+ text-align: left;
715
+ white-space: nowrap;
716
+ width: 14em;
717
+ }
718
+ .ui-selectmenu-icon.ui-icon {
719
+ float: right;
720
+ margin-top: 0;
721
+ }
722
+ .ui-slider {
723
+ position: relative;
724
+ text-align: left;
725
+ }
726
+ .ui-slider .ui-slider-handle {
727
+ position: absolute;
728
+ z-index: 2;
729
+ width: 1.2em;
730
+ height: 1.2em;
731
+ cursor: default;
732
+ -ms-touch-action: none;
733
+ touch-action: none;
734
+ }
735
+ .ui-slider .ui-slider-range {
736
+ position: absolute;
737
+ z-index: 1;
738
+ font-size: .7em;
739
+ display: block;
740
+ border: 0;
741
+ background-position: 0 0;
742
+ }
743
+
744
+ /* support: IE8 - See #6727 */
745
+ .ui-slider.ui-state-disabled .ui-slider-handle,
746
+ .ui-slider.ui-state-disabled .ui-slider-range {
747
+ filter: inherit;
748
+ }
749
+
750
+ .ui-slider-horizontal {
751
+ height: .8em;
752
+ }
753
+ .ui-slider-horizontal .ui-slider-handle {
754
+ top: -.3em;
755
+ margin-left: -.6em;
756
+ }
757
+ .ui-slider-horizontal .ui-slider-range {
758
+ top: 0;
759
+ height: 100%;
760
+ }
761
+ .ui-slider-horizontal .ui-slider-range-min {
762
+ left: 0;
763
+ }
764
+ .ui-slider-horizontal .ui-slider-range-max {
765
+ right: 0;
766
+ }
767
+
768
+ .ui-slider-vertical {
769
+ width: .8em;
770
+ height: 100px;
771
+ }
772
+ .ui-slider-vertical .ui-slider-handle {
773
+ left: -.3em;
774
+ margin-left: 0;
775
+ margin-bottom: -.6em;
776
+ }
777
+ .ui-slider-vertical .ui-slider-range {
778
+ left: 0;
779
+ width: 100%;
780
+ }
781
+ .ui-slider-vertical .ui-slider-range-min {
782
+ bottom: 0;
783
+ }
784
+ .ui-slider-vertical .ui-slider-range-max {
785
+ top: 0;
786
+ }
787
+ .ui-sortable-handle {
788
+ -ms-touch-action: none;
789
+ touch-action: none;
790
+ }
791
+ .ui-spinner {
792
+ position: relative;
793
+ display: inline-block;
794
+ overflow: hidden;
795
+ padding: 0;
796
+ vertical-align: middle;
797
+ }
798
+ .ui-spinner-input {
799
+ border: none;
800
+ background: none;
801
+ color: inherit;
802
+ padding: .222em 0;
803
+ margin: .2em 0;
804
+ vertical-align: middle;
805
+ margin-left: .4em;
806
+ margin-right: 2em;
807
+ }
808
+ .ui-spinner-button {
809
+ width: 1.6em;
810
+ height: 50%;
811
+ font-size: .5em;
812
+ padding: 0;
813
+ margin: 0;
814
+ text-align: center;
815
+ position: absolute;
816
+ cursor: default;
817
+ display: block;
818
+ overflow: hidden;
819
+ right: 0;
820
+ }
821
+ /* more specificity required here to override default borders */
822
+ .ui-spinner a.ui-spinner-button {
823
+ border-top-style: none;
824
+ border-bottom-style: none;
825
+ border-right-style: none;
826
+ }
827
+ .ui-spinner-up {
828
+ top: 0;
829
+ }
830
+ .ui-spinner-down {
831
+ bottom: 0;
832
+ }
833
+ .ui-tabs {
834
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
835
+ padding: .2em;
836
+ }
837
+ .ui-tabs .ui-tabs-nav {
838
+ margin: 0;
839
+ padding: .2em .2em 0;
840
+ }
841
+ .ui-tabs .ui-tabs-nav li {
842
+ list-style: none;
843
+ float: left;
844
+ position: relative;
845
+ top: 0;
846
+ margin: 1px .2em 0 0;
847
+ border-bottom-width: 0;
848
+ padding: 0;
849
+ white-space: nowrap;
850
+ }
851
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
852
+ float: left;
853
+ padding: .5em 1em;
854
+ text-decoration: none;
855
+ }
856
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
857
+ margin-bottom: -1px;
858
+ padding-bottom: 1px;
859
+ }
860
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
861
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
862
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
863
+ cursor: text;
864
+ }
865
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
866
+ cursor: pointer;
867
+ }
868
+ .ui-tabs .ui-tabs-panel {
869
+ display: block;
870
+ border-width: 0;
871
+ padding: 1em 1.4em;
872
+ background: none;
873
+ }
874
+ .ui-tooltip {
875
+ padding: 8px;
876
+ position: absolute;
877
+ z-index: 9999;
878
+ max-width: 300px;
879
+ }
880
+ body .ui-tooltip {
881
+ border-width: 2px;
882
+ }
883
+ /* Component containers
884
+ ----------------------------------*/
885
+ .ui-widget {
886
+ font-family: Verdana,Arial,sans-serif;
887
+ font-size: 1.1em;
888
+ }
889
+ .ui-widget .ui-widget {
890
+ font-size: 1em;
891
+ }
892
+ .ui-widget input,
893
+ .ui-widget select,
894
+ .ui-widget textarea,
895
+ .ui-widget button {
896
+ font-family: Verdana,Arial,sans-serif;
897
+ font-size: 1em;
898
+ }
899
+ .ui-widget.ui-widget-content {
900
+ border: 1px solid #d3d3d3;
901
+ }
902
+ .ui-widget-content {
903
+ border: 1px solid #aaaaaa;
904
+ background: #ffffff;
905
+ color: #222222;
906
+ }
907
+ .ui-widget-content a {
908
+ color: #222222;
909
+ }
910
+ .ui-widget-header {
911
+ border: 1px solid #aaaaaa;
912
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
913
+ color: #222222;
914
+ font-weight: bold;
915
+ }
916
+ .ui-widget-header a {
917
+ color: #222222;
918
+ }
919
+
920
+ /* Interaction states
921
+ ----------------------------------*/
922
+ .ui-state-default,
923
+ .ui-widget-content .ui-state-default,
924
+ .ui-widget-header .ui-state-default,
925
+ .ui-button,
926
+
927
+ /* We use html here because we need a greater specificity to make sure disabled
928
+ works properly when clicked or hovered */
929
+ html .ui-button.ui-state-disabled:hover,
930
+ html .ui-button.ui-state-disabled:active {
931
+ border: 1px solid #d3d3d3;
932
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
933
+ font-weight: normal;
934
+ color: #555555;
935
+ }
936
+ .ui-state-default a,
937
+ .ui-state-default a:link,
938
+ .ui-state-default a:visited,
939
+ a.ui-button,
940
+ a:link.ui-button,
941
+ a:visited.ui-button,
942
+ .ui-button {
943
+ color: #555555;
944
+ text-decoration: none;
945
+ }
946
+ .ui-state-hover,
947
+ .ui-widget-content .ui-state-hover,
948
+ .ui-widget-header .ui-state-hover,
949
+ .ui-state-focus,
950
+ .ui-widget-content .ui-state-focus,
951
+ .ui-widget-header .ui-state-focus,
952
+ .ui-button:hover,
953
+ .ui-button:focus {
954
+ border: 1px solid #999999;
955
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
956
+ font-weight: normal;
957
+ color: #212121;
958
+ }
959
+ .ui-state-hover a,
960
+ .ui-state-hover a:hover,
961
+ .ui-state-hover a:link,
962
+ .ui-state-hover a:visited,
963
+ .ui-state-focus a,
964
+ .ui-state-focus a:hover,
965
+ .ui-state-focus a:link,
966
+ .ui-state-focus a:visited,
967
+ a.ui-button:hover,
968
+ a.ui-button:focus {
969
+ color: #212121;
970
+ text-decoration: none;
971
+ }
972
+
973
+ .ui-visual-focus {
974
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
975
+ }
976
+ .ui-state-active,
977
+ .ui-widget-content .ui-state-active,
978
+ .ui-widget-header .ui-state-active,
979
+ a.ui-button:active,
980
+ .ui-button:active,
981
+ .ui-button.ui-state-active:hover {
982
+ border: 1px solid #aaaaaa;
983
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
984
+ font-weight: normal;
985
+ color: #212121;
986
+ }
987
+ .ui-icon-background,
988
+ .ui-state-active .ui-icon-background {
989
+ border: #aaaaaa;
990
+ background-color: #212121;
991
+ }
992
+ .ui-state-active a,
993
+ .ui-state-active a:link,
994
+ .ui-state-active a:visited {
995
+ color: #212121;
996
+ text-decoration: none;
997
+ }
998
+
999
+ /* Interaction Cues
1000
+ ----------------------------------*/
1001
+ .ui-state-highlight,
1002
+ .ui-widget-content .ui-state-highlight,
1003
+ .ui-widget-header .ui-state-highlight {
1004
+ border: 1px solid #fcefa1;
1005
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
1006
+ color: #363636;
1007
+ }
1008
+ .ui-state-checked {
1009
+ border: 1px solid #fcefa1;
1010
+ background: #fbf9ee;
1011
+ }
1012
+ .ui-state-highlight a,
1013
+ .ui-widget-content .ui-state-highlight a,
1014
+ .ui-widget-header .ui-state-highlight a {
1015
+ color: #363636;
1016
+ }
1017
+ .ui-state-error,
1018
+ .ui-widget-content .ui-state-error,
1019
+ .ui-widget-header .ui-state-error {
1020
+ border: 1px solid #cd0a0a;
1021
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
1022
+ color: #cd0a0a;
1023
+ }
1024
+ .ui-state-error a,
1025
+ .ui-widget-content .ui-state-error a,
1026
+ .ui-widget-header .ui-state-error a {
1027
+ color: #cd0a0a;
1028
+ }
1029
+ .ui-state-error-text,
1030
+ .ui-widget-content .ui-state-error-text,
1031
+ .ui-widget-header .ui-state-error-text {
1032
+ color: #cd0a0a;
1033
+ }
1034
+ .ui-priority-primary,
1035
+ .ui-widget-content .ui-priority-primary,
1036
+ .ui-widget-header .ui-priority-primary {
1037
+ font-weight: bold;
1038
+ }
1039
+ .ui-priority-secondary,
1040
+ .ui-widget-content .ui-priority-secondary,
1041
+ .ui-widget-header .ui-priority-secondary {
1042
+ opacity: .7;
1043
+ filter:Alpha(Opacity=70); /* support: IE8 */
1044
+ font-weight: normal;
1045
+ }
1046
+ .ui-state-disabled,
1047
+ .ui-widget-content .ui-state-disabled,
1048
+ .ui-widget-header .ui-state-disabled {
1049
+ opacity: .35;
1050
+ filter:Alpha(Opacity=35); /* support: IE8 */
1051
+ background-image: none;
1052
+ }
1053
+ .ui-state-disabled .ui-icon {
1054
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
1055
+ }
1056
+
1057
+ /* Icons
1058
+ ----------------------------------*/
1059
+
1060
+ /* states and images */
1061
+ .ui-icon {
1062
+ width: 16px;
1063
+ height: 16px;
1064
+ }
1065
+ .ui-icon,
1066
+ .ui-widget-content .ui-icon {
1067
+ background-image: url("images/ui-icons_222222_256x240.png");
1068
+ }
1069
+ .ui-widget-header .ui-icon {
1070
+ background-image: url("images/ui-icons_222222_256x240.png");
1071
+ }
1072
+ .ui-state-hover .ui-icon,
1073
+ .ui-state-focus .ui-icon,
1074
+ .ui-button:hover .ui-icon,
1075
+ .ui-button:focus .ui-icon {
1076
+ background-image: url("images/ui-icons_454545_256x240.png");
1077
+ }
1078
+ .ui-state-active .ui-icon,
1079
+ .ui-button:active .ui-icon {
1080
+ background-image: url("images/ui-icons_454545_256x240.png");
1081
+ }
1082
+ .ui-state-highlight .ui-icon,
1083
+ .ui-button .ui-state-highlight.ui-icon {
1084
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
1085
+ }
1086
+ .ui-state-error .ui-icon,
1087
+ .ui-state-error-text .ui-icon {
1088
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
1089
+ }
1090
+ .ui-button .ui-icon {
1091
+ background-image: url("images/ui-icons_888888_256x240.png");
1092
+ }
1093
+
1094
+ /* positioning */
1095
+ .ui-icon-blank { background-position: 16px 16px; }
1096
+ .ui-icon-caret-1-n { background-position: 0 0; }
1097
+ .ui-icon-caret-1-ne { background-position: -16px 0; }
1098
+ .ui-icon-caret-1-e { background-position: -32px 0; }
1099
+ .ui-icon-caret-1-se { background-position: -48px 0; }
1100
+ .ui-icon-caret-1-s { background-position: -65px 0; }
1101
+ .ui-icon-caret-1-sw { background-position: -80px 0; }
1102
+ .ui-icon-caret-1-w { background-position: -96px 0; }
1103
+ .ui-icon-caret-1-nw { background-position: -112px 0; }
1104
+ .ui-icon-caret-2-n-s { background-position: -128px 0; }
1105
+ .ui-icon-caret-2-e-w { background-position: -144px 0; }
1106
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
1107
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1108
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
1109
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
1110
+ .ui-icon-triangle-1-s { background-position: -65px -16px; }
1111
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1112
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
1113
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1114
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1115
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1116
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
1117
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1118
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
1119
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
1120
+ .ui-icon-arrow-1-s { background-position: -65px -32px; }
1121
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1122
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
1123
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1124
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1125
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1126
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1127
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1128
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1129
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1130
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1131
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1132
+ .ui-icon-arrowthick-1-n { background-position: 1px -48px; }
1133
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1134
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1135
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1136
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1137
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1138
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1139
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1140
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1141
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1142
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1143
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1144
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1145
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1146
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1147
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1148
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1149
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1150
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1151
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1152
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1153
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1154
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1155
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1156
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1157
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1158
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1159
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1160
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1161
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1162
+ .ui-icon-extlink { background-position: -32px -80px; }
1163
+ .ui-icon-newwin { background-position: -48px -80px; }
1164
+ .ui-icon-refresh { background-position: -64px -80px; }
1165
+ .ui-icon-shuffle { background-position: -80px -80px; }
1166
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1167
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1168
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1169
+ .ui-icon-folder-open { background-position: -16px -96px; }
1170
+ .ui-icon-document { background-position: -32px -96px; }
1171
+ .ui-icon-document-b { background-position: -48px -96px; }
1172
+ .ui-icon-note { background-position: -64px -96px; }
1173
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1174
+ .ui-icon-mail-open { background-position: -96px -96px; }
1175
+ .ui-icon-suitcase { background-position: -112px -96px; }
1176
+ .ui-icon-comment { background-position: -128px -96px; }
1177
+ .ui-icon-person { background-position: -144px -96px; }
1178
+ .ui-icon-print { background-position: -160px -96px; }
1179
+ .ui-icon-trash { background-position: -176px -96px; }
1180
+ .ui-icon-locked { background-position: -192px -96px; }
1181
+ .ui-icon-unlocked { background-position: -208px -96px; }
1182
+ .ui-icon-bookmark { background-position: -224px -96px; }
1183
+ .ui-icon-tag { background-position: -240px -96px; }
1184
+ .ui-icon-home { background-position: 0 -112px; }
1185
+ .ui-icon-flag { background-position: -16px -112px; }
1186
+ .ui-icon-calendar { background-position: -32px -112px; }
1187
+ .ui-icon-cart { background-position: -48px -112px; }
1188
+ .ui-icon-pencil { background-position: -64px -112px; }
1189
+ .ui-icon-clock { background-position: -80px -112px; }
1190
+ .ui-icon-disk { background-position: -96px -112px; }
1191
+ .ui-icon-calculator { background-position: -112px -112px; }
1192
+ .ui-icon-zoomin { background-position: -128px -112px; }
1193
+ .ui-icon-zoomout { background-position: -144px -112px; }
1194
+ .ui-icon-search { background-position: -160px -112px; }
1195
+ .ui-icon-wrench { background-position: -176px -112px; }
1196
+ .ui-icon-gear { background-position: -192px -112px; }
1197
+ .ui-icon-heart { background-position: -208px -112px; }
1198
+ .ui-icon-star { background-position: -224px -112px; }
1199
+ .ui-icon-link { background-position: -240px -112px; }
1200
+ .ui-icon-cancel { background-position: 0 -128px; }
1201
+ .ui-icon-plus { background-position: -16px -128px; }
1202
+ .ui-icon-plusthick { background-position: -32px -128px; }
1203
+ .ui-icon-minus { background-position: -48px -128px; }
1204
+ .ui-icon-minusthick { background-position: -64px -128px; }
1205
+ .ui-icon-close { background-position: -80px -128px; }
1206
+ .ui-icon-closethick { background-position: -96px -128px; }
1207
+ .ui-icon-key { background-position: -112px -128px; }
1208
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1209
+ .ui-icon-scissors { background-position: -144px -128px; }
1210
+ .ui-icon-clipboard { background-position: -160px -128px; }
1211
+ .ui-icon-copy { background-position: -176px -128px; }
1212
+ .ui-icon-contact { background-position: -192px -128px; }
1213
+ .ui-icon-image { background-position: -208px -128px; }
1214
+ .ui-icon-video { background-position: -224px -128px; }
1215
+ .ui-icon-script { background-position: -240px -128px; }
1216
+ .ui-icon-alert { background-position: 0 -144px; }
1217
+ .ui-icon-info { background-position: -16px -144px; }
1218
+ .ui-icon-notice { background-position: -32px -144px; }
1219
+ .ui-icon-help { background-position: -48px -144px; }
1220
+ .ui-icon-check { background-position: -64px -144px; }
1221
+ .ui-icon-bullet { background-position: -80px -144px; }
1222
+ .ui-icon-radio-on { background-position: -96px -144px; }
1223
+ .ui-icon-radio-off { background-position: -112px -144px; }
1224
+ .ui-icon-pin-w { background-position: -128px -144px; }
1225
+ .ui-icon-pin-s { background-position: -144px -144px; }
1226
+ .ui-icon-play { background-position: 0 -160px; }
1227
+ .ui-icon-pause { background-position: -16px -160px; }
1228
+ .ui-icon-seek-next { background-position: -32px -160px; }
1229
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1230
+ .ui-icon-seek-end { background-position: -64px -160px; }
1231
+ .ui-icon-seek-start { background-position: -80px -160px; }
1232
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1233
+ .ui-icon-seek-first { background-position: -80px -160px; }
1234
+ .ui-icon-stop { background-position: -96px -160px; }
1235
+ .ui-icon-eject { background-position: -112px -160px; }
1236
+ .ui-icon-volume-off { background-position: -128px -160px; }
1237
+ .ui-icon-volume-on { background-position: -144px -160px; }
1238
+ .ui-icon-power { background-position: 0 -176px; }
1239
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1240
+ .ui-icon-signal { background-position: -32px -176px; }
1241
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1242
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1243
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1244
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1245
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1246
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1247
+ .ui-icon-circle-close { background-position: -32px -192px; }
1248
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1249
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1250
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1251
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1252
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1253
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1254
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1255
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1256
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1257
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1258
+ .ui-icon-circle-check { background-position: -208px -192px; }
1259
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1260
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1261
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1262
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1263
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1264
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1265
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1266
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1267
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1268
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1269
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1270
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1271
+
1272
+
1273
+ /* Misc visuals
1274
+ ----------------------------------*/
1275
+
1276
+ /* Corner radius */
1277
+ .ui-corner-all,
1278
+ .ui-corner-top,
1279
+ .ui-corner-left,
1280
+ .ui-corner-tl {
1281
+ border-top-left-radius: 4px;
1282
+ }
1283
+ .ui-corner-all,
1284
+ .ui-corner-top,
1285
+ .ui-corner-right,
1286
+ .ui-corner-tr {
1287
+ border-top-right-radius: 4px;
1288
+ }
1289
+ .ui-corner-all,
1290
+ .ui-corner-bottom,
1291
+ .ui-corner-left,
1292
+ .ui-corner-bl {
1293
+ border-bottom-left-radius: 4px;
1294
+ }
1295
+ .ui-corner-all,
1296
+ .ui-corner-bottom,
1297
+ .ui-corner-right,
1298
+ .ui-corner-br {
1299
+ border-bottom-right-radius: 4px;
1300
+ }
1301
+
1302
+ /* Overlays */
1303
+ .ui-widget-overlay {
1304
+ background: #aaaaaa;
1305
+ opacity: .3;
1306
+ filter: Alpha(Opacity=30); /* support: IE8 */
1307
+ }
1308
+ .ui-widget-shadow {
1309
+ -webkit-box-shadow: -8px -8px 8px #aaaaaa;
1310
+ box-shadow: -8px -8px 8px #aaaaaa;
1311
+ }
includes/setup/pmax-add.php CHANGED
@@ -111,11 +111,11 @@ class TVC_PMaxAdd {
111
  </div>
112
  <div class="form-row campform-row">
113
  <label><?php esc_html_e("Start Date","enhanced-e-commerce-for-woocommerce-store"); ?></label>
114
- <input type="text" name="start_date" id="start_date" class="fromfiled smtext datepicker">
115
  </div>
116
  <div class="form-row campform-row">
117
  <label><?php esc_html_e("End Date","enhanced-e-commerce-for-woocommerce-store"); ?></label>
118
- <input type="text" name="end_date" id="end_date" class="fromfiled smtext datepicker">
119
  </div>
120
  <p class="label"><b>Status</b></p>
121
  <div class="form-row form-row-grp campform-row">
@@ -281,13 +281,17 @@ class TVC_PMaxAdd {
281
  return string.split(' ').join('');
282
  }
283
  jQuery( document ).ready(function() {
284
- jQuery(".datepicker").datepicker({
285
  todayHighlight: true,
286
  autoclose: true,
287
  defaultViewDate: new Date(),
288
  startDate: new Date(),
289
  format: "yyyy-mm-dd"
290
- });
 
 
 
 
291
  jQuery(document).on('click','.remove-row', function(event){
292
  event.preventDefault();
293
  jQuery(this).parent().remove();
@@ -300,8 +304,8 @@ class TVC_PMaxAdd {
300
  });
301
  jQuery(document).on('submit','#add-pmax-campaign-form', function(event){
302
  event.preventDefault();
303
- var site_key = $("input[name='site_key\\[\\]']").map(function(){return $(this).val();}).get();
304
- var site_url = $("input[name='site_url\\[\\]']").map(function(){return $(this).val();}).get();
305
  //console.log(site_key);
306
  //console.log(site_url);
307
  // code
111
  </div>
112
  <div class="form-row campform-row">
113
  <label><?php esc_html_e("Start Date","enhanced-e-commerce-for-woocommerce-store"); ?></label>
114
+ <input type="text" name="start_date" id="start_date" autocomplete="off" class="fromfiled smtext datepicker">
115
  </div>
116
  <div class="form-row campform-row">
117
  <label><?php esc_html_e("End Date","enhanced-e-commerce-for-woocommerce-store"); ?></label>
118
+ <input type="text" name="end_date" id="end_date" autocomplete="off" class="fromfiled smtext datepicker">
119
  </div>
120
  <p class="label"><b>Status</b></p>
121
  <div class="form-row form-row-grp campform-row">
281
  return string.split(' ').join('');
282
  }
283
  jQuery( document ).ready(function() {
284
+ /*jQuery(".datepicker").datepicker({
285
  todayHighlight: true,
286
  autoclose: true,
287
  defaultViewDate: new Date(),
288
  startDate: new Date(),
289
  format: "yyyy-mm-dd"
290
+ });*/
291
+ jQuery(function(){
292
+ jQuery("#start_date").datepicker({ dateFormat: 'yy-mm-dd' });
293
+ jQuery("#end_date").datepicker({ dateFormat: 'yy-mm-dd' });
294
+ });
295
  jQuery(document).on('click','.remove-row', function(event){
296
  event.preventDefault();
297
  jQuery(this).parent().remove();
304
  });
305
  jQuery(document).on('submit','#add-pmax-campaign-form', function(event){
306
  event.preventDefault();
307
+ var site_key = jQuery("input[name='site_key\\[\\]']").map(function(){return jQuery(this).val();}).get();
308
+ var site_url = jQuery("input[name='site_url\\[\\]']").map(function(){return jQuery(this).val();}).get();
309
  //console.log(site_key);
310
  //console.log(site_url);
311
  // code
includes/setup/pmax-edit.php CHANGED
@@ -358,8 +358,8 @@ class TVC_PMaxEdit {
358
  });
359
  jQuery(document).on('submit','#edit-pmax-campaign-form', function(event){
360
  event.preventDefault();
361
- var site_key = $("input[name='site_key\\[\\]']").map(function(){return $(this).val();}).get();
362
- var site_url = $("input[name='site_url\\[\\]']").map(function(){return $(this).val();}).get();
363
  //console.log(site_key);
364
  //console.log(site_url);
365
  // code
358
  });
359
  jQuery(document).on('submit','#edit-pmax-campaign-form', function(event){
360
  event.preventDefault();
361
+ var site_key = jQuery("input[name='site_key\\[\\]']").map(function(){return jQuery(this).val();}).get();
362
+ var site_url = jQuery("input[name='site_url\\[\\]']").map(function(){return jQuery(this).val();}).get();
363
  //console.log(site_key);
364
  //console.log(site_url);
365
  // code
includes/setup/tatvic-category-wrapper.php CHANGED
@@ -13,7 +13,7 @@ if ( ! class_exists( 'Tatvic_Category_Wrapper' ) ) :
13
  * @param string $mode displays a normal category selector or a category mapping selector when 'mapping' is given. Default = 'normal'.
14
  * @return string
15
  */
16
- public function category_table_content( $mode = 'normal' ) {
17
  $shop_categories = TVC_Taxonomies::get_shop_categories_list();
18
  return $this->category_rows( $shop_categories, 0, $mode );
19
  }
@@ -75,5 +75,39 @@ if ( ! class_exists( 'Tatvic_Category_Wrapper' ) ) :
75
 
76
  return $array_string;
77
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
  endif;
13
  * @param string $mode displays a normal category selector or a category mapping selector when 'mapping' is given. Default = 'normal'.
14
  * @return string
15
  */
16
+ public function category_table_content_old( $mode = 'normal' ) {
17
  $shop_categories = TVC_Taxonomies::get_shop_categories_list();
18
  return $this->category_rows( $shop_categories, 0, $mode );
19
  }
75
 
76
  return $array_string;
77
  }
78
+
79
+ public function category_table_content( $category, $category_depth_level, $mode ) {
80
+ if (!class_exists('Tatvic_Category_Selector_Element')) {
81
+ require_once(__DIR__ . '/class-tatvic-category-selector-element.php');
82
+ }
83
+ $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
84
+
85
+ $TCSE_Obj = new Tatvic_Category_Selector_Element();
86
+ $html_code = '';
87
+ $level_indicator = '';
88
+
89
+ for ( $i = 0; $i < $category_depth_level; $i ++ ) {
90
+ $level_indicator .= '— ';
91
+ }
92
+
93
+ $args = array(
94
+ 'parent' => $category,
95
+ 'hide_empty' => false,
96
+ 'no_found_rows' => true,
97
+ );
98
+
99
+ $shop_categories = get_terms('product_cat', $args);
100
+ if (!empty((array)$shop_categories ) ) {
101
+ foreach ( $shop_categories as $category ) {
102
+ $html_code .= $TCSE_Obj->category_mapping_row( $category, $level_indicator, $mode, $ee_prod_mapped_cats );
103
+ if ( $category->term_id !== 0) {
104
+ $html_code .= self::category_table_content( $category->term_id, $category_depth_level + 1, $mode );
105
+ }
106
+ }
107
+ } else if ($category == 0 ) {
108
+ $html_code .= esc_html__( 'No shop categories found.', 'enhanced-e-commerce-for-woocommerce-store' );
109
+ }
110
+ return $html_code;
111
+ }
112
  }
113
  endif;
public/class-con-settings.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Con_Settings{
3
+ protected $ga_EC;
4
+ //content grouping start
5
+ protected $ga_optimize_id;
6
+ protected $ga_CG;
7
+ //content grouping end
8
+ public $tvc_eeVer = PLUGIN_TVC_VERSION;
9
+ protected $ga_LC;
10
+ protected $ga_Dname;
11
+
12
+ protected $ga_id;
13
+ protected $gm_id;
14
+ protected $google_ads_id;
15
+ protected $google_merchant_id;
16
+
17
+ protected $tracking_option;
18
+
19
+ protected $ga_ST;
20
+ protected $ga_eeT;
21
+ protected $ga_gUser;
22
+
23
+ protected $ga_imTh;
24
+
25
+ protected $ga_IPA;
26
+ //protected $ga_OPTOUT;
27
+
28
+ protected $ads_ert;
29
+ protected $ads_edrt;
30
+ protected $ads_tracking_id;
31
+
32
+ protected $ga_PrivacyPolicy;
33
+
34
+ protected $ga_gCkout;
35
+ protected $ga_DF;
36
+ protected $tvc_options;
37
+ protected $TVC_Admin_Helper;
38
+ protected $remarketing_snippet_id;
39
+ protected $remarketing_snippets;
40
+ protected $conversio_send_to;
41
+ protected $ee_options;
42
+ protected $fb_pixel_id;
43
+ protected $c_t_o; //custom_tracking_options
44
+ protected $tracking_method;
45
+
46
+ protected $microsoft_ads_pixel_id;
47
+ protected $twitter_ads_pixel_id;
48
+ protected $pinterest_ads_pixel_id;
49
+ protected $snapchat_ads_pixel_id;
50
+ protected $tiKtok_ads_pixel_id;
51
+
52
+ protected $want_to_use_your_gtm;
53
+ protected $use_your_gtm_id;
54
+ public function __construct(){
55
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
56
+ $this->ga_CG = $this->get_option('ga_CG') == "on" ? true : false; // Content Grouping
57
+ $this->ga_optimize_id = sanitize_text_field($this->get_option("ga_optimize_id"));
58
+ $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
59
+
60
+ $this->tracking_method = sanitize_text_field($this->get_option("tracking_method"));
61
+
62
+ $this->ga_Dname = "auto";
63
+ $this->ga_id = sanitize_text_field($this->get_option("ga_id"));
64
+ $this->ga_eeT = sanitize_text_field($this->get_option("ga_eeT"));
65
+ $this->ga_ST = sanitize_text_field($this->get_option("ga_ST")); //add_gtag_snippet
66
+ $this->gm_id = sanitize_text_field($this->get_option("gm_id")); //measurement_id
67
+ $this->google_ads_id = sanitize_text_field($this->get_option("google_ads_id"));
68
+ $this->ga_excT = sanitize_text_field($this->get_option("ga_excT")); //exception_tracking
69
+ $this->exception_tracking = sanitize_text_field($this->get_option("exception_tracking")); //exception_tracking
70
+ $this->ga_elaT = sanitize_text_field($this->get_option("ga_elaT")); //enhanced_link_attribution_tracking
71
+ $this->google_merchant_id = sanitize_text_field($this->get_option("google_merchant_id"));
72
+ $this->tracking_option = sanitize_text_field($this->get_option("tracking_option"));
73
+ $this->ga_gCkout = sanitize_text_field($this->get_option("ga_gCkout") == "on" ? true : false); //guest checkout
74
+ $this->ga_gUser = sanitize_text_field($this->get_option("ga_gUser") == "on" ? true : false); //guest checkout
75
+ $this->ga_DF = sanitize_text_field($this->get_option("ga_DF") == "on" ? true : false);
76
+ $this->ga_imTh = sanitize_text_field($this->get_option("ga_Impr") == "" ? 6 : $this->get_option("ga_Impr"));
77
+ //$this->ga_OPTOUT = sanitize_text_field($this->get_option("ga_OPTOUT") == "on" ? true : false); //Google Analytics Opt Out
78
+ $this->ga_PrivacyPolicy = sanitize_text_field($this->get_option("ga_PrivacyPolicy") == "on" ? true : false);
79
+ $this->ga_IPA = sanitize_text_field($this->get_option("ga_IPA") == "on" ? true : false); //IP Anony.
80
+ $this->ads_ert = get_option('ads_ert'); //Enable remarketing tags
81
+ $this->ads_edrt = get_option('ads_edrt'); //Enable dynamic remarketing tags
82
+ $this->ads_tracking_id = sanitize_text_field(get_option('ads_tracking_id'));
83
+ $this->google_ads_conversion_tracking = get_option('google_ads_conversion_tracking');
84
+ $this->ga_EC = get_option("ga_EC");
85
+ $this->conversio_send_to = get_option('ee_conversio_send_to');
86
+
87
+ $remarketing = unserialize(get_option('ee_remarketing_snippets'));
88
+ if(!empty($remarketing) && isset($remarketing['snippets']) && esc_attr($remarketing['snippets'])){
89
+ $this->remarketing_snippets = base64_decode($remarketing['snippets']);
90
+ $this->remarketing_snippet_id = sanitize_text_field(isset($remarketing['id'])?esc_attr($remarketing['id']):"");
91
+ }
92
+
93
+ /*pixels*/
94
+ $this->fb_pixel_id = sanitize_text_field($this->get_option('fb_pixel_id'));
95
+ $this->microsoft_ads_pixel_id = sanitize_text_field($this->get_option('microsoft_ads_pixel_id'));
96
+ $this->twitter_ads_pixel_id = sanitize_text_field($this->get_option('twitter_ads_pixel_id'));
97
+ $this->pinterest_ads_pixel_id = sanitize_text_field($this->get_option('pinterest_ads_pixel_id'));
98
+ $this->snapchat_ads_pixel_id = sanitize_text_field($this->get_option('snapchat_ads_pixel_id'));
99
+ $this->tiKtok_ads_pixel_id = sanitize_text_field($this->get_option('tiKtok_ads_pixel_id'));
100
+ /* GTM*/
101
+ $this->want_to_use_your_gtm = sanitize_text_field($this->get_option('want_to_use_your_gtm'));
102
+ $this->use_your_gtm_id = sanitize_text_field($this->get_option('use_your_gtm_id'));
103
+
104
+ $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
105
+ $this->wc_version_compare("tvc_lc=" . json_encode(esc_js($this->ga_LC)) . ";");
106
+
107
+ $this->c_t_o = $this->TVC_Admin_Helper->get_ee_options_settings();
108
+ }
109
+
110
+ public function get_option($key){
111
+ if(empty($this->ee_options)){
112
+ $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
113
+ }
114
+ if(isset($this->ee_options[$key])){
115
+ return $this->ee_options[$key];
116
+ }
117
+ }
118
+
119
+ public function wc_version_compare($codeSnippet) {
120
+ global $woocommerce;
121
+ if (version_compare($woocommerce->version, "2.1", ">=")) {
122
+ wc_enqueue_js($codeSnippet);
123
+ } else {
124
+ $woocommerce->add_inline_js($codeSnippet);
125
+ }
126
+ }
127
+ public function get_selector_val_fron_array($obj, $key){
128
+ if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "id" ){
129
+ return ",#".$obj[$key.'_val'];
130
+ }else if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "class" ){
131
+ $class_list = explode(",",$obj[$key.'_val']);
132
+ if(!empty($class_list)){
133
+ $class_selector = "";
134
+ foreach($class_list as $class){
135
+ $class_selector .= ",.".trim($class);
136
+ }
137
+ return $class_selector;
138
+ }
139
+
140
+ }
141
+ }
142
+
143
+ public function get_selector_val_from_array_for_gmt($obj, $key){
144
+ if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "id" ){
145
+ return "#".$obj[$key.'_val'];
146
+ }else if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "class" ){
147
+ $class_list = explode(",",$obj[$key.'_val']);
148
+ if(!empty($class_list)){
149
+ $class_selector = "";
150
+ foreach($class_list as $class){
151
+ $class_selector .= ($class_selector)?",.".trim($class):".".trim($class);
152
+ }
153
+ return $class_selector;
154
+ }
155
+
156
+ }
157
+ }
158
+
159
+ protected function disable_tracking($type) {
160
+ if (is_admin() || "" == $type || current_user_can("manage_options")) {
161
+ //return true;
162
+ }
163
+ }
164
+ public function tvc_get_order_with_url_order_key(){
165
+ $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
166
+ if ( isset( $_get['key'] ) ) {
167
+ $order_key = $_get['key'];
168
+ return wc_get_order( wc_get_order_id_by_order_key( $order_key ) );
169
+ }
170
+ }
171
+ public function tvc_get_order_from_query_vars(){
172
+ global $wp ;
173
+ $order_id = absint( $wp->query_vars['order-received'] );
174
+ if ( $order_id && 0 != $order_id && wc_get_order( $order_id ) ) {
175
+ return wc_get_order( $order_id );
176
+ }
177
+ }
178
+ public function tvc_get_order_from_order_received_page(){
179
+ if ( $this->tvc_get_order_from_query_vars() ) {
180
+ return $this->tvc_get_order_from_query_vars();
181
+ } else {
182
+ if ( $this->tvc_get_order_with_url_order_key() ) {
183
+ return $this->tvc_get_order_with_url_order_key();
184
+ } else {
185
+ return false;
186
+ }
187
+ }
188
+ }
189
+ }
190
+ ?>
public/class-enhanced-ecommerce-google-analytics-public-pro.php CHANGED
@@ -20,7 +20,8 @@
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
  * @author Tatvic
22
  */
23
- class Enhanced_Ecommerce_Google_Analytics_Public {
 
24
  /**
25
  * Init and hook in the integration.
26
  *
@@ -30,48 +31,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
30
  //set plugin version
31
  protected $plugin_name;
32
  protected $version;
33
- protected $ga_EC;
34
- //content grouping start
35
- protected $ga_optimize_id;
36
- protected $ga_CG;
37
- //content grouping end
38
- public $tvc_eeVer = PLUGIN_TVC_VERSION;
39
- protected $ga_LC;
40
- protected $ga_Dname;
41
-
42
- protected $ga_id;
43
- protected $gm_id;
44
- protected $google_ads_id;
45
- protected $google_merchant_id;
46
-
47
- protected $tracking_option;
48
 
49
- protected $ga_ST;
50
- protected $ga_eeT;
51
- protected $ga_gUser;
52
-
53
- protected $ga_imTh;
54
-
55
- protected $ga_IPA;
56
- //protected $ga_OPTOUT;
57
-
58
- protected $ads_ert;
59
- protected $ads_edrt;
60
- protected $ads_tracking_id;
61
-
62
- protected $ga_PrivacyPolicy;
63
-
64
- protected $ga_gCkout;
65
- protected $ga_DF;
66
- protected $tvc_options;
67
- protected $TVC_Admin_Helper;
68
- protected $remarketing_snippet_id;
69
- protected $remarketing_snippets;
70
- protected $conversio_send_to;
71
- protected $ee_options;
72
- protected $fb_pixel_id;
73
- protected $c_t_o; //custom_tracking_options
74
-
75
  /**
76
  * Enhanced_Ecommerce_Google_Analytics_Public constructor.
77
  * @param $plugin_name
@@ -79,64 +39,13 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
79
  */
80
 
81
  public function __construct($plugin_name, $version) {
 
 
82
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
83
  $this->plugin_name = sanitize_text_field($plugin_name);
84
  $this->version = sanitize_text_field($version);
85
- $this->ga_CG = $this->get_option('ga_CG') == "on" ? true : false; // Content Grouping
86
- $this->ga_optimize_id = sanitize_text_field($this->get_option("ga_optimize_id"));
87
- $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
88
-
89
- /**
90
- * tvc_product_list_data_collection_method => product data collection method, like product list of shop page, category page, home page.
91
- * tvc_product_detail_data_collection_method => product page collection method
92
- * tvc_checkout_data_collection_method => Checkout page data collection method
93
- * tvc_thankyou_data_collection_method => Thank you page data collection method
94
- * tvc_product_detail_addtocart_selector => product single page add to cart CSS selector (_type, _val)
95
- * tvc_checkout_step_2_selector => Checkout step 2 CSS selector (_type, _val)
96
- * tvc_checkout_step_3_selector => Checkout step 3 CSS selector (_type, _val)
97
- *
98
- * */
99
-
100
- $this->c_t_o = $this->TVC_Admin_Helper->get_ee_options_settings();
101
-
102
  $this->tvc_call_hooks();
103
-
104
- $this->ga_Dname = "auto";
105
- $this->ga_id = sanitize_text_field($this->get_option("ga_id"));
106
- $this->ga_eeT = sanitize_text_field($this->get_option("ga_eeT"));
107
- $this->ga_ST = sanitize_text_field($this->get_option("ga_ST")); //add_gtag_snippet
108
- $this->gm_id = sanitize_text_field($this->get_option("gm_id")); //measurement_id
109
- $this->google_ads_id = sanitize_text_field($this->get_option("google_ads_id"));
110
- $this->ga_excT = sanitize_text_field($this->get_option("ga_excT")); //exception_tracking
111
- $this->exception_tracking = sanitize_text_field($this->get_option("exception_tracking")); //exception_tracking
112
- $this->ga_elaT = sanitize_text_field($this->get_option("ga_elaT")); //enhanced_link_attribution_tracking
113
- $this->google_merchant_id = sanitize_text_field($this->get_option("google_merchant_id"));
114
- $this->tracking_option = sanitize_text_field($this->get_option("tracking_option"));
115
- $this->ga_gCkout = sanitize_text_field($this->get_option("ga_gCkout") == "on" ? true : false); //guest checkout
116
- $this->ga_gUser = sanitize_text_field($this->get_option("ga_gUser") == "on" ? true : false); //guest checkout
117
- $this->ga_DF = sanitize_text_field($this->get_option("ga_DF") == "on" ? true : false);
118
- $this->ga_imTh = sanitize_text_field($this->get_option("ga_Impr") == "" ? 6 : $this->get_option("ga_Impr"));
119
- //$this->ga_OPTOUT = sanitize_text_field($this->get_option("ga_OPTOUT") == "on" ? true : false); //Google Analytics Opt Out
120
- $this->ga_PrivacyPolicy = sanitize_text_field($this->get_option("ga_PrivacyPolicy") == "on" ? true : false);
121
- $this->ga_IPA = sanitize_text_field($this->get_option("ga_IPA") == "on" ? true : false); //IP Anony.
122
- $this->ads_ert = get_option('ads_ert'); //Enable remarketing tags
123
- $this->ads_edrt = get_option('ads_edrt'); //Enable dynamic remarketing tags
124
- $this->ads_tracking_id = sanitize_text_field(get_option('ads_tracking_id'));
125
- $this->google_ads_conversion_tracking = get_option('google_ads_conversion_tracking');
126
- $this->ga_EC = get_option("ga_EC");
127
- $this->conversio_send_to = get_option('ee_conversio_send_to');
128
-
129
- $remarketing = unserialize(get_option('ee_remarketing_snippets'));
130
- if(!empty($remarketing) && isset($remarketing['snippets']) && esc_attr($remarketing['snippets'])){
131
- $this->remarketing_snippets = base64_decode($remarketing['snippets']);
132
- $this->remarketing_snippet_id = sanitize_text_field(isset($remarketing['id'])?esc_attr($remarketing['id']):"");
133
- }
134
-
135
- /*facebook pixel*/
136
- $this->fb_pixel_id = sanitize_text_field($this->get_option('fb_pixel_id'));
137
-
138
- $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
139
- $this->wc_version_compare("tvc_lc=" . json_encode(esc_js($this->ga_LC)) . ";");
140
  /*
141
  * start tvc_options
142
  */
@@ -184,80 +93,125 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
184
  * end tvc_options
185
  */
186
  }
187
-
188
- public function get_selector_val_fron_array($obj, $key){
189
- if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "id" ){
190
- return ",#".$obj[$key.'_val'];
191
- }else if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "class" ){
192
- $class_list = explode(",",$obj[$key.'_val']);
193
- if(!empty($class_list)){
194
- $class_selector = "";
195
- foreach($class_list as $class){
196
- $class_selector .= ",.".trim($class);
197
- }
198
- return $class_selector;
199
- }
200
-
201
- }
202
- }
203
-
204
  public function tvc_call_hooks(){
205
- add_action("wp_head", array($this, "enqueue_scripts"));
206
- add_action("wp_head", array($this, "ee_settings"));
 
 
 
 
 
 
 
 
207
  add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
208
 
209
- add_action("wp_footer", array($this, "t_products_impre_clicks"));
210
-
 
 
 
 
211
  /**Bind Product data **/
212
- //echo "<pre>";print_r($this->c_t_o);echo "</pre>";
213
  // product list collection method
214
  if(isset($this->c_t_o['tvc_product_list_data_collection_method']) && $this->c_t_o['tvc_product_list_data_collection_method']){
215
- add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this, "bind_product_metadata"));
 
 
 
 
216
  }else{
217
- add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
 
 
 
 
218
  }
 
219
  //Thnak you page collection method
220
  $tvc_thankyou_data_collection_method = isset($this->c_t_o['tvc_thankyou_data_collection_method'])?$this->c_t_o['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
221
  if($tvc_thankyou_data_collection_method == "on_page"){
222
- add_action("wp_head", array($this, "ecommerce_tracking_code"));
 
 
 
 
223
  }else if($tvc_thankyou_data_collection_method){
224
- add_action($tvc_thankyou_data_collection_method, array($this, "ecommerce_tracking_code"));
 
 
 
 
225
  } else{
226
- add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
 
 
 
 
227
  }
228
 
229
  //product detail page collection method
230
  $tvc_product_detail_data_collection_method = isset($this->c_t_o['tvc_product_detail_data_collection_method'])?$this->c_t_o['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
231
  if($tvc_product_detail_data_collection_method == "on_page"){
232
- add_action("wp_head", array($this, "product_detail_view"));
233
- add_action("wp_footer", array($this, "single_add_to_cart"));
 
 
 
 
234
  }else if($tvc_product_detail_data_collection_method){
235
  //product var init
236
- add_action($tvc_product_detail_data_collection_method, array($this, "product_detail_view"));
237
- //event trigger
238
- add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
 
 
 
 
239
  }else{
240
  //product var init
241
- add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
242
- //event trigger
243
- add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
 
 
 
 
244
  }
245
- add_action("woocommerce_after_cart", array($this, "remove_cart_tracking"));
 
 
 
 
 
246
 
247
  //checkout step 1,2,3
248
  $tvc_checkout_data_collection_method = isset($this->c_t_o['tvc_checkout_data_collection_method'])?$this->c_t_o['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
249
  if($tvc_checkout_data_collection_method == "on_page"){
250
- add_action("wp_head", array($this, "checkout_step_1_tracking"));
251
- add_action("wp_head", array($this, "checkout_step_2_tracking"));
252
- add_action("wp_head", array($this, "checkout_step_3_tracking"));
 
 
 
 
253
  }else if($tvc_checkout_data_collection_method){
254
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_1_tracking"));
255
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_2_tracking"));
256
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_3_tracking"));
 
 
 
 
257
  }else{
258
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
259
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
260
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
 
 
 
 
261
  }
262
 
263
  //Add Dev ID
@@ -364,17 +318,6 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
364
  if(isset($ee_additional_data['add_site_varification_tag']) && isset($ee_additional_data['site_varification_tag_val']) && $ee_additional_data['add_site_varification_tag'] == 1 && $ee_additional_data['site_varification_tag_val'] !="" ){
365
  echo html_entity_decode(esc_html(base64_decode($ee_additional_data['site_varification_tag_val'])));
366
  }
367
- }
368
- public function get_option($key){
369
- if(empty($this->ee_options)){
370
- $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
371
- }
372
- if(isset($this->ee_options[$key])){
373
- return $this->ee_options[$key];
374
- }
375
- }
376
- public function get_tvc_product_data($product_id){
377
-
378
  }
379
  /**
380
  * Get store meta data for trouble shoot
@@ -458,7 +401,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
458
  * @param mixed $type
459
  * @return bool
460
  */
461
- private function disable_tracking($type) {
462
  if (is_admin() || "" == $type || current_user_can("manage_options")) {
463
  return true;
464
  }
@@ -819,32 +762,6 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
819
  <?php
820
  }
821
  }
822
- protected function tvc_get_order_with_url_order_key(){
823
- $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
824
- if ( isset( $_get['key'] ) ) {
825
- $order_key = $_get['key'];
826
- return wc_get_order( wc_get_order_id_by_order_key( $order_key ) );
827
- }
828
- }
829
- protected function tvc_get_order_from_query_vars(){
830
- global $wp ;
831
- $order_id = absint( $wp->query_vars['order-received'] );
832
- if ( $order_id && 0 != $order_id && wc_get_order( $order_id ) ) {
833
- return wc_get_order( $order_id );
834
- }
835
- }
836
- protected function tvc_get_order_from_order_received_page(){
837
- if ( $this->tvc_get_order_from_query_vars() ) {
838
- return $this->tvc_get_order_from_query_vars();
839
- } else {
840
- if ( $this->tvc_get_order_with_url_order_key() ) {
841
- return $this->tvc_get_order_with_url_order_key();
842
- } else {
843
- return false;
844
- }
845
- }
846
- }
847
-
848
  /*protected function tvc_get_order_id(){
849
  global $wp ;
850
  $order_id = absint( $wp->query_vars['order-received'] );
@@ -866,7 +783,6 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
866
  * @return void
867
  */
868
  function ecommerce_tracking_code($order_id = null) {
869
- ///exit;
870
  global $woocommerce;
871
  $order = "";
872
  if($order_id == null && is_order_received_page()){
@@ -878,7 +794,7 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
878
  if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1 || !is_order_received_page() ){
879
  return;
880
  }
881
- get_post_meta($order_id, "_tracked", true);
882
  // Doing eCommerce tracking so unhook standard tracking from the footer
883
  remove_action("wp_footer", array($this, "ee_settings"));
884
  /*
@@ -1669,7 +1585,7 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
1669
  "tvc_n" => html_entity_decode(esc_js($prod_meta->get_title())),
1670
  "tvc_p" => esc_js($prod_meta->get_price()),
1671
  "tvc_c" => esc_js($categories),
1672
- "tvc_q"=>esc_js($woocommerce->cart->cart_contents[$key]["quantity"])
1673
  );
1674
  }
1675
 
@@ -1871,4 +1787,661 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
1871
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1872
  return $chkout_json;
1873
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1874
  }
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
  * @author Tatvic
22
  */
23
+ require_once(ENHANCAD_PLUGIN_DIR . 'public/class-con-settings.php');
24
+ class Enhanced_Ecommerce_Google_Analytics_Public extends Con_Settings{
25
  /**
26
  * Init and hook in the integration.
27
  *
31
  //set plugin version
32
  protected $plugin_name;
33
  protected $version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Enhanced_Ecommerce_Google_Analytics_Public constructor.
37
  * @param $plugin_name
39
  */
40
 
41
  public function __construct($plugin_name, $version) {
42
+ parent::__construct();
43
+ $this->gtm = new Con_GTM_Tracking($plugin_name, $version);
44
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
45
  $this->plugin_name = sanitize_text_field($plugin_name);
46
  $this->version = sanitize_text_field($version);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  $this->tvc_call_hooks();
48
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /*
50
  * start tvc_options
51
  */
93
  * end tvc_options
94
  */
95
  }
96
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  public function tvc_call_hooks(){
98
+ /**
99
+ * add global site tag js or settings
100
+ **/
101
+ if($this->tracking_method == "gtm"){
102
+ add_action("wp_head", array($this->gtm, "begin_datalayer"));
103
+ add_action("wp_head", array($this->gtm, "enqueue_scripts"));
104
+ }else{
105
+ add_action("wp_head", array($this, "enqueue_scripts"));
106
+ add_action("wp_head", array($this, "ee_settings"));
107
+ }
108
  add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
109
 
110
+ if($this->tracking_method == "gtm"){
111
+ add_action("wp_footer", array($this->gtm, "add_gtm_data_layer"));
112
+ }else{
113
+ add_action("wp_footer", array($this, "t_products_impre_clicks"));
114
+ }
115
+
116
  /**Bind Product data **/
 
117
  // product list collection method
118
  if(isset($this->c_t_o['tvc_product_list_data_collection_method']) && $this->c_t_o['tvc_product_list_data_collection_method']){
119
+ if($this->tracking_method == "gtm"){
120
+ add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this->gtm, "product_list_view"));
121
+ }else{
122
+ add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this, "bind_product_metadata"));
123
+ }
124
  }else{
125
+ if($this->tracking_method == "gtm"){
126
+ add_action("woocommerce_after_shop_loop_item", array($this->gtm, "product_list_view"));
127
+ }else{
128
+ add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
129
+ }
130
  }
131
+
132
  //Thnak you page collection method
133
  $tvc_thankyou_data_collection_method = isset($this->c_t_o['tvc_thankyou_data_collection_method'])?$this->c_t_o['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
134
  if($tvc_thankyou_data_collection_method == "on_page"){
135
+ if($this->tracking_method == "gtm"){
136
+ add_action("wp_head", array($this->gtm, "product_thankyou_view"));
137
+ }else{
138
+ add_action("wp_head", array($this, "ecommerce_tracking_code"));
139
+ }
140
  }else if($tvc_thankyou_data_collection_method){
141
+ if($this->tracking_method == "gtm"){
142
+ add_action($tvc_thankyou_data_collection_method, array($this->gtm, "product_thankyou_view"));
143
+ }else{
144
+ add_action($tvc_thankyou_data_collection_method, array($this, "ecommerce_tracking_code"));
145
+ }
146
  } else{
147
+ if($this->tracking_method == "gtm"){
148
+ add_action("woocommerce_thankyou", array($this->gtm, "product_thankyou_view"));
149
+ }else{
150
+ add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
151
+ }
152
  }
153
 
154
  //product detail page collection method
155
  $tvc_product_detail_data_collection_method = isset($this->c_t_o['tvc_product_detail_data_collection_method'])?$this->c_t_o['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
156
  if($tvc_product_detail_data_collection_method == "on_page"){
157
+ if($this->tracking_method == "gtm"){
158
+ add_action("wp_head", array($this->gtm, "product_detail_view"));
159
+ }else{
160
+ add_action("wp_head", array($this, "product_detail_view"));
161
+ add_action("wp_footer", array($this, "single_add_to_cart"));
162
+ }
163
  }else if($tvc_product_detail_data_collection_method){
164
  //product var init
165
+ if($this->tracking_method == "gtm"){
166
+ add_action($tvc_product_detail_data_collection_method, array($this->gtm, "product_detail_view"));
167
+ }else{
168
+ add_action($tvc_product_detail_data_collection_method, array($this, "product_detail_view"));
169
+ //event trigger
170
+ add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
171
+ }
172
  }else{
173
  //product var init
174
+ if($this->tracking_method == "gtm"){
175
+ add_action("woocommerce_after_single_product", array($this->gtm, "product_detail_view"));
176
+ }else{
177
+ add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
178
+ //event trigger
179
+ add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
180
+ }
181
  }
182
+
183
+ if($this->tracking_method == "gtm"){
184
+ add_action("woocommerce_after_cart", array($this->gtm, "product_cart_view"));
185
+ }else{
186
+ add_action("woocommerce_after_cart", array($this, "remove_cart_tracking"));
187
+ }
188
 
189
  //checkout step 1,2,3
190
  $tvc_checkout_data_collection_method = isset($this->c_t_o['tvc_checkout_data_collection_method'])?$this->c_t_o['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
191
  if($tvc_checkout_data_collection_method == "on_page"){
192
+ if($this->tracking_method == "gtm"){
193
+ add_action("wp_head", array($this->gtm, "checkout_step_view"));
194
+ }else{
195
+ add_action("wp_head", array($this, "checkout_step_1_tracking"));
196
+ add_action("wp_head", array($this, "checkout_step_2_tracking"));
197
+ add_action("wp_head", array($this, "checkout_step_3_tracking"));
198
+ }
199
  }else if($tvc_checkout_data_collection_method){
200
+ if($this->tracking_method == "gtm"){
201
+ add_action($tvc_checkout_data_collection_method, array($this->gtm, "checkout_step_view"));
202
+ }else{
203
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_1_tracking"));
204
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_2_tracking"));
205
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_3_tracking"));
206
+ }
207
  }else{
208
+ if($this->tracking_method == "gtm"){
209
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_view"));
210
+ }else{
211
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
212
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
213
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
214
+ }
215
  }
216
 
217
  //Add Dev ID
318
  if(isset($ee_additional_data['add_site_varification_tag']) && isset($ee_additional_data['site_varification_tag_val']) && $ee_additional_data['add_site_varification_tag'] == 1 && $ee_additional_data['site_varification_tag_val'] !="" ){
319
  echo html_entity_decode(esc_html(base64_decode($ee_additional_data['site_varification_tag_val'])));
320
  }
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
  /**
323
  * Get store meta data for trouble shoot
401
  * @param mixed $type
402
  * @return bool
403
  */
404
+ protected function disable_tracking($type) {
405
  if (is_admin() || "" == $type || current_user_can("manage_options")) {
406
  return true;
407
  }
762
  <?php
763
  }
764
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  /*protected function tvc_get_order_id(){
766
  global $wp ;
767
  $order_id = absint( $wp->query_vars['order-received'] );
783
  * @return void
784
  */
785
  function ecommerce_tracking_code($order_id = null) {
 
786
  global $woocommerce;
787
  $order = "";
788
  if($order_id == null && is_order_received_page()){
794
  if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1 || !is_order_received_page() ){
795
  return;
796
  }
797
+ //get_post_meta($order_id, "_tracked", true);
798
  // Doing eCommerce tracking so unhook standard tracking from the footer
799
  remove_action("wp_footer", array($this, "ee_settings"));
800
  /*
1585
  "tvc_n" => html_entity_decode(esc_js($prod_meta->get_title())),
1586
  "tvc_p" => esc_js($prod_meta->get_price()),
1587
  "tvc_c" => esc_js($categories),
1588
+ "tvc_q" => esc_js($woocommerce->cart->cart_contents[$key]["quantity"])
1589
  );
1590
  }
1591
 
1787
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1788
  return $chkout_json;
1789
  }
1790
+ }
1791
+ /**
1792
+ * GTM Tracking Data Layer Push
1793
+ **/
1794
+ class Con_GTM_Tracking extends Con_Settings {
1795
+ protected $plugin_name;
1796
+ protected $version;
1797
+ public function __construct($plugin_name, $version) {
1798
+ parent::__construct();
1799
+ $this->plugin_name = $plugin_name;
1800
+ $this->version = $version;
1801
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
1802
+ $this->tvc_options = array(
1803
+ "affiliation"=>esc_js(get_bloginfo('name')),
1804
+ "is_admin"=>esc_attr(is_admin()),
1805
+ "currency"=>esc_js($this->ga_LC),
1806
+ "tracking_option"=>esc_js($this->tracking_option),
1807
+ "property_id"=>esc_js($this->ga_id),
1808
+ "measurement_id"=>esc_js($this->gm_id),
1809
+ "google_ads_id"=>esc_js($this->google_ads_id),
1810
+ "fb_pixel_id"=>esc_js($this->fb_pixel_id),
1811
+ "tvc_ajax_url"=>esc_url_raw(admin_url( 'admin-ajax.php' ))
1812
+ );
1813
+ }
1814
+ /**
1815
+ * begin datalayer like settings
1816
+ **/
1817
+ public function begin_datalayer(){
1818
+ if ($this->disable_tracking($this->ga_eeT)) {
1819
+ return;
1820
+ }
1821
+ /*start uset tracking*/
1822
+ $enhanced_conversion = array();
1823
+ global $woocommerce;
1824
+ if($this->ga_EC){
1825
+ //login user
1826
+ if ( is_user_logged_in() ) {
1827
+ global $current_user;
1828
+ wp_get_current_user();
1829
+ $billing_country = WC()->customer->get_billing_country();
1830
+ $calling_code = WC()->countries->get_country_calling_code($billing_country);
1831
+ $phone = get_user_meta($current_user->ID,'billing_phone',true);
1832
+ if($phone != ""){
1833
+ $phone = str_replace($calling_code,"", $phone);
1834
+ $phone = $calling_code.$phone;
1835
+ $enhanced_conversion["phone_number"] = esc_js($phone);
1836
+ }
1837
+ $email = esc_js($current_user->user_email);
1838
+ if($email != ""){
1839
+ $enhanced_conversion["email"] = esc_js($email);
1840
+ }
1841
+ $first_name = esc_js($current_user->user_firstname);
1842
+ if($first_name != ""){
1843
+ $enhanced_conversion["address"]["first_name"] = esc_js($first_name);
1844
+ }
1845
+ $last_name = $current_user->user_lastname;
1846
+ if($last_name != ""){
1847
+ $enhanced_conversion["address"]["last_name"] = esc_js($last_name);
1848
+ }
1849
+ $billing_address_1 = WC()->customer->get_billing_address_1();
1850
+ if($billing_address_1 != ""){
1851
+ $enhanced_conversion["address"]["street"] = esc_js($billing_address_1);
1852
+ }
1853
+ $billing_postcode = WC()->customer->get_billing_postcode();
1854
+ if($billing_postcode != ""){
1855
+ $enhanced_conversion["address"]["postal_code"] = esc_js($billing_postcode);
1856
+ }
1857
+ $billing_city = WC()->customer->get_billing_city();
1858
+ if($billing_city != ""){
1859
+ $enhanced_conversion["address"]["city"] = esc_js($billing_city);
1860
+ }
1861
+ $billing_state = WC()->customer->get_billing_state();
1862
+ if($billing_state != ""){
1863
+ $enhanced_conversion["address"]["region"] = esc_js($billing_state);
1864
+ }
1865
+ $billing_country = WC()->customer->get_billing_country();
1866
+ if($billing_country != ""){
1867
+ $enhanced_conversion["address"]["country"] = esc_js($billing_country);
1868
+ }
1869
+ }else{ // get user
1870
+ $order = "";
1871
+ $order_id = "";
1872
+ if( $order_id == null && is_order_received_page() ){
1873
+ $order = $this->tvc_get_order_from_order_received_page();
1874
+ $order_id = $order->get_id();
1875
+ }
1876
+ if($order_id){
1877
+ $billing_country = $order->get_billing_country();
1878
+ $calling_code = WC()->countries->get_country_calling_code($billing_country);
1879
+ $billing_email = $order->get_billing_email();
1880
+ if($billing_email != ""){
1881
+ $enhanced_conversion["email"] = esc_js($billing_email);
1882
+ }
1883
+ $billing_phone = $order->get_billing_phone();
1884
+ if($billing_phone != ""){
1885
+ $billing_phone = str_replace($calling_code,"", $billing_phone);
1886
+ $billing_phone = $calling_code.$billing_phone;
1887
+ $enhanced_conversion["phone_number"] = esc_js($billing_phone);
1888
+ }
1889
+ $billing_first_name = $order->get_billing_first_name();
1890
+ if($billing_first_name != ""){
1891
+ $enhanced_conversion["address"]["first_name"] = esc_js($billing_first_name);
1892
+ }
1893
+ $billing_last_name = $order->get_billing_last_name();
1894
+ if($billing_last_name != ""){
1895
+ $enhanced_conversion["address"]["last_name"] = esc_js($billing_last_name);
1896
+ }
1897
+ $billing_address_1 = $order->get_billing_address_1();
1898
+ if($billing_address_1 != ""){
1899
+ $enhanced_conversion["address"]["street"] = esc_js($billing_address_1);
1900
+ }
1901
+ $billing_city = $order->get_billing_city();
1902
+ if($billing_city != ""){
1903
+ $enhanced_conversion["address"]["city"] = esc_js($billing_city);
1904
+ }
1905
+ $billing_state = $order->get_billing_state();
1906
+ if($billing_state != ""){
1907
+ $enhanced_conversion["address"]["region"] = esc_js($billing_state);
1908
+ }
1909
+ $billing_postcode = $order->get_billing_postcode();
1910
+ if($billing_postcode != ""){
1911
+ $enhanced_conversion["address"]["postal_code"] = esc_js($billing_postcode);
1912
+ }
1913
+ $billing_country = $order->get_billing_country();
1914
+ if($billing_country != ""){
1915
+ $enhanced_conversion["address"]["country"] = esc_js($billing_country);
1916
+ }
1917
+ }
1918
+ }
1919
+ }
1920
+ /*end user tracking*/
1921
+
1922
+ $conversio_send_to = explode("/",$this->conversio_send_to);
1923
+ $dataLayer = array(
1924
+ "event" => "begin_datalayer",
1925
+ "cov_ga3_propety_id" => $this->ga_id,
1926
+ "cov_ga4_measurment_id" => $this->gm_id,
1927
+ "cov_remarketing_conversion_id" => $this->remarketing_snippet_id,
1928
+ "cov_fb_pixel_id" => $this->fb_pixel_id,
1929
+ "cov_microsoft_uetq_id" => $this->microsoft_ads_pixel_id,
1930
+ "cov_twitter_pixel_id" => $this->twitter_ads_pixel_id,
1931
+ "cov_pintrest_pixel_id" => $this->pinterest_ads_pixel_id,
1932
+ "cov_snapchat_pixel_id" => $this->snapchat_ads_pixel_id,
1933
+ "cov_tiktok_sdkid" => $this->tiKtok_ads_pixel_id
1934
+ );
1935
+ if(!empty($enhanced_conversion)){
1936
+ $dataLayer = array_merge($dataLayer,$enhanced_conversion);
1937
+ }
1938
+ if(!empty($conversio_send_to) && $this->conversio_send_to){
1939
+ $dataLayer["cov_gads_conversion_id"] = $conversio_send_to[0];
1940
+ $dataLayer["cov_gads_conversion_label"] = $conversio_send_to[1];
1941
+ }
1942
+ $this->add_gtm_begin_datalayer_js($dataLayer);
1943
+ }
1944
+ /**
1945
+ * product list page
1946
+ **/
1947
+ public function product_list_view(){
1948
+ if ($this->disable_tracking($this->ga_eeT)) {
1949
+ return;
1950
+ }
1951
+ $listtype = '';
1952
+ if ( isset( $woocommerce_loop['listtype'] ) && ( '' !== $woocommerce_loop['listtype'] ) ) {
1953
+ $listtype = $woocommerce_loop['listtype'];
1954
+ }
1955
+ global $product, $woocommerce_loop;
1956
+ $this->con_product_list_item_extra_tag($product, $listtype);
1957
+ }
1958
+ /**
1959
+ * product page
1960
+ **/
1961
+ public function product_detail_view(){
1962
+ if ( $this->disable_tracking($this->ga_eeT) || !is_product() ) {
1963
+ return;
1964
+ }
1965
+ global $wp_query, $woocommerce, $product, $con_view_item;
1966
+ $con_view_item = $this->con_item_product(
1967
+ $product,
1968
+ array(
1969
+ 'productlink' => get_permalink()
1970
+ )
1971
+ );
1972
+ }
1973
+ /**
1974
+ * product cart page
1975
+ **/
1976
+ public function product_cart_view() {
1977
+ if($this->disable_tracking($this->ga_eeT)){
1978
+ return;
1979
+ }
1980
+ global $woocommerce, $con_cart_item_list;
1981
+ foreach($woocommerce->cart->get_cart() as $key => $item){
1982
+ $product_id = $item["product_id"];
1983
+ $product = wc_get_product( $product_id );
1984
+ $remove_cart_item_link = "";
1985
+ if (version_compare($woocommerce->version, "3.3", "<")) {
1986
+ $remove_cart_item_link=html_entity_decode($woocommerce->cart->get_remove_url($key));
1987
+ } else {
1988
+ $remove_cart_item_link=html_entity_decode(wc_get_cart_remove_url($key));
1989
+ }
1990
+ $con_cart_item_list[] = $this->con_item_product(
1991
+ $product,
1992
+ array(
1993
+ "productlink" => get_permalink(),
1994
+ "quantity" => $item["quantity"],
1995
+ "remove_cart_link" => $remove_cart_item_link
1996
+ )
1997
+ );
1998
+ $con_cart_item_list["value"] = WC()->cart->total;
1999
+ }
2000
+ }
2001
+ /**
2002
+ * product checkout page
2003
+ **/
2004
+ public function checkout_step_view(){
2005
+ global $woocommerce, $con_checkout_cart_item_list;
2006
+ foreach($woocommerce->cart->get_cart() as $key => $item){
2007
+ $product_id = $item["product_id"];
2008
+ $product = wc_get_product( $product_id );
2009
+ $con_checkout_cart_item_list[] = $this->con_item_product(
2010
+ $product,
2011
+ array(
2012
+ "productlink" => get_permalink(),
2013
+ "quantity" => $item["quantity"]
2014
+ )
2015
+ );
2016
+ $con_checkout_cart_item_list["value"] = WC()->cart->total;
2017
+ }
2018
+ }
2019
+ /**
2020
+ * Thank You page
2021
+ **/
2022
+ public function product_thankyou_view($order_id = null){
2023
+ global $woocommerce, $con_ordered_item_list;
2024
+ $order = "";
2025
+ if($order_id == null && is_order_received_page()){
2026
+ $order = $this->tvc_get_order_from_order_received_page();
2027
+ $order_id = $order->get_id();
2028
+ }else{
2029
+ $order = new WC_Order($order_id);
2030
+ }
2031
+ if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1 || !is_order_received_page() ){
2032
+ return;
2033
+ }
2034
+ $order_items = $order->get_items();
2035
+ if ( $order_items ) {
2036
+ foreach ( $order_items as $item ) {
2037
+ $product = $item->get_product();
2038
+ $con_ordered_item_list[] = $this->con_item_product(
2039
+ $product,
2040
+ array(
2041
+ "productlink" => get_permalink(),
2042
+ "quantity" => $item["quantity"]
2043
+ )
2044
+ );
2045
+ }
2046
+ $con_ordered_item_list["value"] = esc_js($order->get_total());
2047
+ $con_ordered_item_list["transaction_id"] = esc_js($order->get_order_number());
2048
+ $con_ordered_item_list["affiliation"] = esc_js(get_bloginfo('name'));
2049
+ $con_ordered_item_list["tax"] = esc_js($order->get_total_tax());
2050
+ $con_ordered_item_list["shipping"] = esc_js($order->get_shipping_total());
2051
+ $con_ordered_item_list["coupon"] = esc_js(implode( ', ', ( $woocommerce->version > "3.7" ? $order->get_coupon_codes() : $order->get_used_coupons() ) ));
2052
+ }
2053
+ update_post_meta($order_id, "_tracked", 1);
2054
+ }
2055
+ /**
2056
+ * dataLayer for setting and GTM global tag
2057
+ **/
2058
+ public function add_gtm_begin_datalayer_js($data_layer){
2059
+ $gtm_id = ($this->want_to_use_your_gtm && $this->use_your_gtm_id != "")?$this->use_your_gtm_id:"GTM-K7X94DG";
2060
+ $has_html5_support = current_theme_supports( 'html5' );
2061
+ echo '<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . '>
2062
+ window.dataLayer = window.dataLayer || [];
2063
+ dataLayer.push(' . wp_json_encode( $data_layer ) . ');
2064
+ </script>';
2065
+ ?>
2066
+ <!-- Google Tag Manager -->
2067
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
2068
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
2069
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
2070
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
2071
+ })(window,document,'script','dataLayer','<?php echo esc_js($gtm_id); ?>');</script>
2072
+ <!-- End Google Tag Manager -->
2073
+ <!-- Google Tag Manager (noscript) -->
2074
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo esc_js($gtm_id); ?>"
2075
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
2076
+ <!-- End Google Tag Manager (noscript) -->
2077
+ <?php
2078
+ }
2079
+ /**
2080
+ * DataLayer to JS
2081
+ **/
2082
+ public function add_gtm_data_layer_js($data_layer){
2083
+ $has_html5_support = current_theme_supports( 'html5' );
2084
+ echo '<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . '>
2085
+ window.dataLayer = window.dataLayer || [];
2086
+ dataLayer.push(' . wp_json_encode( $data_layer ) . ');
2087
+ </script>
2088
+ ';
2089
+ }
2090
+
2091
+ public function enqueue_scripts(){
2092
+ wp_enqueue_script(esc_js($this->plugin_name), esc_url_raw(ENHANCAD_PLUGIN_URL . '/public/js/con-gtm-google-analytics.js'), array('jquery'), esc_js($this->version), false);
2093
+ }
2094
+ /**
2095
+ * Creat DataLyer object for create JS data layer
2096
+ **/
2097
+ public function add_gtm_data_layer(){
2098
+ if ($this->disable_tracking($this->ga_eeT)) {
2099
+ return;
2100
+ }
2101
+ $affiliation = get_bloginfo('name');
2102
+ $impression_threshold = $this->ga_imTh;
2103
+ global $con_view_item_list,$con_view_item,$con_cart_item_list,$con_checkout_cart_item_list,$con_ordered_item_list;
2104
+
2105
+ /**
2106
+ * Thankyou Page
2107
+ **/
2108
+ if(empty($con_ordered_item_list)){
2109
+ $con_ordered_item_list=array(); //define empty array so if empty
2110
+ }else{
2111
+ $dataLayer = array();
2112
+ $dataLayer["event"] = "purchase";
2113
+ if(!empty($con_ordered_item_list)){
2114
+ $dataLayer["ecommerce"]["transaction_id"] = (isset($con_ordered_item_list["transaction_id"]))?$con_ordered_item_list["transaction_id"]:"";
2115
+ $dataLayer["ecommerce"]["value"] = (isset($con_ordered_item_list["value"]))?$con_ordered_item_list["value"]:"";
2116
+ $dataLayer["ecommerce"]["affiliation"] = (isset($con_ordered_item_list["affiliation"]))?$con_ordered_item_list["affiliation"]:"";
2117
+ $dataLayer["ecommerce"]["tax"] = (isset($con_ordered_item_list["tax"]))?$con_ordered_item_list["tax"]:"";
2118
+ $dataLayer["ecommerce"]["shipping"] = (isset($con_ordered_item_list["shipping"]))?$con_ordered_item_list["shipping"]:"";
2119
+ $dataLayer["ecommerce"]["coupon"] = (isset($con_ordered_item_list["coupon"]))?$con_ordered_item_list["coupon"]:"";
2120
+
2121
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
2122
+ unset($con_ordered_item_list["transaction_id"]);
2123
+ unset($con_ordered_item_list["value"]);
2124
+ unset($con_ordered_item_list["affiliation"]);
2125
+ unset($con_ordered_item_list["tax"]);
2126
+ unset($con_ordered_item_list["shipping"]);
2127
+ unset($con_ordered_item_list["coupon"]);
2128
+ foreach($con_ordered_item_list as $key => $view_item){
2129
+ $dataLayer["ecommerce"]["items"][] =
2130
+ array(
2131
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2132
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2133
+ "affiliation" => $affiliation,
2134
+ "currency" => $this->ga_LC,
2135
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
2136
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
2137
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
2138
+ );
2139
+ }
2140
+ }
2141
+ $this->add_gtm_data_layer_js($dataLayer);
2142
+ }
2143
+ /**
2144
+ * Checkout Page
2145
+ **/
2146
+ if(empty($con_checkout_cart_item_list)){
2147
+ $con_checkout_cart_item_list=array(); //define empty array so if empty
2148
+ }else{
2149
+ $dataLayer = array();
2150
+ $dataLayer["event"] = "begin_checkout";
2151
+ if(!empty($con_checkout_cart_item_list)){
2152
+ if(isset($con_checkout_cart_item_list["value"]) && $con_checkout_cart_item_list["value"]){
2153
+ $dataLayer["ecommerce"]["value"] = $con_checkout_cart_item_list["value"];
2154
+ }
2155
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
2156
+ unset($con_checkout_cart_item_list["value"]);
2157
+ foreach($con_checkout_cart_item_list as $key => $view_item){
2158
+ $dataLayer["ecommerce"]["items"][] =
2159
+ array(
2160
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2161
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2162
+ "affiliation" => $affiliation,
2163
+ "currency" => $this->ga_LC,
2164
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
2165
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
2166
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
2167
+ );
2168
+ }
2169
+ }
2170
+ $this->add_gtm_data_layer_js($dataLayer);
2171
+
2172
+ $checkout_step_2_selector = ( isset( $this->c_t_o['tvc_checkout_step_2_selector']) && $this->c_t_o['tvc_checkout_step_2_selector'] == "custom" )?$this->c_t_o:array();
2173
+ $checkout_step_2_selector = $this->get_selector_val_from_array_for_gmt($checkout_step_2_selector, 'tvc_checkout_step_2_selector');
2174
+ $checkout_step_2_selector = ($checkout_step_2_selector)?$checkout_step_2_selector:"input[name=billing_first_name]";
2175
+
2176
+ $checkout_step_3_selector = ( isset( $this->c_t_o['tvc_checkout_step_3_selector']) && $this->c_t_o['tvc_checkout_step_3_selector'] == "custom" )?$this->c_t_o:array();
2177
+ $checkout_step_3_selector = $this->get_selector_val_from_array_for_gmt($checkout_step_3_selector, 'tvc_checkout_step_3_selector');
2178
+ $checkout_step_3_selector = ($checkout_step_3_selector)?$checkout_step_3_selector:"#place_order";
2179
+
2180
+ ?>
2181
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2182
+ jQuery( document.body ).on("focus", "<?php echo $checkout_step_2_selector; ?>", function(event){
2183
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2184
+ tvc_js.checkout_step_2_tracking();
2185
+ });
2186
+ jQuery( document.body ).on("click", "<?php echo $checkout_step_3_selector; ?>", function(event){
2187
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2188
+ tvc_js.checkout_step_3_tracking();
2189
+ });
2190
+ </script>
2191
+
2192
+ <?php
2193
+ }
2194
+ /**
2195
+ * Cart Page
2196
+ **/
2197
+ if(empty($con_cart_item_list)){
2198
+ $con_cart_item_list=array(); //define empty array so if empty
2199
+ }else{
2200
+ $dataLayer = array();
2201
+ $dataLayer["event"] = "view_cart";
2202
+ if(!empty($con_cart_item_list)){
2203
+ if(isset($con_cart_item_list["value"]) && $con_cart_item_list["value"]){
2204
+ $dataLayer["ecommerce"]["value"] = $con_cart_item_list["value"];
2205
+ }
2206
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
2207
+ unset($con_cart_item_list["value"]);
2208
+ foreach($con_cart_item_list as $key => $view_item){
2209
+ $dataLayer["ecommerce"]["items"][] =
2210
+ array(
2211
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2212
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2213
+ "affiliation" => $affiliation,
2214
+ "currency" => $this->ga_LC,
2215
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
2216
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
2217
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
2218
+ );
2219
+ }
2220
+ }
2221
+ $this->add_gtm_data_layer_js($dataLayer);
2222
+
2223
+ /*** Remove Cart item ***/
2224
+ ?>
2225
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2226
+ window.conCarttList = window.productList || [];
2227
+ conCarttList.push(<?php echo wp_json_encode($con_cart_item_list); ?>);
2228
+ jQuery( document.body ).on("click", "a[href*=\"?remove_item\"]", function(event){
2229
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2230
+ tvc_js.remove_item_click(this);
2231
+ });
2232
+ </script>
2233
+ <?php
2234
+ }
2235
+ /**
2236
+ * Product detail page
2237
+ **/
2238
+ if(empty($con_view_item)){
2239
+ $con_view_item=array(); //define empty array so if empty
2240
+ }else{
2241
+ $dataLayer = array();
2242
+ $dataLayer["event"] = "view_item";
2243
+ $dataLayer["ecommerce"]["items"][] =
2244
+ array(
2245
+ "item_id" => isset($con_view_item["id"])?esc_js($con_view_item["id"]):"",
2246
+ "item_name" => isset($con_view_item["name"])?esc_js($con_view_item["name"]):"",
2247
+ "affiliation" => $affiliation,
2248
+ "currency" =>$this->ga_LC,
2249
+ "item_category" =>isset($con_view_item["category"])?esc_js($con_view_item["category"]):"",
2250
+ "price" =>isset($con_view_item["price"])?esc_js($con_view_item["price"]):"",
2251
+ "quantity" => 1
2252
+ );
2253
+ $this->add_gtm_data_layer_js($dataLayer);
2254
+
2255
+ /*** Add to Cart product detail page ***/
2256
+ global $product,$woocommerce;
2257
+ $variations_data = array();
2258
+ if ( $product->is_type('variable') ) {
2259
+ $variations_data['default_attributes'] = $product->get_default_attributes();
2260
+ $variations_data['available_variations'] = $product->get_available_variations(); //get all child variations
2261
+ $variations_data['available_attributes'] = $product->get_variation_attributes();
2262
+ }
2263
+ $product_detail_addtocart_selector = ( isset( $this->c_t_o['tvc_product_detail_addtocart_selector']) && $this->c_t_o['tvc_product_detail_addtocart_selector'] == "custom" )?$this->c_t_o:array();
2264
+ ?>
2265
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2266
+ window.addEventListener('load', call_tvc_enhanced,true);
2267
+ function call_tvc_enhanced(){
2268
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2269
+ tvc_js.singleProductaddToCartEventBindings(<?php echo json_encode($variations_data); ?>,"<?php echo esc_js($this->get_selector_val_fron_array($product_detail_addtocart_selector, 'tvc_product_detail_addtocart_selector')); ?>");
2270
+ }
2271
+ </script>
2272
+ <?php
2273
+ }
2274
+
2275
+ /**
2276
+ * view_item_list
2277
+ **/
2278
+ if(empty($con_view_item_list)){
2279
+ $con_view_item_list=array(); //define empty array so if empty
2280
+ }else{
2281
+ $dataLayer = array();
2282
+ $dataLayer["event"] = "view_item_list";
2283
+ $items = array();
2284
+ if(!empty($con_view_item_list)){
2285
+ foreach($con_view_item_list as $key => $view_item){
2286
+ $items[] = array(
2287
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2288
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2289
+ "affiliation" => $affiliation,
2290
+ "currency" =>$this->ga_LC,
2291
+ "index" =>($key+1),
2292
+ "item_category" =>isset($view_item["category"])?esc_js($view_item["category"]):"",
2293
+ "price" =>isset($view_item["price"])?esc_js($view_item["price"]):"",
2294
+ "quantity" => 1
2295
+ );
2296
+ if(count($items) >= $impression_threshold || $key >= (count($con_view_item_list)-1) ){
2297
+ $dataLayer["ecommerce"]["items"] = $items;
2298
+ $this->add_gtm_data_layer_js($dataLayer);
2299
+ $items = array();
2300
+ }
2301
+ }
2302
+
2303
+ /*** Add to Cart, product List page ***/
2304
+ ?>
2305
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2306
+ window.conProductList = window.productList || [];
2307
+ conProductList.push(<?php echo wp_json_encode( $con_view_item_list); ?>);
2308
+ window.addEventListener('load', call_tvc_enhanced_1ist_product,true);
2309
+ function call_tvc_enhanced_1ist_product(){
2310
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2311
+ tvc_js.ListProductaddToCartEventBindings();
2312
+ tvc_js.ListProductSelectItemEventBindings();
2313
+ }
2314
+ </script>
2315
+ <?php
2316
+ }
2317
+ }
2318
+ }
2319
+ public function con_product_list_item_extra_tag($product, $listtype){
2320
+ global $wp_query, $woocommerce_loop;
2321
+ global $con_view_item_list;
2322
+
2323
+ if ( ! isset( $product ) ) {
2324
+ return;
2325
+ }
2326
+ if ( ! ( $product instanceof WC_Product ) ) {
2327
+ return false;
2328
+ }
2329
+ $product_id = $product->get_id();
2330
+ $product_cat = '';
2331
+ if ( is_product_category() ) {
2332
+ global $wp_query;
2333
+ $cat_obj = $wp_query->get_queried_object();
2334
+ $product_cat = $cat_obj->name;
2335
+ } else {
2336
+ $product_cat = $this->con_get_product_category( $product_id );
2337
+ }
2338
+
2339
+ if ( is_search() ) {
2340
+ $list_name = __( 'Search Results', 'duracelltomi-google-tag-manager' );
2341
+ } elseif ( '' !== $listtype ) {
2342
+ $list_name = $listtype;
2343
+ } else {
2344
+ $list_name = __( 'General Product List', 'duracelltomi-google-tag-manager' );
2345
+ }
2346
+ $itemix = '';
2347
+ if ( isset( $woocommerce_loop['loop'] ) && ( '' !== $woocommerce_loop['loop'] ) ) {
2348
+ $itemix = $woocommerce_loop['loop'];
2349
+ }
2350
+ $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
2351
+ $posts_per_page = get_query_var( 'posts_per_page' );
2352
+ if ( $posts_per_page < 1 ) {
2353
+ $posts_per_page = 1;
2354
+ }
2355
+ $item = $this->con_item_product(
2356
+ $product,
2357
+ array(
2358
+ 'productlink' => get_permalink(),
2359
+ 'listname' => $list_name,
2360
+ 'listposition' => (int) $itemix + ( $posts_per_page * ( $paged - 1 ) ),
2361
+ )
2362
+ );
2363
+ $con_view_item_list[]= $item;
2364
+ }
2365
+
2366
+ public function con_item_product( $product, $additional_product_attributes ) {
2367
+ global $gtm4wp_options;
2368
+ if ( ! $product ) {
2369
+ return false;
2370
+ }
2371
+
2372
+ if ( ! ( $product instanceof WC_Product ) ) {
2373
+ return false;
2374
+ }
2375
+
2376
+ $product_id = $product->get_id();
2377
+ $product_type = $product->get_type();
2378
+ $remarketing_id = $product_id;
2379
+ $product_sku = $product->get_sku();
2380
+
2381
+ if ( 'variation' === $product_type ) {
2382
+ $parent_product_id = $product->get_parent_id();
2383
+ $product_cat = $this->con_get_product_category( $parent_product_id);
2384
+ } else {
2385
+ $product_cat = $this->con_get_product_category( $product_id );
2386
+ }
2387
+
2388
+ $_temp_productdata = array(
2389
+ 'id' => $remarketing_id,
2390
+ 'name' => $product->get_title(),
2391
+ 'sku' => $product_sku ? $product_sku : $product_id,
2392
+ 'category' => $product_cat,
2393
+ 'price' => round( (float) wc_get_price_to_display( $product ), 2 ),
2394
+ 'stocklevel' => $product->get_stock_quantity(),
2395
+ );
2396
+
2397
+ if ( 'variation' === $product_type ) {
2398
+ $_temp_productdata['variant'] = implode( ',', $product->get_variation_attributes() );
2399
+ }
2400
+ return array_merge( $_temp_productdata, $additional_product_attributes );
2401
+ }
2402
+
2403
+ public function con_get_product_category_hierarchy( $category_id ) {
2404
+ $cat_hierarchy = '';
2405
+
2406
+ $category_parent_list = get_term_parents_list(
2407
+ $category_id,
2408
+ 'product_cat',
2409
+ array(
2410
+ 'format' => 'name',
2411
+ 'separator' => '/',
2412
+ 'link' => false,
2413
+ 'inclusive' => true,
2414
+ )
2415
+ );
2416
+
2417
+ if ( is_string( $category_parent_list ) ) {
2418
+ $cat_hierarchy = trim( $category_parent_list, '/' );
2419
+ }
2420
+
2421
+ return $cat_hierarchy;
2422
+ }
2423
+
2424
+ public function con_get_product_category( $product_id, $fullpath = false ) {
2425
+ $product_cat = '';
2426
+
2427
+ $_product_cats = wp_get_post_terms(
2428
+ $product_id,
2429
+ 'product_cat',
2430
+ array(
2431
+ 'orderby' => 'parent',
2432
+ 'order' => 'ASC',
2433
+ )
2434
+ );
2435
+
2436
+ if ( ( is_array( $_product_cats ) ) && ( count( $_product_cats ) > 0 ) ) {
2437
+ $first_product_cat = array_pop( $_product_cats );
2438
+ if ( $fullpath ) {
2439
+ $product_cat = $this->con_get_product_category_hierarchy( $first_product_cat->term_id );
2440
+ } else {
2441
+ $product_cat = $first_product_cat->name;
2442
+ }
2443
+ }
2444
+
2445
+ return $product_cat;
2446
+ }
2447
  }
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -20,7 +20,8 @@
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
  * @author Tatvic
22
  */
23
- class Enhanced_Ecommerce_Google_Analytics_Public {
 
24
  /**
25
  * Init and hook in the integration.
26
  *
@@ -28,206 +29,136 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
28
  * @return void
29
  */
30
  //set plugin version
31
- public $tvc_eeVer = PLUGIN_TVC_VERSION;
32
-
33
- /**
34
- * @var mixed $ga_id
35
- */
36
- protected $ga_id;
37
- /**
38
- * @var $ga_LC
39
- */
40
- protected $ga_LC;
41
- /**
42
- * @var mixed $ga_ST
43
- */
44
- protected $ga_ST;
45
- /**
46
- * @var bool $ga_gCkout
47
- */
48
- protected $ga_gCkout;
49
- /**
50
- * @var mixed $ga_eeT
51
- */
52
- protected $ga_eeT;
53
- /**
54
- * @var bool $ga_DF
55
- */
56
- protected $ga_DF;
57
- /**
58
- * @var int|mixed $ga_imTh
59
- */
60
- protected $ga_imTh;
61
- /**
62
- * @var bool $ga_OPTOUT
63
- */
64
- //protected $ga_OPTOUT;
65
- /**
66
- * @var bool $ga_PrivacyPolicy
67
- */
68
- protected $ga_PrivacyPolicy;
69
- /**
70
- * @var bool $ga_IPA
71
- */
72
- protected $ga_IPA;
73
-
74
- /**
75
- * @var mixed $gm_id
76
- */
77
- protected $gm_id;
78
- /**
79
- * @var mixed $google_ads_id
80
- */
81
- protected $google_ads_id;
82
- /**
83
- * @var mixed $ga_excT
84
- */
85
- protected $ga_excT;
86
- protected $exception_tracking;
87
- protected $ga_elaT;
88
- protected $google_merchant_id;
89
- protected $tracking_option;
90
- protected $ga_gUser;
91
  protected $plugin_name;
92
  protected $version;
93
- protected $ads_ert;
94
- protected $ads_edrt;
95
- protected $ads_tracking_id;
96
- protected $TVC_Admin_Helper;
97
- protected $remarketing_snippet_id;
98
- protected $remarketing_snippets;
99
- protected $ee_options;
100
- protected $fb_pixel_id;
101
- protected $c_t_o; //custom_tracking_options
102
- /**
103
- * Enhanced_Ecommerce_Google_Analytics_Public constructor.
104
- * @param $plugin_name
105
- * @param $version
106
- */
107
-
108
  public function __construct($plugin_name, $version) {
 
 
109
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
110
  $this->plugin_name = sanitize_text_field($plugin_name);
111
  $this->version = sanitize_text_field($version);
112
-
113
- $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
114
- /**
115
- * tvc_product_list_data_collection_method => product data collection method, like product list of shop page, category page, home page.
116
- * tvc_product_detail_data_collection_method => product page collection method
117
- * tvc_checkout_data_collection_method => Checkout page data collection method
118
- * tvc_thankyou_data_collection_method => Thank you page data collection method
119
- * tvc_product_detail_addtocart_selector => product single page add to cart CSS selector (_type, _val)
120
- * tvc_checkout_step_2_selector => Checkout step 2 CSS selector (_type, _val)
121
- * tvc_checkout_step_3_selector => Checkout step 3 CSS selector (_type, _val)
122
- *
123
- * */
124
- $this->c_t_o = $this->TVC_Admin_Helper->get_ee_options_settings();
125
-
126
- $this->tvc_call_hooks();
127
- $this->ga_id = sanitize_text_field($this->get_option("ga_id"));
128
- $this->ga_eeT = sanitize_text_field($this->get_option("ga_eeT"));
129
- $this->ga_ST = sanitize_text_field($this->get_option("ga_ST")); //add_gtag_snippet
130
- $this->gm_id = sanitize_text_field($this->get_option("gm_id")); //measurement_id
131
- $this->google_ads_id = sanitize_text_field($this->get_option("google_ads_id"));
132
- $this->ga_excT = sanitize_text_field($this->get_option("ga_excT")); //exception_tracking
133
- $this->exception_tracking = sanitize_text_field($this->get_option("exception_tracking")); //exception_tracking
134
- $this->ga_elaT = sanitize_text_field($this->get_option("ga_elaT")); //enhanced_link_attribution_tracking
135
- $this->google_merchant_id = sanitize_text_field($this->get_option("google_merchant_id"));
136
- $this->tracking_option = sanitize_text_field($this->get_option("tracking_option"));
137
- $this->ga_gCkout = sanitize_text_field($this->get_option("ga_gCkout") == "on" ? true : false); //guest checkout
138
- $this->ga_gUser = sanitize_text_field($this->get_option("ga_gUser") == "on" ? true : false); //guest checkout
139
- $this->ga_DF = sanitize_text_field($this->get_option("ga_DF") == "on" ? true : false);
140
- $this->ga_imTh = sanitize_text_field($this->get_option("ga_Impr") == "" ? 6 : $this->get_option("ga_Impr"));
141
- //$this->ga_OPTOUT = sanitize_text_field($this->get_option("ga_OPTOUT") == "on" ? true : false); //Google Analytics Opt Out
142
- $this->ga_PrivacyPolicy = sanitize_text_field($this->get_option("ga_PrivacyPolicy") == "on" ? true : false);
143
- $this->ga_IPA = sanitize_text_field($this->get_option("ga_IPA") == "on" ? true : false); //IP Anony.
144
- $this->ads_ert = sanitize_text_field(get_option('ads_ert')); //Enable remarketing tags
145
- $this->ads_edrt = sanitize_text_field(get_option('ads_edrt')); //Enable dynamic remarketing tags
146
- $this->ads_tracking_id = sanitize_text_field(get_option('ads_tracking_id'));
147
-
148
- $remarketing = unserialize(get_option('ee_remarketing_snippets'));
149
- if(!empty($remarketing) && isset($remarketing['snippets']) && esc_attr($remarketing['snippets'])){
150
- $this->remarketing_snippets = base64_decode($remarketing['snippets']);
151
- $this->remarketing_snippet_id = isset($remarketing['id'])?esc_attr($remarketing['id']):"";
152
- }
153
- $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
154
- $this->wc_version_compare("tvc_lc=" . json_encode(esc_js($this->ga_LC)) . ";");
155
-
156
- /*facebook pixel*/
157
- $this->fb_pixel_id = sanitize_text_field($this->get_option('fb_pixel_id'));
158
-
159
- }
160
- public function get_selector_val_fron_array($obj, $key){
161
- if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "id" ){
162
- return ",#".$obj[$key.'_val'];
163
- }else if( isset($obj[$key.'_val']) && $obj[$key.'_val'] && isset($obj[$key.'_type']) && $obj[$key.'_type'] == "class" ){
164
- $class_list = explode(",",$obj[$key.'_val']);
165
- if(!empty($class_list)){
166
- $class_selector = "";
167
- foreach($class_list as $class){
168
- $class_selector .= ",.".trim($class);
169
- }
170
- return $class_selector;
171
- }
172
-
173
- }
174
  }
175
  public function tvc_call_hooks(){
176
- add_action("wp_head", array($this, "enqueue_scripts"));
177
- add_action("wp_head", array($this, "ee_settings"));
 
 
 
 
 
 
 
 
178
  add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
179
 
180
- add_action("wp_footer", array($this, "t_products_impre_clicks"));
 
 
 
 
 
181
  /**Bind Product data **/
182
  // product list collection method
183
  if(isset($this->c_t_o['tvc_product_list_data_collection_method']) && $this->c_t_o['tvc_product_list_data_collection_method']){
184
- add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this, "bind_product_metadata"));
 
 
 
 
185
  }else{
186
- add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
 
 
 
 
187
  }
188
 
189
  //Thnak you page collection method
190
  $tvc_thankyou_data_collection_method = isset($this->c_t_o['tvc_thankyou_data_collection_method'])?$this->c_t_o['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
191
  if($tvc_thankyou_data_collection_method == "on_page"){
192
- add_action("wp_head", array($this, "ecommerce_tracking_code"));
 
 
 
 
193
  }else if($tvc_thankyou_data_collection_method){
194
- add_action($tvc_thankyou_data_collection_method, array($this, "ecommerce_tracking_code"));
 
 
 
 
195
  } else{
196
- add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
 
 
 
 
197
  }
198
 
199
  //product detail page collection method
200
  $tvc_product_detail_data_collection_method = isset($this->c_t_o['tvc_product_detail_data_collection_method'])?$this->c_t_o['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
201
  if($tvc_product_detail_data_collection_method == "on_page"){
202
- add_action("wp_head", array($this, "product_detail_view"));
203
- add_action("wp_footer", array($this, "single_add_to_cart"));
 
 
 
 
204
  }else if($tvc_product_detail_data_collection_method){
205
- //product var init
206
- add_action($tvc_product_detail_data_collection_method, array($this, "product_detail_view"));
207
- //event trigger
208
- add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
 
 
 
 
209
  }else{
210
- //product var init
211
- add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
212
- //event trigger
213
- add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
 
 
 
 
214
  }
215
-
216
- add_action("woocommerce_after_cart",array($this, "remove_cart_tracking"));
 
 
 
 
217
  //checkout step 1,2,3
218
  $tvc_checkout_data_collection_method = isset($this->c_t_o['tvc_checkout_data_collection_method'])?$this->c_t_o['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
219
  if($tvc_checkout_data_collection_method == "on_page"){
220
- add_action("wp_head", array($this, "checkout_step_1_tracking"));
221
- add_action("wp_head", array($this, "checkout_step_2_tracking"));
222
- add_action("wp_head", array($this, "checkout_step_3_tracking"));
 
 
 
 
223
  }else if($tvc_checkout_data_collection_method){
224
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_1_tracking"));
225
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_2_tracking"));
226
- add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_3_tracking"));
 
 
 
 
227
  }else{
228
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
229
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
230
- add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
 
 
 
 
231
  }
232
 
233
  //Add Dev ID
@@ -242,14 +173,6 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
242
  }
243
 
244
  }
245
- public function get_option($key){
246
- if(empty($this->ee_options)){
247
- $this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
248
- }
249
- if(isset($this->ee_options[$key])){
250
- return $this->ee_options[$key];
251
- }
252
- }
253
  /**
254
  * Get store meta data for trouble shoot
255
  * @access public
@@ -321,19 +244,6 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
321
  <?php
322
  }
323
 
324
- /**
325
- * Check if tracking is disabled
326
- *
327
- * @access private
328
- * @param mixed $type
329
- * @return bool
330
- */
331
- private function disable_tracking($type) {
332
- if (is_admin() || "" == $type || current_user_can("manage_options")) {
333
- return true;
334
- }
335
- }
336
-
337
  /**
338
  * woocommerce version compare
339
  *
@@ -480,31 +390,6 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
480
  <?php
481
  }
482
  }
483
- protected function tvc_get_order_with_url_order_key(){
484
- $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
485
- if ( isset( $_get['key'] ) ) {
486
- $order_key = $_get['key'];
487
- return wc_get_order( wc_get_order_id_by_order_key( $order_key ) );
488
- }
489
- }
490
- protected function tvc_get_order_from_query_vars(){
491
- global $wp ;
492
- $order_id = absint( $wp->query_vars['order-received'] );
493
- if ( $order_id && 0 != $order_id && wc_get_order( $order_id ) ) {
494
- return wc_get_order( $order_id );
495
- }
496
- }
497
- protected function tvc_get_order_from_order_received_page(){
498
- if ( $this->tvc_get_order_from_query_vars() ) {
499
- return $this->tvc_get_order_from_query_vars();
500
- } else {
501
- if ( $this->tvc_get_order_with_url_order_key() ) {
502
- return $this->tvc_get_order_with_url_order_key();
503
- } else {
504
- return false;
505
- }
506
- }
507
- }
508
 
509
  /**
510
  * Google Analytics eCommerce tracking
@@ -1853,4 +1738,551 @@ src="https://www.facebook.com/tr?id=<?php echo esc_js($this->fb_pixel_id); ?>&ev
1853
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1854
  return $chkout_json;
1855
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1856
  }
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
  * @author Tatvic
22
  */
23
+ require_once(ENHANCAD_PLUGIN_DIR . 'public/class-con-settings.php');
24
+ class Enhanced_Ecommerce_Google_Analytics_Public extends Con_Settings{
25
  /**
26
  * Init and hook in the integration.
27
  *
29
  * @return void
30
  */
31
  //set plugin version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  protected $plugin_name;
33
  protected $version;
34
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  public function __construct($plugin_name, $version) {
36
+ parent::__construct();
37
+ $this->gtm = new Con_GTM_Tracking($plugin_name, $version);
38
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
39
  $this->plugin_name = sanitize_text_field($plugin_name);
40
  $this->version = sanitize_text_field($version);
41
+ //$this->ee_options = $this->TVC_Admin_Helper->get_ee_options_settings();
42
+ //$this->c_t_o = $this->TVC_Admin_Helper->get_ee_options_settings();
43
+ $this->tvc_call_hooks();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
  public function tvc_call_hooks(){
46
+ /**
47
+ * add global site tag js or settings
48
+ **/
49
+ if($this->tracking_method == "gtm"){
50
+ add_action("wp_head", array($this->gtm, "begin_datalayer"));
51
+ add_action("wp_head", array($this->gtm, "enqueue_scripts"));
52
+ }else{
53
+ add_action("wp_head", array($this, "enqueue_scripts"));
54
+ add_action("wp_head", array($this, "ee_settings"));
55
+ }
56
  add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
57
 
58
+ if($this->tracking_method == "gtm"){
59
+ add_action("wp_footer", array($this->gtm, "add_gtm_data_layer"));
60
+ }else{
61
+ add_action("wp_footer", array($this, "t_products_impre_clicks"));
62
+ }
63
+
64
  /**Bind Product data **/
65
  // product list collection method
66
  if(isset($this->c_t_o['tvc_product_list_data_collection_method']) && $this->c_t_o['tvc_product_list_data_collection_method']){
67
+ if($this->tracking_method == "gtm"){
68
+ add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this->gtm, "product_list_view"));
69
+ }else{
70
+ add_action($this->c_t_o['tvc_product_list_data_collection_method'], array($this, "bind_product_metadata"));
71
+ }
72
  }else{
73
+ if($this->tracking_method == "gtm"){
74
+ add_action("woocommerce_after_shop_loop_item", array($this->gtm, "product_list_view"));
75
+ }else{
76
+ add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
77
+ }
78
  }
79
 
80
  //Thnak you page collection method
81
  $tvc_thankyou_data_collection_method = isset($this->c_t_o['tvc_thankyou_data_collection_method'])?$this->c_t_o['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
82
  if($tvc_thankyou_data_collection_method == "on_page"){
83
+ if($this->tracking_method == "gtm"){
84
+ add_action("wp_head", array($this->gtm, "product_thankyou_view"));
85
+ }else{
86
+ add_action("wp_head", array($this, "ecommerce_tracking_code"));
87
+ }
88
  }else if($tvc_thankyou_data_collection_method){
89
+ if($this->tracking_method == "gtm"){
90
+ add_action($tvc_thankyou_data_collection_method, array($this->gtm, "product_thankyou_view"));
91
+ }else{
92
+ add_action($tvc_thankyou_data_collection_method, array($this, "ecommerce_tracking_code"));
93
+ }
94
  } else{
95
+ if($this->tracking_method == "gtm"){
96
+ add_action("woocommerce_thankyou", array($this->gtm, "product_thankyou_view"));
97
+ }else{
98
+ add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
99
+ }
100
  }
101
 
102
  //product detail page collection method
103
  $tvc_product_detail_data_collection_method = isset($this->c_t_o['tvc_product_detail_data_collection_method'])?$this->c_t_o['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
104
  if($tvc_product_detail_data_collection_method == "on_page"){
105
+ if($this->tracking_method == "gtm"){
106
+ add_action("wp_head", array($this->gtm, "product_detail_view"));
107
+ }else{
108
+ add_action("wp_head", array($this, "product_detail_view"));
109
+ add_action("wp_footer", array($this, "single_add_to_cart"));
110
+ }
111
  }else if($tvc_product_detail_data_collection_method){
112
+ if($this->tracking_method == "gtm"){
113
+ add_action($tvc_product_detail_data_collection_method, array($this->gtm, "product_detail_view"));
114
+ }else{
115
+ //product var init
116
+ add_action($tvc_product_detail_data_collection_method, array($this, "product_detail_view"));
117
+ //event trigger
118
+ add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
119
+ }
120
  }else{
121
+ if($this->tracking_method == "gtm"){
122
+ add_action("woocommerce_after_single_product", array($this->gtm, "product_detail_view"));
123
+ }else{
124
+ //product var init
125
+ add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
126
+ //event trigger
127
+ add_action("woocommerce_after_add_to_cart_button", array($this, "single_add_to_cart"));
128
+ }
129
  }
130
+ if($this->tracking_method == "gtm"){
131
+ add_action("woocommerce_after_cart", array($this->gtm, "product_cart_view"));
132
+ }else{
133
+ add_action("woocommerce_after_cart",array($this, "remove_cart_tracking"));
134
+ }
135
+
136
  //checkout step 1,2,3
137
  $tvc_checkout_data_collection_method = isset($this->c_t_o['tvc_checkout_data_collection_method'])?$this->c_t_o['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
138
  if($tvc_checkout_data_collection_method == "on_page"){
139
+ if($this->tracking_method == "gtm"){
140
+ add_action("wp_head", array($this->gtm, "checkout_step_view"));
141
+ }else{
142
+ add_action("wp_head", array($this, "checkout_step_1_tracking"));
143
+ add_action("wp_head", array($this, "checkout_step_2_tracking"));
144
+ add_action("wp_head", array($this, "checkout_step_3_tracking"));
145
+ }
146
  }else if($tvc_checkout_data_collection_method){
147
+ if($this->tracking_method == "gtm"){
148
+ add_action($tvc_checkout_data_collection_method, array($this->gtm, "checkout_step_view"));
149
+ }else{
150
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_1_tracking"));
151
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_2_tracking"));
152
+ add_action($tvc_checkout_data_collection_method, array($this, "checkout_step_3_tracking"));
153
+ }
154
  }else{
155
+ if($this->tracking_method == "gtm"){
156
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_view"));
157
+ }else{
158
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
159
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
160
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
161
+ }
162
  }
163
 
164
  //Add Dev ID
173
  }
174
 
175
  }
 
 
 
 
 
 
 
 
176
  /**
177
  * Get store meta data for trouble shoot
178
  * @access public
244
  <?php
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  /**
248
  * woocommerce version compare
249
  *
390
  <?php
391
  }
392
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
 
394
  /**
395
  * Google Analytics eCommerce tracking
1738
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1739
  return $chkout_json;
1740
  }
1741
+ }
1742
+ /**
1743
+ * GTM Tracking Data Layer Push
1744
+ **/
1745
+ class Con_GTM_Tracking extends Con_Settings {
1746
+ protected $plugin_name;
1747
+ protected $version;
1748
+ public function __construct($plugin_name, $version) {
1749
+ parent::__construct();
1750
+ $this->plugin_name = $plugin_name;
1751
+ $this->version = $version;
1752
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
1753
+ $this->tvc_options = array(
1754
+ "affiliation"=>esc_js(get_bloginfo('name')),
1755
+ "is_admin"=>esc_attr(is_admin()),
1756
+ "currency"=>esc_js($this->ga_LC),
1757
+ "tracking_option"=>esc_js($this->tracking_option),
1758
+ "property_id"=>esc_js($this->ga_id),
1759
+ "measurement_id"=>esc_js($this->gm_id),
1760
+ "google_ads_id"=>esc_js($this->google_ads_id),
1761
+ "fb_pixel_id"=>esc_js($this->fb_pixel_id),
1762
+ "tvc_ajax_url"=>esc_url_raw(admin_url( 'admin-ajax.php' ))
1763
+ );
1764
+ }
1765
+ /**
1766
+ * begin datalayer like settings
1767
+ **/
1768
+ public function begin_datalayer(){
1769
+ if ($this->disable_tracking($this->ga_eeT)) {
1770
+ return;
1771
+ }
1772
+ $dataLayer = array(
1773
+ "event" => "begin_datalayer",
1774
+ "cov_ga3_propety_id" => $this->ga_id,
1775
+ "cov_ga4_measurment_id" => $this->gm_id,
1776
+ "cov_remarketing_conversion_id" => $this->remarketing_snippet_id,
1777
+ "cov_fb_pixel_id" => $this->fb_pixel_id,
1778
+ "cov_microsoft_uetq_id" => $this->microsoft_ads_pixel_id,
1779
+ "cov_twitter_pixel_id" => $this->twitter_ads_pixel_id,
1780
+ "cov_pintrest_pixel_id" => $this->pinterest_ads_pixel_id,
1781
+ "cov_snapchat_pixel_id" => $this->snapchat_ads_pixel_id,
1782
+ "cov_tiktok_sdkid" => $this->tiKtok_ads_pixel_id
1783
+ );
1784
+ $this->add_gtm_begin_datalayer_js($dataLayer);
1785
+ }
1786
+ /**
1787
+ * product list page
1788
+ **/
1789
+ public function product_list_view(){
1790
+ if ($this->disable_tracking($this->ga_eeT)) {
1791
+ return;
1792
+ }
1793
+ $listtype = '';
1794
+ if ( isset( $woocommerce_loop['listtype'] ) && ( '' !== $woocommerce_loop['listtype'] ) ) {
1795
+ $listtype = $woocommerce_loop['listtype'];
1796
+ }
1797
+ global $product, $woocommerce_loop;
1798
+ $this->con_product_list_item_extra_tag($product, $listtype);
1799
+ }
1800
+ /**
1801
+ * product page
1802
+ **/
1803
+ public function product_detail_view(){
1804
+ if ( $this->disable_tracking($this->ga_eeT) || !is_product() ) {
1805
+ return;
1806
+ }
1807
+ global $wp_query, $woocommerce, $product, $con_view_item;
1808
+ $con_view_item = $this->con_item_product(
1809
+ $product,
1810
+ array(
1811
+ 'productlink' => get_permalink()
1812
+ )
1813
+ );
1814
+ }
1815
+ /**
1816
+ * product cart page
1817
+ **/
1818
+ public function product_cart_view() {
1819
+ if($this->disable_tracking($this->ga_eeT)){
1820
+ return;
1821
+ }
1822
+ global $woocommerce, $con_cart_item_list;
1823
+ foreach($woocommerce->cart->get_cart() as $key => $item){
1824
+ $product_id = $item["product_id"];
1825
+ $product = wc_get_product( $product_id );
1826
+ $remove_cart_item_link = "";
1827
+ if (version_compare($woocommerce->version, "3.3", "<")) {
1828
+ $remove_cart_item_link=html_entity_decode($woocommerce->cart->get_remove_url($key));
1829
+ } else {
1830
+ $remove_cart_item_link=html_entity_decode(wc_get_cart_remove_url($key));
1831
+ }
1832
+ $con_cart_item_list[] = $this->con_item_product(
1833
+ $product,
1834
+ array(
1835
+ "productlink" => get_permalink(),
1836
+ "quantity" => $item["quantity"],
1837
+ "remove_cart_link" => $remove_cart_item_link
1838
+ )
1839
+ );
1840
+ $con_cart_item_list["value"] = WC()->cart->total;
1841
+ }
1842
+ }
1843
+ /**
1844
+ * product checkout page
1845
+ **/
1846
+ public function checkout_step_view(){
1847
+ global $woocommerce, $con_checkout_cart_item_list;
1848
+ foreach($woocommerce->cart->get_cart() as $key => $item){
1849
+ $product_id = $item["product_id"];
1850
+ $product = wc_get_product( $product_id );
1851
+ $con_checkout_cart_item_list[] = $this->con_item_product(
1852
+ $product,
1853
+ array(
1854
+ "productlink" => get_permalink(),
1855
+ "quantity" => $item["quantity"]
1856
+ )
1857
+ );
1858
+ $con_checkout_cart_item_list["value"] = WC()->cart->total;
1859
+ }
1860
+ }
1861
+ /**
1862
+ * Thank You page
1863
+ **/
1864
+ public function product_thankyou_view($order_id = null){
1865
+ global $woocommerce, $con_ordered_item_list;
1866
+ $order = "";
1867
+ if($order_id == null && is_order_received_page()){
1868
+ $order = $this->tvc_get_order_from_order_received_page();
1869
+ $order_id = $order->get_id();
1870
+ }else{
1871
+ $order = new WC_Order($order_id);
1872
+ }
1873
+ if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1 || !is_order_received_page() ){
1874
+ return;
1875
+ }
1876
+ $order_items = $order->get_items();
1877
+ if ( $order_items ) {
1878
+ foreach ( $order_items as $item ) {
1879
+ $product = $item->get_product();
1880
+ $con_ordered_item_list[] = $this->con_item_product(
1881
+ $product,
1882
+ array(
1883
+ "productlink" => get_permalink(),
1884
+ "quantity" => $item["quantity"]
1885
+ )
1886
+ );
1887
+ }
1888
+ $con_ordered_item_list["value"] = esc_js($order->get_total());
1889
+ $con_ordered_item_list["transaction_id"] = esc_js($order->get_order_number());
1890
+ $con_ordered_item_list["affiliation"] = esc_js(get_bloginfo('name'));
1891
+ $con_ordered_item_list["tax"] = esc_js($order->get_total_tax());
1892
+ $con_ordered_item_list["shipping"] = esc_js($order->get_shipping_total());
1893
+ $con_ordered_item_list["coupon"] = esc_js(implode( ', ', ( $woocommerce->version > "3.7" ? $order->get_coupon_codes() : $order->get_used_coupons() ) ));
1894
+ }
1895
+ update_post_meta($order_id, "_tracked", 1);
1896
+ }
1897
+ /**
1898
+ * dataLayer for setting and GTM global tag
1899
+ **/
1900
+ public function add_gtm_begin_datalayer_js($data_layer){
1901
+ $has_html5_support = current_theme_supports( 'html5' );
1902
+ echo '<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . '>
1903
+ window.dataLayer = window.dataLayer || [];
1904
+ dataLayer.push(' . wp_json_encode( $data_layer ) . ');
1905
+ </script>';
1906
+ ?>
1907
+ <!-- Google Tag Manager -->
1908
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
1909
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
1910
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
1911
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
1912
+ })(window,document,'script','dataLayer','GTM-K7X94DG');</script>
1913
+ <!-- End Google Tag Manager -->
1914
+ <!-- Google Tag Manager (noscript) -->
1915
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K7X94DG"
1916
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
1917
+ <!-- End Google Tag Manager (noscript) -->
1918
+ <?php
1919
+ }
1920
+ /**
1921
+ * DataLayer to JS
1922
+ **/
1923
+ public function add_gtm_data_layer_js($data_layer){
1924
+ $has_html5_support = current_theme_supports( 'html5' );
1925
+ echo '<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . '>
1926
+ window.dataLayer = window.dataLayer || [];
1927
+ dataLayer.push(' . wp_json_encode( $data_layer ) . ');
1928
+ </script>
1929
+ ';
1930
+ }
1931
+
1932
+ public function enqueue_scripts(){
1933
+ wp_enqueue_script(esc_js($this->plugin_name), esc_url_raw(ENHANCAD_PLUGIN_URL . '/public/js/con-gtm-google-analytics.js'), array('jquery'), esc_js($this->version), false);
1934
+ }
1935
+ /**
1936
+ * Creat DataLyer object for create JS data layer
1937
+ **/
1938
+ public function add_gtm_data_layer(){
1939
+ if ($this->disable_tracking($this->ga_eeT)) {
1940
+ return;
1941
+ }
1942
+ $affiliation = get_bloginfo('name');
1943
+ $impression_threshold = $this->ga_imTh;
1944
+ global $con_view_item_list,$con_view_item,$con_cart_item_list,$con_checkout_cart_item_list,$con_ordered_item_list;
1945
+
1946
+ /**
1947
+ * Thankyou Page
1948
+ **/
1949
+ if(empty($con_ordered_item_list)){
1950
+ $con_ordered_item_list=array(); //define empty array so if empty
1951
+ }else{
1952
+ $dataLayer = array();
1953
+ $dataLayer["event"] = "purchase";
1954
+ if(!empty($con_ordered_item_list)){
1955
+ $dataLayer["ecommerce"]["transaction_id"] = (isset($con_ordered_item_list["transaction_id"]))?$con_ordered_item_list["transaction_id"]:"";
1956
+ $dataLayer["ecommerce"]["value"] = (isset($con_ordered_item_list["value"]))?$con_ordered_item_list["value"]:"";
1957
+ $dataLayer["ecommerce"]["affiliation"] = (isset($con_ordered_item_list["affiliation"]))?$con_ordered_item_list["affiliation"]:"";
1958
+ $dataLayer["ecommerce"]["tax"] = (isset($con_ordered_item_list["tax"]))?$con_ordered_item_list["tax"]:"";
1959
+ $dataLayer["ecommerce"]["shipping"] = (isset($con_ordered_item_list["shipping"]))?$con_ordered_item_list["shipping"]:"";
1960
+ $dataLayer["ecommerce"]["coupon"] = (isset($con_ordered_item_list["coupon"]))?$con_ordered_item_list["coupon"]:"";
1961
+
1962
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
1963
+ unset($con_ordered_item_list["transaction_id"]);
1964
+ unset($con_ordered_item_list["value"]);
1965
+ unset($con_ordered_item_list["affiliation"]);
1966
+ unset($con_ordered_item_list["tax"]);
1967
+ unset($con_ordered_item_list["shipping"]);
1968
+ unset($con_ordered_item_list["coupon"]);
1969
+ foreach($con_ordered_item_list as $key => $view_item){
1970
+ $dataLayer["ecommerce"]["items"][] =
1971
+ array(
1972
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
1973
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
1974
+ "affiliation" => $affiliation,
1975
+ "currency" => $this->ga_LC,
1976
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
1977
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
1978
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
1979
+ );
1980
+ }
1981
+ }
1982
+ $this->add_gtm_data_layer_js($dataLayer);
1983
+ }
1984
+ /**
1985
+ * Checkout Page
1986
+ **/
1987
+ if(empty($con_checkout_cart_item_list)){
1988
+ $con_checkout_cart_item_list=array(); //define empty array so if empty
1989
+ }else{
1990
+ $dataLayer = array();
1991
+ $dataLayer["event"] = "begin_checkout";
1992
+ if(!empty($con_checkout_cart_item_list)){
1993
+ if(isset($con_checkout_cart_item_list["value"]) && $con_checkout_cart_item_list["value"]){
1994
+ $dataLayer["ecommerce"]["value"] = $con_checkout_cart_item_list["value"];
1995
+ }
1996
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
1997
+ unset($con_checkout_cart_item_list["value"]);
1998
+ foreach($con_checkout_cart_item_list as $key => $view_item){
1999
+ $dataLayer["ecommerce"]["items"][] =
2000
+ array(
2001
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2002
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2003
+ "affiliation" => $affiliation,
2004
+ "currency" => $this->ga_LC,
2005
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
2006
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
2007
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
2008
+ );
2009
+ }
2010
+ }
2011
+ $this->add_gtm_data_layer_js($dataLayer);
2012
+
2013
+ $checkout_step_2_selector = ( isset( $this->c_t_o['tvc_checkout_step_2_selector']) && $this->c_t_o['tvc_checkout_step_2_selector'] == "custom" )?$this->c_t_o:array();
2014
+ $checkout_step_2_selector = $this->get_selector_val_from_array_for_gmt($checkout_step_2_selector, 'tvc_checkout_step_2_selector');
2015
+ $checkout_step_2_selector = ($checkout_step_2_selector)?$checkout_step_2_selector:"input[name=billing_first_name]";
2016
+
2017
+ $checkout_step_3_selector = ( isset( $this->c_t_o['tvc_checkout_step_3_selector']) && $this->c_t_o['tvc_checkout_step_3_selector'] == "custom" )?$this->c_t_o:array();
2018
+ $checkout_step_3_selector = $this->get_selector_val_from_array_for_gmt($checkout_step_3_selector, 'tvc_checkout_step_3_selector');
2019
+ $checkout_step_3_selector = ($checkout_step_3_selector)?$checkout_step_3_selector:"#place_order";
2020
+
2021
+ ?>
2022
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2023
+ jQuery( document.body ).on("focus", "<?php echo $checkout_step_2_selector; ?>", function(event){
2024
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2025
+ tvc_js.checkout_step_2_tracking();
2026
+ });
2027
+ jQuery( document.body ).on("click", "<?php echo $checkout_step_3_selector; ?>", function(event){
2028
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2029
+ tvc_js.checkout_step_3_tracking();
2030
+ });
2031
+ </script>
2032
+
2033
+ <?php
2034
+ }
2035
+ /**
2036
+ * Cart Page
2037
+ **/
2038
+ if(empty($con_cart_item_list)){
2039
+ $con_cart_item_list=array(); //define empty array so if empty
2040
+ }else{
2041
+ $dataLayer = array();
2042
+ $dataLayer["event"] = "view_cart";
2043
+ if(!empty($con_cart_item_list)){
2044
+ if(isset($con_cart_item_list["value"]) && $con_cart_item_list["value"]){
2045
+ $dataLayer["ecommerce"]["value"] = $con_cart_item_list["value"];
2046
+ }
2047
+ $dataLayer["ecommerce"]["currency"] = $this->ga_LC;
2048
+ unset($con_cart_item_list["value"]);
2049
+ foreach($con_cart_item_list as $key => $view_item){
2050
+ $dataLayer["ecommerce"]["items"][] =
2051
+ array(
2052
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2053
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2054
+ "affiliation" => $affiliation,
2055
+ "currency" => $this->ga_LC,
2056
+ "item_category" => isset($view_item["category"])?esc_js($view_item["category"]):"",
2057
+ "price" => isset($view_item["price"])?esc_js($view_item["price"]):"",
2058
+ "quantity" => isset($view_item["quantity"])?esc_js($view_item["quantity"]):""
2059
+ );
2060
+ }
2061
+ }
2062
+ $this->add_gtm_data_layer_js($dataLayer);
2063
+
2064
+ /*** Remove Cart item ***/
2065
+ ?>
2066
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2067
+ window.conCarttList = window.productList || [];
2068
+ conCarttList.push(<?php echo wp_json_encode($con_cart_item_list); ?>);
2069
+ jQuery( document.body ).on("click", "a[href*=\"?remove_item\"]", function(event){
2070
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2071
+ tvc_js.remove_item_click(this);
2072
+ });
2073
+ </script>
2074
+ <?php
2075
+ }
2076
+ /**
2077
+ * Product detail page
2078
+ **/
2079
+ if(empty($con_view_item)){
2080
+ $con_view_item=array(); //define empty array so if empty
2081
+ }else{
2082
+ $dataLayer = array();
2083
+ $dataLayer["event"] = "view_item";
2084
+ $dataLayer["ecommerce"]["items"][] =
2085
+ array(
2086
+ "item_id" => isset($con_view_item["id"])?esc_js($con_view_item["id"]):"",
2087
+ "item_name" => isset($con_view_item["name"])?esc_js($con_view_item["name"]):"",
2088
+ "affiliation" => $affiliation,
2089
+ "currency" =>$this->ga_LC,
2090
+ "item_category" =>isset($con_view_item["category"])?esc_js($con_view_item["category"]):"",
2091
+ "price" =>isset($con_view_item["price"])?esc_js($con_view_item["price"]):"",
2092
+ "quantity" => 1
2093
+ );
2094
+ $this->add_gtm_data_layer_js($dataLayer);
2095
+
2096
+ /*** Add to Cart product detail page ***/
2097
+ global $product,$woocommerce;
2098
+ $variations_data = array();
2099
+ if ( $product->is_type('variable') ) {
2100
+ $variations_data['default_attributes'] = $product->get_default_attributes();
2101
+ $variations_data['available_variations'] = $product->get_available_variations(); //get all child variations
2102
+ $variations_data['available_attributes'] = $product->get_variation_attributes();
2103
+ }
2104
+ $product_detail_addtocart_selector = ( isset( $this->c_t_o['tvc_product_detail_addtocart_selector']) && $this->c_t_o['tvc_product_detail_addtocart_selector'] == "custom" )?$this->c_t_o:array();
2105
+ ?>
2106
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2107
+ window.addEventListener('load', call_tvc_enhanced,true);
2108
+ function call_tvc_enhanced(){
2109
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2110
+ tvc_js.singleProductaddToCartEventBindings(<?php echo json_encode($variations_data); ?>,"<?php echo esc_js($this->get_selector_val_fron_array($product_detail_addtocart_selector, 'tvc_product_detail_addtocart_selector')); ?>");
2111
+ }
2112
+ </script>
2113
+ <?php
2114
+ }
2115
+
2116
+ /**
2117
+ * view_item_list
2118
+ **/
2119
+ if(empty($con_view_item_list)){
2120
+ $con_view_item_list=array(); //define empty array so if empty
2121
+ }else{
2122
+ $dataLayer = array();
2123
+ $dataLayer["event"] = "view_item_list";
2124
+ $items = array();
2125
+ if(!empty($con_view_item_list)){
2126
+ foreach($con_view_item_list as $key => $view_item){
2127
+ $items[] = array(
2128
+ "item_id" => isset($view_item["id"])?esc_js($view_item["id"]):"",
2129
+ "item_name" => isset($view_item["name"])?esc_js($view_item["name"]):"",
2130
+ "affiliation" => $affiliation,
2131
+ "currency" =>$this->ga_LC,
2132
+ "index" =>$key,
2133
+ "item_category" =>isset($view_item["category"])?esc_js($view_item["category"]):"",
2134
+ "price" =>isset($view_item["price"])?esc_js($view_item["price"]):"",
2135
+ "quantity" => 1
2136
+ );
2137
+ if(count($items) >= $impression_threshold || $key >= (count($con_view_item_list)-1) ){
2138
+ $dataLayer["ecommerce"]["items"] = $items;
2139
+ $this->add_gtm_data_layer_js($dataLayer);
2140
+ $items = array();
2141
+ }
2142
+ }
2143
+
2144
+ /*** Add to Cart, product List page ***/
2145
+ ?>
2146
+ <script data-cfasync="false" data-no-optimize="1" data-pagespeed-no-defer>
2147
+ window.conProductList = window.productList || [];
2148
+ conProductList.push(<?php echo wp_json_encode( $con_view_item_list); ?>);
2149
+ window.addEventListener('load', call_tvc_enhanced_1ist_product,true);
2150
+ function call_tvc_enhanced_1ist_product(){
2151
+ tvc_js = new TVC_GTM_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
2152
+ tvc_js.ListProductaddToCartEventBindings();
2153
+ tvc_js.ListProductSelectItemEventBindings();
2154
+ }
2155
+ </script>
2156
+ <?php
2157
+ }
2158
+ }
2159
+ }
2160
+ public function con_product_list_item_extra_tag($product, $listtype){
2161
+ global $wp_query, $woocommerce_loop;
2162
+ global $con_view_item_list;
2163
+
2164
+ if ( ! isset( $product ) ) {
2165
+ return;
2166
+ }
2167
+ if ( ! ( $product instanceof WC_Product ) ) {
2168
+ return false;
2169
+ }
2170
+ $product_id = $product->get_id();
2171
+ $product_cat = '';
2172
+ if ( is_product_category() ) {
2173
+ global $wp_query;
2174
+ $cat_obj = $wp_query->get_queried_object();
2175
+ $product_cat = $cat_obj->name;
2176
+ } else {
2177
+ $product_cat = $this->con_get_product_category( $product_id );
2178
+ }
2179
+
2180
+ if ( is_search() ) {
2181
+ $list_name = __( 'Search Results', 'duracelltomi-google-tag-manager' );
2182
+ } elseif ( '' !== $listtype ) {
2183
+ $list_name = $listtype;
2184
+ } else {
2185
+ $list_name = __( 'General Product List', 'duracelltomi-google-tag-manager' );
2186
+ }
2187
+ $itemix = '';
2188
+ if ( isset( $woocommerce_loop['loop'] ) && ( '' !== $woocommerce_loop['loop'] ) ) {
2189
+ $itemix = $woocommerce_loop['loop'];
2190
+ }
2191
+ $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
2192
+ $posts_per_page = get_query_var( 'posts_per_page' );
2193
+ if ( $posts_per_page < 1 ) {
2194
+ $posts_per_page = 1;
2195
+ }
2196
+ $item = $this->con_item_product(
2197
+ $product,
2198
+ array(
2199
+ 'productlink' => get_permalink(),
2200
+ 'listname' => $list_name,
2201
+ 'listposition' => (int) $itemix + ( $posts_per_page * ( $paged - 1 ) ),
2202
+ )
2203
+ );
2204
+ $con_view_item_list[]= $item;
2205
+ }
2206
+
2207
+ public function con_item_product( $product, $additional_product_attributes ) {
2208
+ global $gtm4wp_options;
2209
+ if ( ! $product ) {
2210
+ return false;
2211
+ }
2212
+
2213
+ if ( ! ( $product instanceof WC_Product ) ) {
2214
+ return false;
2215
+ }
2216
+
2217
+ $product_id = $product->get_id();
2218
+ $product_type = $product->get_type();
2219
+ $remarketing_id = $product_id;
2220
+ $product_sku = $product->get_sku();
2221
+
2222
+ if ( 'variation' === $product_type ) {
2223
+ $parent_product_id = $product->get_parent_id();
2224
+ $product_cat = $this->con_get_product_category( $parent_product_id);
2225
+ } else {
2226
+ $product_cat = $this->con_get_product_category( $product_id );
2227
+ }
2228
+
2229
+ $_temp_productdata = array(
2230
+ 'id' => $remarketing_id,
2231
+ 'name' => $product->get_title(),
2232
+ 'sku' => $product_sku ? $product_sku : $product_id,
2233
+ 'category' => $product_cat,
2234
+ 'price' => round( (float) wc_get_price_to_display( $product ), 2 ),
2235
+ 'stocklevel' => $product->get_stock_quantity(),
2236
+ );
2237
+
2238
+ if ( 'variation' === $product_type ) {
2239
+ $_temp_productdata['variant'] = implode( ',', $product->get_variation_attributes() );
2240
+ }
2241
+ return array_merge( $_temp_productdata, $additional_product_attributes );
2242
+ }
2243
+
2244
+ public function con_get_product_category_hierarchy( $category_id ) {
2245
+ $cat_hierarchy = '';
2246
+
2247
+ $category_parent_list = get_term_parents_list(
2248
+ $category_id,
2249
+ 'product_cat',
2250
+ array(
2251
+ 'format' => 'name',
2252
+ 'separator' => '/',
2253
+ 'link' => false,
2254
+ 'inclusive' => true,
2255
+ )
2256
+ );
2257
+
2258
+ if ( is_string( $category_parent_list ) ) {
2259
+ $cat_hierarchy = trim( $category_parent_list, '/' );
2260
+ }
2261
+
2262
+ return $cat_hierarchy;
2263
+ }
2264
+
2265
+ public function con_get_product_category( $product_id, $fullpath = false ) {
2266
+ $product_cat = '';
2267
+
2268
+ $_product_cats = wp_get_post_terms(
2269
+ $product_id,
2270
+ 'product_cat',
2271
+ array(
2272
+ 'orderby' => 'parent',
2273
+ 'order' => 'ASC',
2274
+ )
2275
+ );
2276
+
2277
+ if ( ( is_array( $_product_cats ) ) && ( count( $_product_cats ) > 0 ) ) {
2278
+ $first_product_cat = array_pop( $_product_cats );
2279
+ if ( $fullpath ) {
2280
+ $product_cat = $this->con_get_product_category_hierarchy( $first_product_cat->term_id );
2281
+ } else {
2282
+ $product_cat = $first_product_cat->name;
2283
+ }
2284
+ }
2285
+
2286
+ return $product_cat;
2287
+ }
2288
  }
public/js/con-gtm-google-analytics.js ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ 'use strict';
3
+ /**
4
+ * This enables you to define handlers, for when the DOM is ready:
5
+ * $(function() { });
6
+ * When the window is loaded:
7
+ * $( window ).load(function() { });
8
+ */
9
+ })( jQuery );
10
+ class TVC_GTM_Enhanced {
11
+ constructor(options = {}){
12
+ this.options = {
13
+ tracking_option: 'UA'
14
+ };
15
+ if(options){
16
+ Object.assign(this.options, options);
17
+ }
18
+ //console.log(this.options);
19
+ //this.addEventBindings();
20
+ }
21
+ singleProductaddToCartEventBindings(variations_data, product_detail_addtocart_selector){
22
+ var single_btn = "";
23
+ if(product_detail_addtocart_selector != ""){
24
+ single_btn = document.querySelectorAll("button[class*='btn-buy-shop'],button[class*='single_add_to_cart_button'], button[class*='add_to_cart']"+product_detail_addtocart_selector);
25
+ }else{
26
+ single_btn = document.querySelectorAll("button[class*='btn-buy-shop'],button[class*='single_add_to_cart_button'], button[class*='add_to_cart']");
27
+ }
28
+ if(single_btn.length > 0){
29
+ single_btn[0].addEventListener("click", () => this.add_to_cart_click(variations_data, "Product Pages"));
30
+ }
31
+ }
32
+ ListProductaddToCartEventBindings(){
33
+ var elements = "";
34
+ elements = document.querySelectorAll("a[href*=add-to-cart]");
35
+ if(elements.length > 0){
36
+ for (var i = 0; i < elements.length; i++) {
37
+ if(elements[i]){
38
+ elements[i].addEventListener("click", () => this.list_add_to_cart_click());
39
+ }
40
+ }
41
+ }
42
+ }
43
+ ListProductSelectItemEventBindings(){
44
+ var elements = "";
45
+ elements = document.querySelectorAll("a:not([href*=add-to-cart],.product_type_variable, .product_type_grouped");
46
+ if(elements.length > 0){
47
+ for (var i = 0; i < elements.length; i++) {
48
+ if(elements[i]){
49
+ elements[i].addEventListener("click", () => this.list_select_item_click());
50
+ }
51
+ }
52
+ }
53
+ }
54
+ RemoveItemCartEventBindings(){
55
+ var elements = "";
56
+ elements = document.querySelectorAll("a[href*=\"?remove_item\"]");
57
+ if(elements.length > 0){
58
+ for(var i = 0; i < elements.length; i++){
59
+ if(elements[i]){
60
+ elements[i].addEventListener("click", () => this.remove_item_click());
61
+ }
62
+ }
63
+ }
64
+ }
65
+ /*
66
+ * check remarketing option
67
+ */
68
+ is_add_remarketing_tags(){
69
+ if(this.options.is_admin == false && this.options.ads_tracking_id != "" && ( this.options.remarketing_tags == 1 || this.options.dynamic_remarketing_tags == 1)){
70
+ return true;
71
+ }else{
72
+ return false;
73
+ }
74
+ }
75
+
76
+ get_variation_data_by_id(variations_data, variation_id){
77
+ //console.log(variations_data.available_variations)
78
+ var r_val = "";
79
+ if(variations_data.available_variations.length > 0 ){
80
+ variations_data.available_variations.forEach((element, index) => {
81
+ if(element.variation_id == variation_id){
82
+ r_val = element;
83
+ }
84
+ });
85
+ return r_val;
86
+ //console.log(variations_data.available_variations)
87
+ }
88
+ }
89
+ get_variation_attribute_name(p_attributes){
90
+ //console.log(p_attributes);
91
+ var p_v_title = "";
92
+ if(Object.keys(p_attributes).length >0 ){
93
+ for(var index in p_attributes) {
94
+ p_v_title+=(p_v_title=="")?p_attributes[index]:' | '+p_attributes[index];
95
+ }
96
+ return p_v_title;
97
+ }
98
+ }
99
+ get_event_data_layer(event_name){
100
+ if(event_name != ""){
101
+ if(Object.keys(dataLayer).length >0 ){
102
+ for(var dataLayer_item in dataLayer){
103
+ event = dataLayer[dataLayer_item].event;
104
+ if(event_name == event){
105
+ return dataLayer[dataLayer_item];
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ get_product_from_product_list(product_id){
112
+ if(product_id != ""){
113
+ if(Object.keys(conProductList).length >0 ){
114
+ for(var dataLayer_item in conProductList[0]){
115
+ if(conProductList[0][dataLayer_item].hasOwnProperty('id')){
116
+ var id = conProductList[0][dataLayer_item].id;
117
+ if(product_id == id){
118
+ return conProductList[0][dataLayer_item];
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ get_product_from_product_list_by_url(prod_obj, key, product_url){
126
+ if(product_url != ""){
127
+ if(Object.keys(prod_obj).length >0 ){
128
+ for(var dataLayer_item in prod_obj[0]){
129
+ if(prod_obj[0][dataLayer_item].hasOwnProperty(key)){
130
+ var map_val = prod_obj[0][dataLayer_item][key];
131
+ if(product_url == map_val){
132
+ return prod_obj[0][dataLayer_item];
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ list_select_item_click(){
140
+ var this_var = event.currentTarget;
141
+ var href = this_var.getAttribute( 'href' );
142
+ var item = this.get_product_from_product_list_by_url(conProductList, 'productlink', href);
143
+ var add_to_cart_datalayer = {
144
+ event: "select_item",
145
+ ecommerce: {
146
+ items: [
147
+ {
148
+ affiliation: this.options.affiliation,
149
+ item_id: item.id,
150
+ item_name: item.name,
151
+ currency: this.options.currency,
152
+ item_category: item.category,
153
+ price: item.price,
154
+ quantity: 1
155
+ }]
156
+ }
157
+ };
158
+ dataLayer.push(add_to_cart_datalayer);
159
+ }
160
+ remove_item_click(this_var){
161
+ var href = this_var.getAttribute( 'href' );
162
+ if(href){
163
+ var item = this.get_product_from_product_list_by_url(conCarttList, 'remove_cart_link', href);
164
+ var add_to_cart_datalayer = {
165
+ event: "remove_from_cart",
166
+ ecommerce: {
167
+ items: [
168
+ {
169
+ affiliation:this.options.affiliation,
170
+ item_id:item.id,
171
+ item_name:item.name,
172
+ currency:this.options.currency,
173
+ item_category:item.category,
174
+ price:item.price,
175
+ quantity:item.quantity
176
+
177
+ }]
178
+ }
179
+ };
180
+ dataLayer.push(add_to_cart_datalayer);
181
+ }
182
+
183
+ }
184
+ list_add_to_cart_click(){
185
+ var this_var = event.currentTarget;
186
+ var href = this_var.getAttribute( 'href' );
187
+ var product_id = this.getParameterByName("add-to-cart",href);
188
+ var item = this.get_product_from_product_list(product_id);
189
+ var add_to_cart_datalayer = {
190
+ event: "add_to_cart",
191
+ ecommerce: {
192
+ items: [
193
+ {
194
+ affiliation:this.options.affiliation,
195
+ item_id:item.id,
196
+ item_name:item.name,
197
+ currency:this.options.currency,
198
+ item_category:item.category,
199
+ price:item.price,
200
+ quantity:1
201
+ }]
202
+ }
203
+ };
204
+ dataLayer.push(add_to_cart_datalayer);
205
+ }
206
+ getParameterByName(name, url = window.location.href){
207
+ name = name.replace(/[\[\]]/g, '\\$&');
208
+ var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
209
+ results = regex.exec(url);
210
+ if (!results) return null;
211
+ if (!results[2]) return '';
212
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
213
+ }
214
+ /*
215
+ * below code run while add to cart on product page.
216
+ * ( Event=> add_to_cart)
217
+ */
218
+ add_to_cart_click( variations_data, page_type ="Product Pages" ){
219
+ var this_var = event.currentTarget;
220
+ var item_dataLayer = this.get_event_data_layer("view_item");
221
+ if(this.options.is_admin == true){
222
+ return;
223
+ }
224
+ if(Object.keys(item_dataLayer.ecommerce.items[0]).length > 0){
225
+ var item = item_dataLayer.ecommerce.items[0];
226
+ var variation_attribute_name= "";
227
+ var vari_data ="";
228
+ var variation_id = "";
229
+ var variation_id_obj = document.getElementsByClassName("variation_id");
230
+ if (variation_id_obj.length > 0) {
231
+ variation_id = document.getElementsByClassName("variation_id")[0].value;
232
+ }
233
+ if(variation_id != ""){
234
+ vari_data = this.get_variation_data_by_id(variations_data, variation_id);
235
+ var p_attributes = vari_data.attributes;
236
+ if( Object.keys(p_attributes).length > 0){
237
+ variation_attribute_name = this.get_variation_attribute_name(p_attributes);
238
+ }
239
+ if(vari_data.display_price){
240
+ varPrice = vari_data.display_price;
241
+ }else if(vari_data.display_regular_price){
242
+ varPrice = vari_data.display_regular_price;
243
+ }
244
+ }
245
+ var varPrice = item.price;
246
+ var add_to_cart_datalayer = {
247
+ event: "add_to_cart",
248
+ ecommerce: {
249
+ items: [
250
+ {
251
+ affiliation:item.affiliation,
252
+ item_id:item.item_id,
253
+ item_name:item.item_name,
254
+ currency:item.currency,
255
+ item_category:item.item_category,
256
+ price:varPrice,
257
+ quantity:jQuery(this_var).parent().find("input[name=quantity]").val(),
258
+ item_variant:variation_attribute_name
259
+
260
+ }]
261
+ }
262
+ };
263
+ dataLayer.push(add_to_cart_datalayer);
264
+ }
265
+ }
266
+ /*
267
+ *
268
+ */
269
+ checkout_step_2_tracking(){
270
+ var item_dataLayer = this.get_event_data_layer("begin_checkout");
271
+ if(this.options.is_admin == true){
272
+ return;
273
+ }
274
+ if(Object.keys(item_dataLayer.ecommerce.items[0]).length > 0){
275
+ var checkout_step_2_datalayer = {
276
+ event: "add_shipping_info",
277
+ ecommerce: {
278
+ currency: this.options.currency,
279
+ value: item_dataLayer.ecommerce.value,
280
+ items: item_dataLayer.ecommerce.items
281
+ }
282
+ };
283
+ dataLayer.push(checkout_step_2_datalayer);
284
+ }
285
+ console.log(dataLayer);
286
+ }
287
+ checkout_step_3_tracking(){
288
+ var item_dataLayer = this.get_event_data_layer("begin_checkout");
289
+ if(this.options.is_admin == true){
290
+ return;
291
+ }
292
+ if(Object.keys(item_dataLayer.ecommerce.items[0]).length > 0){
293
+ var checkout_step_3_datalayer = {
294
+ event: "add_payment_info",
295
+ ecommerce: {
296
+ currency: this.options.currency,
297
+ value: item_dataLayer.ecommerce.value,
298
+ items: item_dataLayer.ecommerce.items
299
+ }
300
+ };
301
+ dataLayer.push(checkout_step_3_datalayer);
302
+ }
303
+ }
304
+
305
+ getCurrentTime(){
306
+ if (!Date.now) {
307
+ return new Date().getTime();
308
+ }else{
309
+ //Math.floor(Date.now() / 1000)
310
+ return Date.now();
311
+ }
312
+ }
313
+ getClientId() {
314
+ let client_id = this.getCookie("_ga");
315
+ if(client_id != null && client_id != ""){
316
+ return client_id;
317
+ }else{
318
+ return ;
319
+ }
320
+ }
321
+ setCookie(name,value,days) {
322
+ var expires = "";
323
+ if (days) {
324
+ var date = new Date();
325
+ date.setTime(date.getTime() + (days*24*60*60*1000));
326
+ expires = "; expires=" + date.toUTCString();
327
+ }
328
+ document.cookie = name + "=" + (value || "") + expires + "; path=/";
329
+ }
330
+ getCookie(name) {
331
+ var nameEQ = name + "=";
332
+ var ca = document.cookie.split(";");
333
+ for(var i=0;i < ca.length;i++) {
334
+ var c = ca[i];
335
+ while (c.charAt(0)==" ") c = c.substring(1,c.length);
336
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
337
+ }
338
+ return null;
339
+ }
340
+ eraseCookie(name) {
341
+ document.cookie = name +"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
342
+ }
343
+ }
readme.txt CHANGED
@@ -1,49 +1,110 @@
1
- === Actionable Google Analytics and Google Shopping plugin for WooCommerce ===
2
  Contributors: Tatvic, Conversios
3
- Plugin Name: Enhanced Ecommerce for WooCommerce Store
4
  Plugin URI: https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
- Tags: Google Analytics tracking, Dynamic Remarketing, Google Shopping automation,Google Shopping, Universal Analytics tracking,Google Analytics integration,Google Analytics integration for WooCommerce,Ecommerce tracking, google analytics 4 tracking, google shopping feed, Web Analytics, Web Analytics For WooCommerce, WooCommerce Enhanced Ecommerce, WooCommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
  Author URI: https://conversios.io/
7
  Author: Tatvic
8
  Requires at least: 4.6
9
- Tested up to: 6.0.2
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 4.9.4
12
- Version: 4.9.4
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
16
- An all in one WooCommerce marketing plugin that automates Google Analytics (GA4), Google Shopping, remarketing and conversion pixel, actionable dashboard to boost your sales and many more.
17
 
18
  == Product Description ==
19
 
20
- https://www.youtube.com/watch?v=OWTXa6_nQgI&rel=0
21
-
22
- ###GOOGLE ANALYTICS INTEGRATION FOR WOOCOMMERCE
23
-
24
- The new and enhanced Ecommerce Google Analytics Plugin for WooCommerce is there to help you - Know, Measure and Track What Matters To Your Business.
25
-
26
- As a Premium Google Ads Partner, we are delighted to bring a new and enhanced Google Analytics Integration Plugin that does all your eCommerce tracking in Google Analytics(UA+GA4). We have 40000+ active eCommerce businesses across 150 countries using, benefitting, growing from this plugin. The plugin is ready and compatible with Google Analytics 4 (GA4)
27
-
28
- Opening an e-commerce store is only the starting, to run it efficiently, to drive traffic to your website, and increase conversions, you have to do one more thing and that is to know your shoppers and what is thier shopping behavoir!
29
-
30
- And how will you do that? Well, Start with Understanding, Measuring, tracking their journey and thier shopping preferences with the help of Google Analytics Tracking for WooCommerce.
31
-
32
- * Know your users likes & preferences, via a simple Google analytics dashboard
33
- * Track them and understand thier shopping behavior and products, with implementation of Google analytics tags
34
- * Offer them better experiences,while running google shopping campaigns
35
- * Simplify their shopping process and help them buy running dynamic remarketing
36
- * Remove all the obstacles that slow down user conversion
37
-
38
- The enhanced eCommerce Google Analytics plugin for WooCommerce will show you all the statistics that matters. The plugin is apt in helping global eCommerce businesses scale faster by integrating eCommerce tracking in Google Analytics for both the Universal Analytics (Google Analytics v3) and the Google Analytics 4 properties.
39
-
40
- ###AUTOMATE DYNAMIC REMARKETING TAGS FOR ECOMMERCE EVENTS - NEW FEATURE OF THE GOOGLE SHOPPING PLUGIN FOR WOOCOMMERCE
41
-
42
- Check the recent release of the Enhanced Ecommerce Google Analytics plugin for WooCommerce, loaded with new features!
43
-
44
- * Dynamic Remarketing tags for eCommerce events and Google Shopping solution features include management of Google Merchant Center account.
45
- * Seamless product sync from your WooCommerce stores.
46
- * Link Google Ads and Google Merchant Center account, Smart Shopping Campaign management, and Shopping Campaign report.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  ###USER MANUAL
49
  <a target="_blank" href="https://conversios.io/help-center/Installation-Manual.pdf">Here is how you can configure the plugin without any hassle and start scaling your eCommerce business faster.</a>
@@ -58,133 +119,8 @@ Check the recent release of the Enhanced Ecommerce Google Analytics plugin for W
58
  - CURCY: Multi Currency for WooCommerce
59
  - WBW Currency Switcher for WooCommerce
60
 
61
- ###YOU GET BIG BENEFITS
62
-
63
- eCommerce businesses can -
64
-
65
- * Start making data-driven decisions with UA+GA4, google analytics dashboard
66
- * Re-targeting the shoppers based on their past site behaviour.
67
- * Help them run google ads with the help of Pmax and increase product reach
68
- * Become eligible for free listing across Google to reach millions of interested shoppers across the web via sync with Google merchant center .
69
- * Run your google shopping campaigns smoothly.
70
-
71
- Achieve all this by connecting Google Analytics, Google Ads, and Google Merchant Center accounts with Conversios on single click. Want to know what is the best part?
72
-
73
- * NO CODING, NO DEVELOPER required for any kind of setup. You can configure the plugin instantly in under 5 minutes and with a few clicks from your WordPress backend.
74
-
75
-
76
- New users can get $500 in Ad Credits when they spend their first $500 on Google Ads within 60 days. (amount differs based on the country you are in) <a target="_blank" href ="https://conversios.io/help-center/new-google-spend-match.pdf">See terms and condition.</a>
77
-
78
- ###AN INTERESTING AMALGAM OF - GOOGLE ANALYTICS (UA+GA4) + ENHANCED ECOMMERCE REPORTS - THE BEST YOU CAN GET!
79
-
80
- Enhanced eCommerce Google analytics plugin tracks the entire user journey on your eCommerce store from the home page to product views and from cart page to checkout page to thank you page.
81
-
82
- * Accurate conversion tracking with Google analytics - For any eCommerce business, the most important thing is to know the accurate conversion %. Know the accurate conversion % for your eCommerce store and you have visibility on the entire eCommerce funnel to better channel marketing and UX/UI efforts to reach an optimum conversion %.<a target="_blank" href="http://prntscr.com/1qv1ktl"> See Sample Report.</a>
83
-
84
- * Check product performance through Google analytics - Using this plugin, you can track your merchandising efforts by monitoring how certain products are performing on the home page or the product listing page and make better and well-informed merchandising decisions. <a target="_blank" href="http://prntscr.com/1qv1r1d"> See Sample Report.</a>
85
-
86
- * View-to-conversion ratio via Google analytics - You can track which products have a better view-to-cart ratio or a better view-to-conversion ratio, and based on this data, make better and well-informed pricing or product decisions. <a target="_blank" href="http://prntscr.com/1qv1r1d"> See Sample Report.</a>
87
-
88
- * Product and cart performance through Google analytics - Track users who are abandoning the cart, which products are abandoned more in the cart, etc., and reach out to the users or update your product listing. <a target="_blank" href="http://prntscr.com/1qv1r1d"> See Sample Report.</a>
89
-
90
- * Checkout behavior through Google analytics - You can track the performance of your checkout form and accordingly work on the UI/UX to increase the conversion rate for your eCommerce business. <a target="_blank" href="http://prntscr.com/1qv1vsp"> See Sample Report.</a>
91
-
92
- * The best part is, you can track every impression and click of the product from which page they are added to the cart, how users interact with your checkout page before making the final purchase by our new and enhanced eCommerce Google analytics plugin.
93
-
94
- ### GOOGLE ANALYTICS + AUDIENCE REPORTS + BEHAVIOUR REPORTS + ACQUISITION REPORTS
95
-
96
- * Audience reports help know your customers in a whole new way in Google analytics. It gives you much-needed detailed insights like - from which countries your users are coming from, their age, gender, interests, devices, and much more. Considering this, you can easily set up your content and design to match your audience preferences. <a target="_blank" href="http://prntscr.com/1qv1zsu"> See Sample Report.</a>
97
-
98
- * Behaviour reports help you get to know how users are interacting with your website, how much time they are spending, how much they browse before making a final purchase, and a whole lot more. <a target="_blank" href="http://prntscr.com/1qv226n"> See Sample Report.</a>
99
-
100
- * Acquisition reports tell you which sources are attributing the traffic to your website, their performance when it comes to conversion, and much more. You can channel your efforts in better marketing ROI.<a target="_blank" href="http://prntscr.com/1qv23ws"> See Sample Report.</a>
101
-
102
-
103
- ###GOOGLE SHOPPING FOR WOOCOMMERCE
104
-
105
- * Get your WooCommerce products in front of the millions of shoppers across Google via Google shopping and Google ads .
106
-
107
- * Opt your product data into programmes, like surfaces across Google, Google merchant center, Shopping ads, local inventory ads, and Shopping Actions, and highlight your products to shoppers across Google.
108
-
109
- * Reach out to customers leaving your WooCommerce store by running Smart Google shopping campaigns based on their past site behavior.<a target="_blank" href = "https://support.google.com/faqs/answer/2987537?hl=en"> Learn more about Google Shopping</a>
110
-
111
- ###HOW IT WORKS
112
-
113
- * Step 1: Create or connect Google Merchant Center account using the plugin
114
-
115
- * Step 2: Sync your WooCommerce products seamlessly from your wordpress backend to Merchant Center account from plugin's interface
116
-
117
- * Step 3: Link your Google Ads account with Merchant Center account for dynamic remarketing and smart shopping campaigns
118
-
119
-
120
- = Features of Plugin =
121
-
122
- 1. Quick & Easy 5 minutes installation from the WordPress interface to your woocommerce store
123
- 2. Data collection in Google Analytics 4 property in order to get ready for next generation analytics
124
- * eCommerce events tracking like product impressions, product clicks, product detail page view, add to cart, remove from cart, checkout steps tracking and purchase on home page, category page, product listing page, product detail page, cart page, checkout page, and order confirmation page
125
- 3.Enables 4 Enhanced Ecommerce reports in Google Analytics
126
- * Shopping Behaviour Report (Google Analytics 3)
127
- * Checkout Behaviour Report (Google Analytics 3)
128
- * Product Performance Report (Google Analytics 3)
129
- * Sales Performance Report (Google Analytics 3)
130
- * Enables Audience, Acquisition & Behaviour reports in Google Analytics in Universal Analytics
131
- * Supports Guest checkout functionality (Google Analytics v3 and Google analytics 4)
132
- * Captures Product Impressions, Add to Cart & Product Clicks events on category page (Google Analytics v3 and Google analytics 4)
133
- * Captures Product Impressions, Add to Cart & Product Clicks events on product page (Google Analytics v3 and Google analytics 4)
134
- * Captures Product Impressions, Add to Cart & Product Clicks events on featured Product Section on Homepage (Google Analytics v3 and Google analytics 4)
135
- * Captures Product Impressions, Add to Cart & Product Clicks events on Recent Product Section on Homepage (Google Analytics v3 and Google analytics 4)
136
- * Captures Product Impressions, Add to Cart & Product Clicks events on Related Product Section on Product page (Google Analytics v3 and Google analytics 4)
137
- * Captures checkout behaviour of users in Google Analytics under Conversion > Ecommerce > Checkout behaviour report (Google Analytics v3 and Google analytics 4)
138
- 4. User can select and opt for eCommerce tracking in both Universal Analytics and Google Analytics 4 properties
139
- 5. Google Ads account linking with Google Analytics property in order to have better insights on your ad spends in Google analytics reports
140
- 6. Capture transaction/conversion information in Google analytics under Conversion > Ecommerce > Sales performance report
141
- 7. Set your local currency
142
- 8. Google Analytics Opt Out
143
- 9. IP Anonymization
144
- 10. Dynamic remarketing tags integration and automation for eCommerce events like view_item_list, view_item, add_to_cart and purchase
145
- 11. Remarketing tags automation for all pages
146
- 12. Create and manage Google Merchant Center Account and auto linking of Google Ads and Google Merchant Center account for smart shopping and shopping campaigns
147
- 13. Automatic site verification and domain claim for Google Merchant Center account
148
- 14. Seamless product sync from wordpress backend to Google Merchant Center account in order to opt for Surfaces across Google and Google Shopping.
149
- 15. Automatic price and inventory update for your WooCommerce products to Merchant Center account
150
- 16. Smart Shopping Campaign creation and management from Wordpress backend
151
- 17. Shopping campaign performance dashboard
152
- 18. Product Sync dashboard
153
- 19. Facebook Pixel Conversion Tracking (Basic ecommerce events)
154
- 20. PMAX, Performance Max is a new goal-based campaign type that allows performance advertisers to access all of their Google Ads inventory from a single campaign
155
-
156
  <strong><a target="_blank" href="https://conversios.io/pricings/?utm_source=EE+Plugin+Wordpress+Listing&utm_medium=Below+Free+Features&utm_campaign=Upsell+at+Conversios"> Fast track and scale your eCommerce business to new heights by unlocking more advanced tracking and enabling complete google shopping solutions for your WooCommerce store. Give a try to our pro version.</a></strong>
157
 
158
-
159
- == Features of our <a target="_blank" href=" https://conversios.io/pricings/?utm_source=EE+Plugin+Wordpress+Listing&utm_medium=Below+Free+Features2&utm_campaign=Upsell+at+Conversios">pro version</a>: ==
160
-
161
- * All the features included in Enhanced ecommerce Google analytics plugin
162
- * Additional 5 enhanced ecommerce reports in Google Analytics: Overview, product list performance report, order coupon report, Internal promotion report, product coupon report, Affiliate code report
163
- * Complete eCommerce tracking for google analytics 4 tracking
164
- * You can track both google analytics 4 and universal analytics properties for your WooCommerce store
165
- * Google ads conversion tracking
166
- * 20 custom dimensions and metrics tracking in your google analytics properties
167
- * User id and client id tracking for cross device user tracking
168
- * Form field tracking
169
- * Content grouping
170
- * 404 tracking
171
- * Opt in/ consent compatibility with WP GDPR compliance, borlabs cookies etc.
172
- * Complete google shopping solution
173
- * Sync your WooCommerce products seamlessly in your merchant center account from your wp admin
174
- * Schedule automatic product feed updates
175
- * Google merchant center account management and creation from the wp admin
176
- * Link your google ads and google merchant center account
177
- * Create and manage smart shopping campaigns from the wp admin
178
- * Smart shopping campaign reports
179
- * Compatibility with other widely used plugins
180
- * Child theme compatibility
181
- * Premium support
182
- * Free GA audit
183
- * Consultation with Google Shopping expert to set up and enhance campaigns
184
- * CRO consultation (Boost your eCommerce conversation with proven hypothesis) (Paid)
185
- * Customization as per your requirements(Paid)
186
- * Facebook Pixel Conversion Tracking
187
- * Order refund tracking for Google Analytics GA4 and GA3
188
  <strong><a target="_blank" href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Reach+out+to+us+with+your+query+Link&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">Reach out to us with your query here for a faster solution.</a></strong>
189
 
190
 
@@ -249,173 +185,49 @@ After following the above steps, you will lose the claim for your previously ver
249
  After following the above steps, the plugin will automatically claim and verify the website domain in your connected Google merchant center account.
250
 
251
 
252
- = What is Google Analytics4? =
253
 
254
  Google Analytics4 is a completely new avatar of Google Analytics that uses event driven data model designed to capture data from your webstore and mobile applications. The reports generated in Google Analytics4 are based on new data model introduced.
255
 
256
- = Can I use the plugin only for Google Analytics4 tracking? =
257
-
258
- "Yes, you can use the plugin for Google Analytics4 tracking. However, we suggest to enable the tracking for UA and GA4, both as Google recommends to use the Universal Analytics inorder to be sure about the tracked data in GA4. Further, you can monitor the data in Universal Analytics & Google Analytics4 and when you are sure about the correct data collection in GA4 then you can completely migrate."
259
-
260
- = How can I create Universal Analytics(Google Analytics3) property id in new Google Analytics account? =
261
-
262
- Navigate to <a href="https://prnt.sc/vy4j1i">Admin -> Create Property -> click 'Show advanced options</a> in your Google Analytics account and create a new UA- property id under the Advanced Options.
263
-
264
- = Where can I find the setting for this plugin? =
265
-
266
- Once the plugin is activated, the <a href="https://prnt.sc/10jpyh6">Settings option</a> can be found under the plugin - "Enhanced E-commerce for Woocommerce store" listed in the installed plugins.
267
-
268
- = Do I Need to add any custom code for it? =
269
-
270
- No, as our plugin automatically inserts the GA tracking code and tracks all the Enhanced Ecommerce data on your store. So, you don’t need to add any custom/manual code to track Ecommerce events.
271
 
272
  = Does this plugin match with GDPR compliance? =
273
 
274
  Yes, our plugin is under GDPR compliance. For more information, read the <a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woocommerce_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">privacy policy</a> of our plugin.
275
 
276
- = Why are my PayPal transaction data not getting recorded in GA? =
277
-
278
- If you are facing this issue, please check if you have configured auto return in PayPal settings. Configuring auto return will resolve your issue. Here’s a PayPal <a href="https://www.paypal.com/in/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside" target="_blank">documentation</a> & WooCommerce <a href="http://docs.woothemes.com/document/paypal-standard/#section-5" target="_blank">documentation</a> on understanding & setting up Auto Return.
279
-
280
- In case you have already configured auto return for your store and facing the issue then you could <a href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=PayPal+transaction+FAQ&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">reach out to us</a>
281
-
282
- = I’ve install the plugin but I do not see any data in my GA =
283
-
284
- "Following are one or more reasons:
285
-
286
- (1) You need to make sure that you have enabled Enhanced Ecommerce setting in your GA Account. If you have not enabled then follow the below steps:
287
-
288
- -> Go to Admin section of your Google Analytics Account
289
- -> In the view section, click on Ecommerce Settings
290
- -> Switch on the Enhanced Ecommerce Settings button
291
-
292
-
293
- Note: If you do not see the above setting, it means that you are still on the waiting list and you may have to wait till Google rolls out this for your web property
294
-
295
- (2) If the Enhanced Ecommerce setting is enabled in your GA and you have just installed our plugin, then please wait for at-least 24 hours before you start seeing any data in your GA. If you still face this issue after 24 hours, please <a href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=do+not+see+any+data+in+my+GA+FAQ&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">reach out to us</a>."
296
-
297
- = Does your plugin supports new Global Site Tag (gtag.js)? =
298
-
299
- Yes our plugin supports the new Global Site Tag (gtag.js).
300
-
301
- = Since I have Implemented Old GA Script (UA Script) Manually in my store, I didn't enable Add Global site Tracking Code option gtag.js, but seems that it is not working. =
302
-
303
- "When you have the UA script/tag implemented via your GTM, it may happen sometimes that the script might take/make any delay in loading on your store and due to which our plugin may not work well on your store.
304
-
305
- Reason :
306
-
307
- Our Plugin’s script works/fetches the data based on the GTAG’s default tracker (‘gtag’ in the case of Universal Analytics script used in our plugin). While you implement the UA tracking script from your GTM, the script in your store may not be able to initialize the tracker, which in turn will hinder the plugin from populating insights in your Analytics account."
308
-
309
- = Where I can see my all Enhanced Ecommerce Reports (Eg. Sales Report,Product Performance Report)? =
310
-
311
- You can find all the Enhanced Ecommerce Reports in your Analytics Account under the Reports -> Conversions –> Ecommerce section.
312
-
313
- = Products with variant not getting recorded in GA =
314
-
315
- Currently our plugin does not support products with variants & hence you may not see their transaction data in GA. This feature is only available with the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Products+with+variant+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin.
316
-
317
  = Does this plugin provide Google Ads Conversion Tracking? =
318
 
319
  The free version of our plugin does not provide Google Ads Conversion Tracking feature. This feature is only available with the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Google+Ads+Conversion+Tracking+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin.
320
 
321
- = Why some transactions are missing in my GA account, compared to my WooCommerce backend (Orders) =
322
-
323
- Possible reasons for not getting the accurate Transactions (in sales performance report of GA) are as below :
324
-
325
- - If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page.
326
-
327
- - If the thankyou page URL structure is not as per the standard WooCommerce implementation. The standard thankyou page URL structure should be like: www.domain.name/checkout/order-received/99999/?key=wc_order_XXXXXXXXXXXXX
328
-
329
- - If any javascript error is detected on the “thank you” page of your store which may restrict plugin’s code to get executed further.
330
-
331
- - Some browsers and common ad blocking programs block certain JavaScripts
332
- (including GA’s script), which means Google Analytics is unable to record transactions.
333
-
334
- - The user has left the page before the transaction has had a chance to send to Google Analytics.
335
-
336
- Additionally, GA is a trend analysis tool, and as such cannot be expected to be 100% accurate. However, if the variance is greater than 10-12%, there might be an issue with the coding!"
337
-
338
- = Why my Ecommerce transaction data are not getting recorded in GA? =
339
-
340
- User needs to check if you have auto return configured in your payment gateway settings. If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page, our plugin will not be able to send the order transaction data. Hence, this may result into missing order transaction data in your GA. You can resolve this issue by configuring auto return in your payment gateway settings.
341
-
342
- = Does this plugin help me create/configure goals/funnels in my GA account? =
343
-
344
- Configuring goals are out of the scope of our plugin. Our plugin is designed to track checkout funnels only.
345
-
346
- = Does your plugin support a Multilingual Wordpress site? =
347
-
348
- Our plugin supports a Multilingual Wordpress site.
349
-
350
- = Does your plugin supports Child/Custom Theme? =
351
-
352
- The free version of our plugin is not fully compatible with the child/custom theme. Request you to go through the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Child%2FCustom+Theme+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin which is fully compatible with the child/custom theme. We are not providing any kind of support for Child/Custom Theme in the Free version of our plugin. For more information kindly contact us at info(at)conversios(dot)io.
353
-
354
- = Does Tatvic provide full support for the free version plugin? =
355
-
356
- We have a limited support policy for the free version of our plugin. Kindly go through the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=full+support+for+the+free+version+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin to get full support for the product or you can also contact us at info(at)conversios(dot)io.
357
-
358
- = How to verify if I have implemented the plugin well? =
359
-
360
- User can install and activate the dataslayer extension available for Chrome(<a href="https://chrome.google.com/webstore/detail/dataslayer/ikbablmmjldhamhcldjjigniffkkjgpo">link</a>) and Firefox(<a href="https://addons.mozilla.org/en-US/firefox/addon/dataslayer-firefox/">link</a>) browsers and can see the tracked data under a new 'dataslayer' tab that appears in the Developer tools. Here is the <a href="https://prnt.sc/10jqc64">screenshot link</a> for reference.
361
-
362
  = How much time will it take to see the data in Google Analytics? =
363
 
364
  It generally depends upon the store traffic. But in general it may take max up to 24 hours & min 4 hours to see the data in Google Analytics.
365
 
366
- = Why does the plugin not send data when I am logged in as an Admin? =
367
-
368
- To avoid sending your own transaction data or session data in Google Analytics, our plugin doesn't send the data to GA when you are logged in. Having said that, if you are logged in as a Shop Manager, plugin will send the data to GA.
369
-
370
- = The tracking via the plugin doesn't work as I am getting 'gtag.js not defined' error in the console? =
371
-
372
- The error occurs because the gtag snippet for GA tracking snippet is missing on the store.
373
-
374
- And the most probable cause it is the option “Add Global Site Tracking Code ‘gtag.js' under the configuration settings of the plugin is unchecked.You need to check this option to resolve the error and the tracking via the plugin would start working.
375
-
376
  = Can I use my own GTM with this plugin? =
377
 
378
  User can use his own GTM, provided the data which the plugin tracks should not be tracked by the custom tags and triggers and if such tags and triggers are their then please remove them to prevent the data duplication issue.
379
 
380
- = Why some eCommerce steps(like Add_To_Cart, Product_View etc.) on my store are not getting tracked? =
381
-
382
- The following are general reason due to which the tracking may not be working at some eCommerce steps:
383
-
384
- * If the eCommerce steps do not follow the standard WooCommerce implmentation and were implemented via a custom child theme. Our plugin works completely when all the eCommerce steps in a store follow the standard WooCommerce implementation.
385
-
386
- * If there is/are of jQuery error(s) in the console. Occurance of jQuery error blocks the loading of GA tracking snippet via the plugin.
387
-
388
- * If there is js minification implemented using a cache plugin. The js minification blocks the loading of GA tracking snippet via the plugin.
389
-
390
  = Why some or all data are getting duplicated on my store? =
391
 
392
  There could be duplicate tracking via manually implemented GA tracking snippet and/or other GA tracking plugin and/or GTM implementation.
393
 
394
- You can resolve the duplication of data by removing the manually implemented GA tracking snippet and/or other GA tracking plugin. The duplication of tracking via GTM can be resolved by removing the custom tags and triggers which track the duplicate data
395
-
396
- = What is the use of order refunds?/Does this plugin track refund orders? =
397
-
398
- Yes, it does. It helps in tracking the amount of refund given in a specific time period to make data-driven decisions.
399
-
400
- = What kind of order refund does conversios support? =
401
-
402
- Conversios supports both kinds of refunds namely full and partial refunds.
403
-
404
- = Where can the user check the order refunds? =
405
 
406
- User can check the same from our Google Analytics (Universal Analytics and GA4) reports.
407
-
408
- = What do you need to use for order refunds in GA3 (Universal Analytics) and GA4? =
409
-
410
- In GA3 Plugin automatically captures the full as well as partial refund transactions, where nothing is to be changed in terms of settings/code level in the plugin. In GA4, tracking happens based on API hits hence in GA4 - the API secret key needs to be updated to the backend from Google Analytics.
411
-
412
- = How much time will it take to push the refund data to Google analytics? =
413
-
414
- In GA3 (Universal Analytics) usually, it takes 0 to 45 mins and in GA4 it can take 24 to 48 hours from the time of refund is made in woocommerce.
415
 
 
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
 
418
- == Changelog ==
419
  = 4.9.4 - 06/10/2022 =
420
  * Enhancement: Latest optimization will create smooth on-boarding for new and returning users, decreasing the page load time for configuration of Google analytics, Google ads and GMC accounts.
421
  * We also changed our Conversios GA and Google shopping Plugin Menu structure for better flow and easy naming convention.
1
+ === All-in-one Analytics, Pixels and Product Feed Manager for WooCommerce ===
2
  Contributors: Tatvic, Conversios
3
+ Plugin Name: All-in-one Analytics, Pixels and Product Feed Manager for WooCommerce
4
  Plugin URI: https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
+ Tags: Google Analytics tracking, Dynamic Remarketing, FB pixel, snapchat pixel, tiktok pixel, pinterest pixel, Microsoft ads pixel, Twitter pixel, Google Tag Manager, GTM, Google Shopping automation,Google Shopping, Universal Analytics tracking,Google Analytics integration,Google Analytics integration for WooCommerce,Ecommerce tracking, google analytics 4 tracking, google shopping feed, Web Analytics, Web Analytics For WooCommerce, WooCommerce Enhanced Ecommerce, WooCommerce Google Analytics, Google Analytics Plugin
6
  Author URI: https://conversios.io/
7
  Author: Tatvic
8
  Requires at least: 4.6
9
+ Tested up to: 6.0.3
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 5.0.0
12
+ Version: 5.0.0
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
16
+ Track visitors,conversions and build audiences for WooCommerce Google Analytics,Google Ads,FB Pixel,Bing,Snapchat,Pinterest,Tiktok via Google Tag Manager. Automate your product feed to Google Merchant Center for running performance max campaigns for your products to boost ROAS (Revenue on Ad Spends).
17
 
18
  == Product Description ==
19
 
20
+ This is an all-in-one marketing plugin for WooCommerce stores. Over the last 6 years and after speaking with thousands of happy customers, we have built rich and useful features to cater to most of your ecommerce marketing needs so that you do not have to rely on multiple plugins for your WooCommerce shops.
21
+
22
+ ###AN INTERESTING AMALGAM OF ANALYTICS, PIXEL INTEGRATIONS, PRODUCT FEEDS AND INSIGHTS DASHBOARD
23
+
24
+ ###Features:
25
+ 1. Google Tag Manager based implementation for faster page load
26
+ 2. Use your own Google Tag Manager account with the plugin for full control over all the tags (64 tags), triggers and variables <strong>(PRO)</strong>
27
+ 3. Optional gtag.js based implementation (If you do not want to use Google Tag Manager based implementation)
28
+ 4. One click <strong>Google Analytics Ecommerce tracking</strong> automation. It tracks following events:
29
+ * All page tracking (Home page, Product listing page, Product detail page, Cart, Checkout, Order Confirmation page etc.)
30
+ * All important ecommerce events like:
31
+ * Product listing tracking (view_item_list event)
32
+ * Product click tracking (select_content event)
33
+ * Product detail page tracking (view_item event)
34
+ * Add to cart tracking (add_to_cart event)
35
+ * Remove from cart tracking (remove_from_cart event)
36
+ * Checkout steps tracking (begin_checkout, checkout_step2,checkout_step3,checkout_step4 events)
37
+ * Conversion/order confirmation tracking (Purchase event)
38
+ 5. Insightful Google Analytics reporting dashboard inside your wordpress admin panel
39
+ 6. One click <strong>Google Analytics 4 Ecommerce tracking</strong> automation. It tracks following events:
40
+ * All page tracking (Home page, Product listing page, Product detail page, Cart, Checkout, Order Confirmation page etc.)
41
+ * All important ecommerce events like:
42
+ * Product listing tracking (view_item_list event)
43
+ * Product click tracking (select_item event)
44
+ * Product detail page tracking (view_item event)
45
+ * Add to cart tracking (add_to_cart event)
46
+ * Remove from cart tracking (remove_from_cart event)
47
+ * Checkout steps tracking (begin_checkout, add_shipping_info, add_payment_info events)
48
+ * Conversion/order confirmation tracking (Purchase event)
49
+ 7. Insightful Google Analytics 4 reporting dashboard inside your wordpress admin panel
50
+ 8. Google Ads Remarketing, Dynamic Remarketing and Conversion tracking
51
+ * Google ads dynamic remarketing tags for ecommerce events
52
+ * Product clicks
53
+ * Product views
54
+ * Add to carts
55
+ * Checkout
56
+ * Purchase
57
+ * Google Ads conversion tracking <strong>(Pro)</strong>
58
+ * Google Ads enhanced conversion tracking <strong>(Pro)</strong>
59
+ 9. <strong>Meta pixel (Facebook + Instagram) integration</strong> for ecommerce events like:
60
+ * Product view
61
+ * Add to carts
62
+ * Checkout
63
+ * Purchase
64
+ 10. <strong>Microsoft Ads pixel integration</strong> for ecommerce events like:
65
+ * Page view
66
+ * Product view
67
+ * Add to carts
68
+ * Checkout
69
+ * Purchase
70
+ 11. <strong>Pinterest pixel integration</strong> for ecommerce events like:
71
+ * Product views
72
+ * Checkouts
73
+ * Purchase
74
+ 12. <strong>Snapchat pixel integration</strong> for ecommerce events like:
75
+ * Product view
76
+ * Add to cart
77
+ * Checkout
78
+ * Purchase
79
+ * Page view
80
+ 13. <strong>Tiktok pixel integration (beta)</strong> for ecommerce events like:
81
+ * Add to carts
82
+ * Purchase
83
+ * Base pixel on all pages
84
+ 14. <strong>Twitter pixel integration</strong> for ecommerce events like:
85
+ * Page views
86
+ * Add to cart
87
+ * Checkout
88
+ * Add payment info
89
+ * Purchase
90
+ 15. <strong>Facebook Conversion API integration (Upcoming)</strong>
91
+ 16. <strong>Server side tagging (Upcoming)</strong>
92
+ 17. 100% automation of running product ads on Google
93
+ * Google merchant center account management
94
+ * Site verification
95
+ * Domain claim
96
+ * Link Google merchant center with Google ads account
97
+ * Performance max campaign management for higher ROAS
98
+ 18. Product feed manager for Google Merchant Center
99
+ * Sync unlimited products from your WooCommerce shop to Google Merchant Center using powerful and real time content API
100
+ * Batch wise product sync that is compatible for 100000+ number of products
101
+ * Schedule your product updates <strong>(Daily/Weekly) (PRO)</strong>
102
+ 19. More filters to select products for sync in Merchant Center <strong>(Upcoming)</strong>
103
+ 20. Product feed manager for Facebook catalog <strong>(Upcoming)</strong>
104
+ 21. Product feed manager for Microsoft catalog <strong>(Upcoming)</strong>
105
+ 22. Product feed manager for Snapchat, Pinterest and Tiktok catalog <strong>(Upcoming)</strong>
106
+ 23. Insightful reporting dashboard in wordpress backend for data driven decision making for your ecommerce business
107
+ 24. Schedule email reporting <strong>(Upcoming)</strong>
108
 
109
  ###USER MANUAL
110
  <a target="_blank" href="https://conversios.io/help-center/Installation-Manual.pdf">Here is how you can configure the plugin without any hassle and start scaling your eCommerce business faster.</a>
119
  - CURCY: Multi Currency for WooCommerce
120
  - WBW Currency Switcher for WooCommerce
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  <strong><a target="_blank" href="https://conversios.io/pricings/?utm_source=EE+Plugin+Wordpress+Listing&utm_medium=Below+Free+Features&utm_campaign=Upsell+at+Conversios"> Fast track and scale your eCommerce business to new heights by unlocking more advanced tracking and enabling complete google shopping solutions for your WooCommerce store. Give a try to our pro version.</a></strong>
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  <strong><a target="_blank" href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Reach+out+to+us+with+your+query+Link&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">Reach out to us with your query here for a faster solution.</a></strong>
125
 
126
 
185
  After following the above steps, the plugin will automatically claim and verify the website domain in your connected Google merchant center account.
186
 
187
 
188
+ = What is Google Analytics 4? =
189
 
190
  Google Analytics4 is a completely new avatar of Google Analytics that uses event driven data model designed to capture data from your webstore and mobile applications. The reports generated in Google Analytics4 are based on new data model introduced.
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  = Does this plugin match with GDPR compliance? =
194
 
195
  Yes, our plugin is under GDPR compliance. For more information, read the <a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woocommerce_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">privacy policy</a> of our plugin.
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  = Does this plugin provide Google Ads Conversion Tracking? =
198
 
199
  The free version of our plugin does not provide Google Ads Conversion Tracking feature. This feature is only available with the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Google+Ads+Conversion+Tracking+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin.
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  = How much time will it take to see the data in Google Analytics? =
202
 
203
  It generally depends upon the store traffic. But in general it may take max up to 24 hours & min 4 hours to see the data in Google Analytics.
204
 
 
 
 
 
 
 
 
 
 
 
205
  = Can I use my own GTM with this plugin? =
206
 
207
  User can use his own GTM, provided the data which the plugin tracks should not be tracked by the custom tags and triggers and if such tags and triggers are their then please remove them to prevent the data duplication issue.
208
 
 
 
 
 
 
 
 
 
 
 
209
  = Why some or all data are getting duplicated on my store? =
210
 
211
  There could be duplicate tracking via manually implemented GA tracking snippet and/or other GA tracking plugin and/or GTM implementation.
212
 
 
 
 
 
 
 
 
 
 
 
 
213
 
 
 
 
 
 
 
 
 
 
214
 
215
+ == Changelog ==
216
 
217
+ = 5.0.0 - 20/10/2022 =
218
+ * Conversios is geared up for this festive season and with that Conversios is coming up with an array of much demanded features for its users.
219
+ * Conversios is the best plugin available in the market for Google Analytics tracking for WooCommerce stores. It is for sure the fastest and the most efficient (95% accuracy guaranteed) plugin for data collection in Google Analytics and GA4.
220
+ * At Conversios, we thrive to be your one stop solution for all the MarTech needs and keeping that in focus, we are bringing up 2 major feature updates that many of you were demanding for a while.
221
+ * What are we bringing for you?
222
+ Google Tag Manager based single click implementation for Google Analytics, Google Analytics 4, and multiple ad pixel integrations like Meta, Snapchat, Tiktok, Pinterest, Google Ads, Twitter, Microsoft Bing Ads
223
+ Use your own Google Tag Manager account with the conversios plugin.
224
+ * What will you get out of it?
225
+ 1. Google Tag Manager based implementation helps in data collection accuracy and you have more control over your tags implemented on the website.
226
+ 2. Many website’s page speed decreases because of gtag.js implementation as it renders multiple Javascripts on the website. Google Tag Manager based implementation uses datalayer to push data to GA or other ad channels and it renders only once on your web page. Hence, your site speed will be intact with this approach.
227
+ 3. Debugging which events are tracking correctly or not becomes a lot easier in Google Tag Manager based implementation. Hence, less possibility of data leakage from your web store and more insights from the visitors.
228
+ 4. Google Tag Manager based implementation will prepare you for the next privacy-centric industry revolution leveraging first party cookies. Sooner or later stores like yours will have to go for server side tagging. GTM based implementation is our first step for you in that direction.
229
+ 5. If you want us to add any other pixel in the plugin, shout out and that will be done in 3 business days.
230
 
 
231
  = 4.9.4 - 06/10/2022 =
232
  * Enhancement: Latest optimization will create smooth on-boarding for new and returning users, decreasing the page load time for configuration of Google analytics, Google ads and GMC accounts.
233
  * We also changed our Conversios GA and Google shopping Plugin Menu structure for better flow and easy naming convention.