Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.9.4

Version Description

  • 06/10/2022 =
  • 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.
  • We also changed our Conversios GA and Google shopping Plugin Menu structure for better flow and easy naming convention.
Download this release

Release Info

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

Code changes from version 4.9.3 to 4.9.4

admin/class-conversios-admin.php CHANGED
@@ -242,19 +242,19 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
242
  'manage_options',
243
  'conversios' );
244
  add_submenu_page(
245
- 'conversios',
246
- esc_html__('Google Shopping', 'enhanced-e-commerce-for-woocommerce-store'),
247
- esc_html__('Google Shopping', 'enhanced-e-commerce-for-woocommerce-store'),
248
- 'manage_options',
249
- 'conversios-google-shopping-feed',
250
- array($this, 'showPage')
251
  );
252
  add_submenu_page(
253
  'conversios',
254
- esc_html__('Google Ads', 'enhanced-e-commerce-for-woocommerce-store'),
255
- esc_html__('Google Ads', 'enhanced-e-commerce-for-woocommerce-store'),
256
  'manage_options',
257
- 'conversios-google-ads',
258
  array($this, 'showPage')
259
  );
260
  add_submenu_page(
@@ -265,14 +265,6 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
265
  'conversios-pmax',
266
  array($this, 'showPage')
267
  );
268
- add_submenu_page(
269
- 'conversios',
270
- esc_html__('Account Settings', 'enhanced-e-commerce-for-woocommerce-store'),
271
- esc_html__('Account Settings', 'enhanced-e-commerce-for-woocommerce-store'),
272
- 'manage_options',
273
- 'conversios-google-analytics',
274
- array($this, 'showPage')
275
- );
276
 
277
  add_submenu_page(
278
  'conversios',
242
  'manage_options',
243
  'conversios' );
244
  add_submenu_page(
245
+ 'conversios',
246
+ esc_html__('Pixel Settings', 'enhanced-e-commerce-for-woocommerce-store'),
247
+ esc_html__('Pixel Settings', 'enhanced-e-commerce-for-woocommerce-store'),
248
+ 'manage_options',
249
+ 'conversios-google-analytics',
250
+ array($this, 'showPage')
251
  );
252
  add_submenu_page(
253
  'conversios',
254
+ esc_html__('Product Sync', 'enhanced-e-commerce-for-woocommerce-store'),
255
+ esc_html__('Product Sync', 'enhanced-e-commerce-for-woocommerce-store'),
256
  'manage_options',
257
+ 'conversios-google-shopping-feed',
258
  array($this, 'showPage')
259
  );
260
  add_submenu_page(
265
  'conversios-pmax',
266
  array($this, 'showPage')
267
  );
 
 
 
 
 
 
 
 
268
 
269
  add_submenu_page(
270
  'conversios',
admin/class-conversios-onboarding.php CHANGED
@@ -114,14 +114,12 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
114
  $ee_additional_data['ee_last_login'] = sanitize_text_field(current_time( 'timestamp' ));
115
  $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
116
 
117
- $this->is_refresh_token_expire = false;
118
- ?>
119
- <script type="text/javascript">
120
  jQuery(document).ready(function () {
121
  user_tracking_data('sign_in', 'null' ,'conversios_onboarding','Google_Sing_in');
122
  });
123
- </script>
124
- <?php
125
  }
126
  }
127
 
@@ -252,6 +250,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
252
  </div>
253
  <!-- step-0 over -->
254
  <!-- step-1 start -->
 
255
  <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
256
  <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-1']); ?>" id="google-analytics" data-id="step_1">
257
  <div class="stepleftround">
@@ -273,40 +272,72 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
273
  <span class="checkmark"></span>
274
  <?php esc_html_e("Universal Analytics (Google Analytics 3)","enhanced-e-commerce-for-woocommerce-store"); ?>
275
  </label>
276
- <div id="UA" class="slctunivr-filed">
277
- <div class="tvc-dropdown">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
279
  echo esc_attr($googleDetail->property_id);
280
  }else{?><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
281
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
282
  <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
283
- <div class="tvc-ua-option-more option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
284
- </div>
285
  </div>
286
-
 
 
287
  </div>
288
  </div>
289
- <div class="cstmrdobtn-item">
290
- <label for="gglanytc">
291
- <input type="radio" <?php echo esc_attr($this->is_checked($tracking_option, "GA4")); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
292
- <span class="checkmark"></span>
293
- <?php esc_html_e("Google Analytics 4","enhanced-e-commerce-for-woocommerce-store"); ?>
294
- </label>
295
- <div id="GA4" class="slctunivr-filed">
296
-
297
- <div class="tvc-dropdown">
298
- <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-name="" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
299
- <?php if($googleDetail->measurement_id){
300
- echo esc_attr($googleDetail->measurement_id);
301
- }else{?><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?>
302
- <?php } ?></div>
303
- <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
304
- <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
305
- <div class="tvc-ga4-option-more option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
306
- </div>
307
- </div>
308
-
309
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  </div>
311
  <div class="cstmrdobtn-item">
312
  <label for="both">
@@ -315,37 +346,65 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
315
  <?php esc_html_e("Both","enhanced-e-commerce-for-woocommerce-store"); ?>
316
  </label>
317
  <div id="BOTH" class="slctunivr-filed">
318
- <div class="botslectbxitem">
319
-
320
- <div class="tvc-dropdown">
321
- <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
322
- echo esc_attr($googleDetail->property_id);
323
- }else{?><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
324
- <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
325
- <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
326
- <div class="tvc-ua-option-more option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
327
- </div>
 
328
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
 
330
- </div>
331
- <div class="botslectbxitem">
332
-
333
- <div class="tvc-dropdown">
334
- <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-name="" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
335
- <?php if($googleDetail->measurement_id){
336
- echo esc_attr($googleDetail->measurement_id);
337
- }else{?><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?>
338
- <?php } ?></div>
339
- <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
340
- <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
341
- <div class="tvc-ga4-option-more option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
342
- </div>
343
  </div>
344
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  <div id="old_tracking" data-tracking_option="<?php echo esc_attr($tracking_option); ?>" data-measurement_id="<?php echo esc_attr($googleDetail->measurement_id); ?>" data-property_id="<?php echo esc_attr($googleDetail->property_id); ?>"></div>
346
  </div>
347
  </div>
348
- </div>
349
  <div class="form-row">
350
  <h5><?php esc_html_e("Advance Settings (Optional)","enhanced-e-commerce-for-woocommerce-store"); ?></h5>
351
  <div class="chckbxbgbx">
@@ -373,7 +432,10 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
373
  </form>
374
  </div>
375
  </div>
376
- </div>
 
 
 
377
  <!-- step-1 over -->
378
  <!-- step-2 start -->
379
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
@@ -392,10 +454,12 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
392
  <div class="selcttopwrap" id="tvc_ads_section">
393
  <div class="ggladsselectbx">
394
  <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?esc_attr($googleDetail->google_ads_id):""; ?>">
395
- <select class="slect2bx google_ads_sel" id="ads-account" name="customer_id">
396
  <option value=''><?php esc_html_e("Select Google Ads Account","enhanced-e-commerce-for-woocommerce-store"); ?></option>
397
  </select>
398
  </div>
 
 
399
  <div class="orwrp"><?php esc_html_e("or","enhanced-e-commerce-for-woocommerce-store"); ?></div>
400
  <div class="creatnewwrp">
401
  <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","enhanced-e-commerce-for-woocommerce-store"); ?></button>
@@ -492,10 +556,12 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
492
  </div>
493
  <div id="tvc_merchant_section">
494
  <div class="ggladsselectbx">
495
- <select class="slect2bx" id="google_merchant_center_id" name="google_merchant_center_id">
496
  <option value=''><?php esc_html_e("Select Google Merchant Center","enhanced-e-commerce-for-woocommerce-store"); ?></option>
497
  </select>
498
  </div>
 
 
499
  <div class="orwrp"><?php esc_html_e("or","enhanced-e-commerce-for-woocommerce-store"); ?></div>
500
  <div class="creatnewwrp">
501
  <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","enhanced-e-commerce-for-woocommerce-store"); ?></button>
@@ -506,6 +572,9 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
506
  <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
507
  <!-- add dslbbtn class for disable button -->
508
  </div>
 
 
 
509
  <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?esc_attr($googleDetail->google_merchant_center_id):""; ?>">
510
  <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo esc_attr($login_customer_id); ?>">
511
  <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo esc_attr($this->subscriptionId); ?>">
@@ -516,12 +585,12 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
516
  </form>
517
  </div>
518
  <div class="stepnotewrp">
519
- <?php esc_html_e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at Google Merchant Center Help website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
520
  </div>
521
  </div>
522
  </div>
523
  <!-- step-3 over -->
524
- </div>
525
  <!-- onborading left over -->
526
  <!-- onborading right panel start -->
527
  <div class="onbording-right">
@@ -751,6 +820,20 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
751
  </div>
752
  </div>
753
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  $this->page_script();
755
  }
756
  /**
@@ -765,6 +848,37 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
765
  let subscription_id ="<?php echo esc_attr($this->subscriptionId); ?>";
766
  let plan_id ="<?php echo esc_attr($this->plan_id); ?>";
767
  let app_id ="<?php echo esc_attr($this->app_id); ?>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768
  /**
769
  * Convesios custom script
770
  */
@@ -795,44 +909,49 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
795
  jQuery(document).ready(function() {
796
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
797
  if(tracking_option != ""){
798
- if(subscription_id != ""){
799
- call_list_analytics_web_properties(tracking_option, tvc_data);
800
- }
801
  jQuery(".slctunivr-filed").slideUp();
802
  jQuery("#"+tracking_option).slideDown();
803
- //is_validate_step("step_1");
804
- }
805
- var ua_page =2;
806
- var ga4_page =2;
807
- jQuery('.tvc-ua-option-more').click(function(event){
808
- //let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
809
- call_list_analytics_web_properties("UA", tvc_data, ua_page);
810
  ua_page++;
811
- event.stopPropagation();
812
- })
813
- jQuery('.tvc-ga4-option-more').click(function(event){
814
- //let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
815
- call_list_analytics_web_properties("GA4", tvc_data, ga4_page);
816
- ga4_page++;
817
- event.stopPropagation();
818
  })
819
-
820
  jQuery("input[type=radio][name=analytic_tag_type]").on( "change", function() {
821
  let tracking_option = this.value;
822
- if(subscription_id != ""){
823
- call_list_analytics_web_properties(tracking_option, tvc_data);
824
- is_validate_step("step_1");
825
- }
826
  jQuery(".slctunivr-filed").slideUp();
827
  jQuery("#"+tracking_option).slideDown();
828
  });
829
  });
830
- if(subscription_id != ""){
831
- call_list_googl_ads_account(tvc_data);
832
- call_list_google_merchant_account(tvc_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
833
  }
834
 
835
- //Step-2
 
 
 
 
 
 
836
  // create google ads account
837
  jQuery("#ads-continue").on('click', function(e){
838
  e.preventDefault();
@@ -846,6 +965,11 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
846
  go_next(jQuery("#step_2"));
847
  });
848
  //Step - 3
 
 
 
 
 
849
  jQuery("#create_merchant_account").on('click', function(e){
850
  e.preventDefault();
851
  create_google_merchant_center_account(tvc_data);
@@ -879,6 +1003,64 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
879
  }
880
  }
881
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
882
  //Click confirm button on confirm popup
883
  jQuery('#confirm_selection').on('click', function(e){
884
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
@@ -908,9 +1090,9 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
908
  }else{
909
  location.replace( "admin.php?page=conversios-google-analytics");
910
  }
911
- user_tracking_data('complate_onboard', error_msg,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
912
  }else{
913
- user_tracking_data('complate_onboard', response.errors,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
914
  loaderSection(false);
915
  }
916
  }
@@ -944,10 +1126,10 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
944
  }else{
945
  location.replace( "admin.php?page=conversios-google-analytics");
946
  }
947
- user_tracking_data('complate_onboard', response.errors,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
948
  }else{
949
  loaderSection(false);
950
- user_tracking_data('complate_onboard', 'null','cnversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
951
  }
952
  }
953
  });
@@ -983,7 +1165,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
983
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
984
  save_analytics_web_properties( tracking_option, tvc_data, subscription_id );
985
  go_next(this);
986
- call_list_google_merchant_account(tvc_data);
987
  }
988
  }
989
  //step 2 next button call
114
  $ee_additional_data['ee_last_login'] = sanitize_text_field(current_time( 'timestamp' ));
115
  $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
116
 
117
+ $this->is_refresh_token_expire = false;
118
+ /*<script type="text/javascript">
 
119
  jQuery(document).ready(function () {
120
  user_tracking_data('sign_in', 'null' ,'conversios_onboarding','Google_Sing_in');
121
  });
122
+ </script>*/
 
123
  }
124
  }
125
 
250
  </div>
251
  <!-- step-0 over -->
252
  <!-- step-1 start -->
253
+
254
  <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
255
  <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-1']); ?>" id="google-analytics" data-id="step_1">
256
  <div class="stepleftround">
272
  <span class="checkmark"></span>
273
  <?php esc_html_e("Universal Analytics (Google Analytics 3)","enhanced-e-commerce-for-woocommerce-store"); ?>
274
  </label>
275
+ <div id="UA" class="slctunivr-filed">
276
+ <div class="tvc-multi-dropdown">
277
+ <div id="tvc-ua-acc-edit_box" class="tvc-dropdown tvc-edit-accounts <?php if($googleDetail->ua_analytic_account_id){ ?> tvc-disable-edits <?php } ?>">
278
+ <div class="tvc-dropdown-header" id="ua_account_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>"><?php if($googleDetail->ua_analytic_account_id){
279
+ echo esc_attr($googleDetail->ua_analytic_account_id);
280
+ }else{?><?php esc_html_e("Select UA Account Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
281
+ <div class="tvc-dropdown-content" id="ua_account_id_option">
282
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select UA Account Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
283
+ <div class="tvc_load_more_acc option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
284
+ </div>
285
+ </div>
286
+ <?php if($googleDetail->ua_analytic_account_id){?>
287
+ <button id="tvc-ua-acc-edit" class="tvc-onboardEdit tvc-edit-acc_fire"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button><?php } ?>
288
+ </div>
289
+ <div class="tvc-multi-dropdown">
290
+ <div id="tvc-ua-web-edit_box" class="tvc-dropdown <?php if($googleDetail->property_id){ ?> tvc-disable-edits <?php } ?>">
291
  <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
292
  echo esc_attr($googleDetail->property_id);
293
  }else{?><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
294
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
295
  <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
296
+ </div>
 
297
  </div>
298
+ <?php if($googleDetail->ua_analytic_account_id && $googleDetail->property_id){?>
299
+ <button id="tvc-ua-web-edit" class="tvc-property-edit-btn tvc-onboardEdit" data-type ="UA" data-accountid="<?php echo esc_attr($googleDetail->ua_analytic_account_id); ?>"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button>
300
+ <?php } ?>
301
  </div>
302
  </div>
303
+
304
+ <div class="cstmrdobtn-item">
305
+ <label for="gglanytc">
306
+ <input type="radio" <?php echo esc_attr($this->is_checked($tracking_option, "GA4")); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
307
+ <span class="checkmark"></span>
308
+ <?php esc_html_e("Google Analytics 4","enhanced-e-commerce-for-woocommerce-store"); ?>
309
+ </label>
310
+ <div id="GA4" class="slctunivr-filed">
311
+ <div class="tvc-multi-dropdown">
312
+ <div id="tvc-ga4-acc-edit-acc_box" class="tvc-dropdown tvc-edit-accounts <?php if($googleDetail->ga4_analytic_account_id){ ?> tvc-disable-edits <?php } ?>">
313
+ <div class="tvc-dropdown-header" id="ga4_account_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>">
314
+ <?php if($googleDetail->ga4_analytic_account_id){
315
+ echo esc_attr($googleDetail->ga4_analytic_account_id);
316
+ }else{?><?php esc_html_e("Select GA4 Analytics Account","enhanced-e-commerce-for-woocommerce-store"); ?>
317
+ <?php } ?></div>
318
+ <div class="tvc-dropdown-content" id="ga4_account_id_option">
319
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select GA4 Analytics Account","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
320
+ <div class="tvc_load_more_acc option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
321
+ </div>
322
+ </div>
323
+ <?php if($googleDetail->ga4_analytic_account_id){?>
324
+ <button id="tvc-ga4-acc-edit-acc" class="tvc-onboardEdit tvc-edit-acc_fire"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button>
325
+ <?php } ?>
326
+ </div>
327
+ <div class="tvc-multi-dropdown">
328
+ <div id="tvc-ga4-web-edit_box" class="tvc-dropdown <?php if($googleDetail->measurement_id){ ?> tvc-disable-edits <?php } ?>" style="display: flex;flex-direction: column;">
329
+ <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-profileid="" data-name="" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
330
+ <?php if($googleDetail->measurement_id){
331
+ echo esc_attr($googleDetail->measurement_id);
332
+ }else{?><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?>
333
+ <?php } ?></div>
334
+ <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
335
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
336
+ </div>
337
+ </div>
338
+ <?php if($googleDetail->ga4_analytic_account_id && $googleDetail->measurement_id){?>
339
+ <button id="tvc-ga4-web-edit" data-type ="GA4" data-accountid="<?php echo esc_attr($googleDetail->ga4_analytic_account_id); ?>" class="tvc-property-edit-btn tvc-onboardEdit"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button><?php } ?>
340
+ </div>
341
  </div>
342
  <div class="cstmrdobtn-item">
343
  <label for="both">
346
  <?php esc_html_e("Both","enhanced-e-commerce-for-woocommerce-store"); ?>
347
  </label>
348
  <div id="BOTH" class="slctunivr-filed">
349
+ <div class="tvc-multi-dropdown">
350
+ <div id="both-tvc-ua-acc-edit_box" class="botslectbxitem tvc-edit-accounts <?php if($googleDetail->ua_analytic_account_id){ ?> tvc-disable-edits <?php } ?>" style="margin: 0px 5px 0px 0px;">
351
+ <div class="tvc-dropdown">
352
+ <div class="tvc-dropdown-header" id="both_ua_account_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>"><?php if($googleDetail->ua_analytic_account_id){
353
+ echo esc_attr($googleDetail->ua_analytic_account_id);
354
+ }else{?><?php esc_html_e("Select UA Account Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
355
+ <div class="tvc-dropdown-content" id="both_ua_account_id_option">
356
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select UA Account Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
357
+ <div class="tvc_load_more_acc option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
358
+ </div>
359
+ </div>
360
  </div>
361
+ <div id="both-tvc-ua-web-edit_box" class="botslectbxitem <?php if($googleDetail->property_id){ ?> tvc-disable-edits <?php } ?>" >
362
+ <div class="tvc-dropdown">
363
+ <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-profileid="" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>">
364
+ <?php if($googleDetail->property_id){
365
+ echo esc_attr($googleDetail->property_id);
366
+ }else{?><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?>
367
+ <?php } ?> </div>
368
+ <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
369
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
370
+ </div>
371
+ </div>
372
+ </div>
373
+
374
+ <button id="both-tvc-ua-acc-edit" class="tvc-onboardEdit tvc-edit-acc_fire"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button>
375
+ </div>
376
 
377
+ <div class="tvc-multi-dropdown">
378
+ <div id="both-tvc-ga4-acc-edit_box" class="botslectbxitem tvc-edit-accounts <?php if($googleDetail->ga4_analytic_account_id){ ?> tvc-disable-edits <?php } ?>" style="margin: 0px 5px 0px 0px;">
379
+ <div class="tvc-dropdown">
380
+ <div class="tvc-dropdown-header" id="both_ga4_account_id_option_val" data-profileid=""data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>"><?php if($googleDetail->ga4_analytic_account_id){
381
+ echo esc_attr($googleDetail->ga4_analytic_account_id);
382
+ }else{?><?php esc_html_e("Select GA4 Account Id","enhanced-e-commerce-for-woocommerce-store"); ?><?php } ?></div>
383
+ <div class="tvc-dropdown-content" id="both_ga4_account_id_option">
384
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select GA4 Account Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
385
+ <div class="tvc_load_more_acc option"><?php esc_html_e("Load More","enhanced-e-commerce-for-woocommerce-store"); ?></div>
386
+ </div>
387
+ </div>
 
 
388
  </div>
389
+ <div id="both-tvc-ga4-web-edit_box" class="botslectbxitem <?php if($googleDetail->measurement_id){ ?> tvc-disable-edits <?php } ?>">
390
+ <div class="tvc-dropdown">
391
+ <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-profileid="" data-name="" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
392
+ <?php if($googleDetail->measurement_id){
393
+ echo esc_attr($googleDetail->measurement_id);
394
+ }else{?><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?>
395
+ <?php } ?> </div>
396
+ <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
397
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","enhanced-e-commerce-for-woocommerce-store"); ?></option></div>
398
+ </div>
399
+ </div>
400
+ </div>
401
+ <button id="both-tvc-ga4-acc-edit" class="tvc-onboardEdit tvc-edit-acc_fire"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button>
402
+ </div>
403
+
404
  <div id="old_tracking" data-tracking_option="<?php echo esc_attr($tracking_option); ?>" data-measurement_id="<?php echo esc_attr($googleDetail->measurement_id); ?>" data-property_id="<?php echo esc_attr($googleDetail->property_id); ?>"></div>
405
  </div>
406
  </div>
407
+ </div>
408
  <div class="form-row">
409
  <h5><?php esc_html_e("Advance Settings (Optional)","enhanced-e-commerce-for-woocommerce-store"); ?></h5>
410
  <div class="chckbxbgbx">
432
  </form>
433
  </div>
434
  </div>
435
+ </div>
436
+ </div>
437
+ </div>
438
+
439
  <!-- step-1 over -->
440
  <!-- step-2 start -->
441
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
454
  <div class="selcttopwrap" id="tvc_ads_section">
455
  <div class="ggladsselectbx">
456
  <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?esc_attr($googleDetail->google_ads_id):""; ?>">
457
+ <select class="slect2bx google_ads_sel <?php if($googleDetail->google_ads_id){ ?> tvc-disable-edits <?php } ?>" id="ads-account" name="customer_id">
458
  <option value=''><?php esc_html_e("Select Google Ads Account","enhanced-e-commerce-for-woocommerce-store"); ?></option>
459
  </select>
460
  </div>
461
+ <?php if($googleDetail->google_ads_id){?>
462
+ <button id="tvc-gaAds-acc-edit" class="tvc-onboardEdit"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button><?php } ?>
463
  <div class="orwrp"><?php esc_html_e("or","enhanced-e-commerce-for-woocommerce-store"); ?></div>
464
  <div class="creatnewwrp">
465
  <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","enhanced-e-commerce-for-woocommerce-store"); ?></button>
556
  </div>
557
  <div id="tvc_merchant_section">
558
  <div class="ggladsselectbx">
559
+ <select class="slect2bx " id="google_merchant_center_id" name="google_merchant_center_id">
560
  <option value=''><?php esc_html_e("Select Google Merchant Center","enhanced-e-commerce-for-woocommerce-store"); ?></option>
561
  </select>
562
  </div>
563
+ <?php if($googleDetail->google_merchant_center_id){?>
564
+ <button id="tvc-gmc-acc-edit" class="tvc-onboardEdit"><?php esc_html_e("Edit","enhanced-e-commerce-for-woocommerce-store"); ?></button><?php } ?>
565
  <div class="orwrp"><?php esc_html_e("or","enhanced-e-commerce-for-woocommerce-store"); ?></div>
566
  <div class="creatnewwrp">
567
  <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","enhanced-e-commerce-for-woocommerce-store"); ?></button>
572
  <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
573
  <!-- add dslbbtn class for disable button -->
574
  </div>
575
+ <?php //echo "<pre>";
576
+ //print_r($googleDetail); echo "</pre>"; ?>
577
+ <input type="hidden" id="subscriptionMerchantId" name="subscriptionMerchantId" value="<?php echo property_exists($googleDetail,"merchant_id")?esc_attr($googleDetail->merchant_id):""; ?>">
578
  <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?esc_attr($googleDetail->google_merchant_center_id):""; ?>">
579
  <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo esc_attr($login_customer_id); ?>">
580
  <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo esc_attr($this->subscriptionId); ?>">
585
  </form>
586
  </div>
587
  <div class="stepnotewrp">
588
+ <?php esc_html_e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at Google Merchant Center Help website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','enhanced-e-commerce-for-woocommerce-store'); ?>
589
  </div>
590
  </div>
591
  </div>
592
  <!-- step-3 over -->
593
+ </div>
594
  <!-- onborading left over -->
595
  <!-- onborading right panel start -->
596
  <div class="onbording-right">
820
  </div>
821
  </div>
822
  <?php
823
+ $ua_acc_val=0; if(!$googleDetail->ua_analytic_account_id){$ua_acc_val=1;}
824
+ $ga4_acc_val=0; if(!$googleDetail->ga4_analytic_account_id){$ga4_acc_val=1;}
825
+ $propId=0; if(!$googleDetail->property_id){$propId=1;}
826
+ $measurementId=0; if(!$googleDetail->measurement_id){$measurementId=1;}
827
+ $googleAds=0; if(!$googleDetail->google_ads_id){$googleAds=1;}
828
+ $gmc_field=0; if(!$googleDetail->google_merchant_center_id){$gmc_field=1;}
829
+ ?>
830
+ <input type="hidden" id="ua_acc_val" value="<?php echo esc_attr($ua_acc_val); ?>">
831
+ <input type="hidden" id="ga4_acc_val" value="<?php echo esc_attr($ga4_acc_val); ?>">
832
+ <input type="hidden" id="propId" value="<?php echo esc_attr($propId); ?>">
833
+ <input type="hidden" id="measurementId" value="<?php echo esc_attr($measurementId); ?>">
834
+ <input type="hidden" id="googleAds" value="<?php echo esc_attr($googleAds); ?>">
835
+ <input type="hidden" id="gmc_field" value="<?php echo esc_attr($gmc_field); ?>">
836
+ <?php
837
  $this->page_script();
838
  }
839
  /**
848
  let subscription_id ="<?php echo esc_attr($this->subscriptionId); ?>";
849
  let plan_id ="<?php echo esc_attr($this->plan_id); ?>";
850
  let app_id ="<?php echo esc_attr($this->app_id); ?>";
851
+
852
+
853
+ let ua_acc_val = jQuery('#ua_acc_val').val();
854
+ let ga4_acc_val = jQuery('#ga4_acc_val').val();
855
+ //let propId = jQuery('#propId').val();
856
+ //let measurementId = jQuery('#measurementId').val();
857
+ let googleAds = jQuery('#googleAds').val();
858
+ let gmc_field = jQuery('#gmc_field').val();
859
+ //console.log("ua_acc_val",ua_acc_val);
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
+
867
+ //append previously configured gmc paras
868
+ let gmc_account_id=jQuery("#subscriptionMerchantCenId").val();
869
+ let gmc_merchant_id=jQuery("#subscriptionMerchantId").val();
870
+ jQuery('#google_merchant_center_id').append(jQuery('<option>', {value: gmc_account_id, "data-merchant_id": gmc_merchant_id, text: gmc_account_id,selected: "selected"}));
871
+ //append previously configured googleAds paras
872
+ let googleAds_value = jQuery('#subscriptionGoogleAdsId').val();
873
+ jQuery('#ads-account').append(jQuery('<option>', { value: googleAds_value, text: googleAds_value,selected: "selected"}));
874
+ if(googleAds == 0){ //disable dropdown for google ads when we have its previous data
875
+ //$('ads-account').select2("enable", false);
876
+ $('#ads-account').prop('disabled', true);
877
+ }
878
+ if(gmc_field == 0){ //disable dropdown for gmc when we have its previous data
879
+ //$('google_merchant_center_id').select2("enable", false);
880
+ $('#google_merchant_center_id').prop('disabled', true);
881
+ }
882
  /**
883
  * Convesios custom script
884
  */
909
  jQuery(document).ready(function() {
910
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
911
  if(tracking_option != ""){
 
 
 
912
  jQuery(".slctunivr-filed").slideUp();
913
  jQuery("#"+tracking_option).slideDown();
914
+ is_validate_step("step_1");
915
+ }
916
+ let ua_page=2;
917
+ jQuery('.tvc_load_more_acc').click(function(event){
918
+ call_list_analytics_account(tvc_data, ua_page);
 
 
919
  ua_page++;
920
+ event.preventDefault();
921
+ //event.stopPropagation();
 
 
 
 
 
922
  })
 
923
  jQuery("input[type=radio][name=analytic_tag_type]").on( "change", function() {
924
  let tracking_option = this.value;
925
+ //is_validate_step("step_1");
 
 
 
926
  jQuery(".slctunivr-filed").slideUp();
927
  jQuery("#"+tracking_option).slideDown();
928
  });
929
  });
930
+ jQuery(".tvc-edit-acc_fire").on('click', function(e){
931
+ e.preventDefault();
932
+ call_list_analytics_account(tvc_data,1);
933
+ });
934
+
935
+ jQuery(".tvc-property-edit-btn").on('click', function(e){
936
+ e.preventDefault();
937
+ let account_id= jQuery(this).attr('data-accountid');
938
+ let type= jQuery(this).attr('data-type');
939
+ if(account_id !="" && type !=""){
940
+ list_analytics_web_properties(type,tvc_data,account_id);
941
+ }
942
+ });
943
+ //Step-2
944
+ if(subscription_id != "" && googleAds == 1){
945
+ list_googl_ads_account(tvc_data);
946
  }
947
 
948
+ /*if(subscription_id != "" && gmc_field == 1 && googleAds == 0){
949
+ list_google_merchant_account(tvc_data);
950
+ }*/
951
+ jQuery("#tvc-gaAds-acc-edit").on('click', function(e){
952
+ e.preventDefault();
953
+ list_googl_ads_account(tvc_data);
954
+ });
955
  // create google ads account
956
  jQuery("#ads-continue").on('click', function(e){
957
  e.preventDefault();
965
  go_next(jQuery("#step_2"));
966
  });
967
  //Step - 3
968
+
969
+ jQuery("#tvc-gmc-acc-edit").on('click', function(e){
970
+ e.preventDefault();
971
+ list_google_merchant_account(tvc_data);
972
+ });
973
  jQuery("#create_merchant_account").on('click', function(e){
974
  e.preventDefault();
975
  create_google_merchant_center_account(tvc_data);
1003
  }
1004
  }
1005
  })
1006
+ //option listner activity added here
1007
+ jQuery(document.body).on('click', 'option:not(.more)', function(event){
1008
+ var option_category = jQuery(this).attr('data-cat');
1009
+
1010
+ if(option_category == "accounts"){
1011
+ //append values to parent dropdown
1012
+ //console.log("option_category",option_category);
1013
+ var text = jQuery(this).html();
1014
+ var account_id = jQuery(this).attr("value");
1015
+ var option_id = jQuery(this).parent().parent().attr("id");
1016
+ jQuery("#"+option_id+"_val").attr("data-val",account_id);
1017
+ jQuery("#"+option_id+"_val").attr("data-accountid",account_id);
1018
+ jQuery("#"+option_id+"_val").html(text);
1019
+ jQuery(this).parent().parent().toggle();
1020
+ //event.stopPropagation();
1021
+ //call second api
1022
+ var type='';
1023
+ //console.log("option_id",option_id);
1024
+ if(option_id == 'ua_account_id_option' || option_id == 'both_ua_account_id_option'){
1025
+ type="UA";
1026
+ }else if(option_id == 'ga4_account_id_option' ||option_id == 'both_ga4_account_id_option'){
1027
+ type="GA4";
1028
+ }
1029
+ if(type != ""){
1030
+ list_analytics_web_properties(type,tvc_data,account_id);
1031
+ }
1032
+ }else if(option_category == "webProperties" || option_category == "dataStreams" ){
1033
+ var option_id = jQuery(this).parent().parent().attr("id");
1034
+ var val = jQuery(this).attr("value");
1035
+ var accountid = jQuery(this).attr("data-accountid");
1036
+ var text = jQuery(this).html();
1037
+ let tracking_option = jQuery('input:radio[name=analytic_tag_type]:checked').val();
1038
+
1039
+ if(tracking_option == "UA" || (tracking_option == "BOTH" && option_id == "both_ua_web_property_id_option")){
1040
+ var profileid = jQuery(this).attr("data-profileid");
1041
+ profileid = (profileid == undefined)?"":profileid;
1042
+ accountid = (accountid == undefined)?"":accountid;
1043
+ //console.log(accountid+"="+profileid);
1044
+
1045
+ jQuery("#"+option_id+"_val").html(text);
1046
+ jQuery("#"+option_id+"_val").attr("data-accountid",accountid);
1047
+ jQuery("#"+option_id+"_val").attr("data-profileid",profileid);
1048
+ jQuery("#"+option_id+"_val").attr("data-val",val);
1049
+
1050
+ }else if(tracking_option == "GA4" || (tracking_option == "BOTH" && option_id == "both_ga4_web_measurement_id_option") ){
1051
+ var name = jQuery(this).attr("data-name");
1052
+ name = (name == undefined)?"":name;
1053
+ accountid = (accountid == undefined)?"":accountid;
1054
+ jQuery("#"+option_id+"_val").html(text);
1055
+ jQuery("#"+option_id+"_val").attr("data-accountid",accountid);
1056
+ jQuery("#"+option_id+"_val").attr("data-name",name);
1057
+ jQuery("#"+option_id+"_val").attr("data-val",val);
1058
+ }
1059
+ jQuery(this).parent().parent().toggle();
1060
+ validate_google_analytics_sel();
1061
+ event.stopPropagation();
1062
+ }
1063
+ });
1064
  //Click confirm button on confirm popup
1065
  jQuery('#confirm_selection').on('click', function(e){
1066
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
1090
  }else{
1091
  location.replace( "admin.php?page=conversios-google-analytics");
1092
  }
1093
+ //user_tracking_data('complate_onboard', error_msg,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
1094
  }else{
1095
+ //user_tracking_data('complate_onboard', response.errors,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
1096
  loaderSection(false);
1097
  }
1098
  }
1126
  }else{
1127
  location.replace( "admin.php?page=conversios-google-analytics");
1128
  }
1129
+ //user_tracking_data('complate_onboard', response.errors,'conversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
1130
  }else{
1131
  loaderSection(false);
1132
+ //user_tracking_data('complate_onboard', 'null','cnversios_onboarding','Confirm_to_Finish_the_Onboarding_process');
1133
  }
1134
  }
1135
  });
1165
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
1166
  save_analytics_web_properties( tracking_option, tvc_data, subscription_id );
1167
  go_next(this);
1168
+ list_google_merchant_account(tvc_data);
1169
  }
1170
  }
1171
  //step 2 next button call
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -710,4 +710,8 @@ img{
710
  .auto_product_sync_save_button{
711
  text-align: center;
712
  margin-left: 80px;
 
 
 
 
713
  }
710
  .auto_product_sync_save_button{
711
  text-align: center;
712
  margin-left: 80px;
713
+ }
714
+
715
+ .list-image img {
716
+ max-width: 18px;
717
  }
admin/css/style.css CHANGED
@@ -382,18 +382,19 @@ button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{b
382
  }
383
 
384
  .tvc-dropdown-header{
385
- padding: 2px 10px;
386
  background-color: #fff;
387
  border: 1px solid #C6C6C6;
388
  border-radius: 6px;
389
  box-sizing: border-box;
390
  cursor: pointer;
391
  display: block;
 
392
  height: 42px;
393
  user-select: none;
394
  -webkit-user-select: none;
395
  top: 50%;
396
- width: 400px;
397
  vertical-align: middle;
398
  display: table-cell;
399
  }
@@ -525,7 +526,6 @@ input[type="radio"], input[type="checkbox"]{margin:0;}
525
  .chckbxbgbx .cstmcheck-item:last-child{margin-right:0px;}
526
  .stepnextbtn{display:inline-block;width:154px;height:42px;background-color:#2FBB0E;text-align:center;padding:10px;border-radius:6px;color:#ffffff;font-size:16px;font-weight:700;box-shadow:none;border:none;cursor:pointer;}
527
  .stepnextbtn:hover{background-color:#28d000;color:#ffffff;}
528
-
529
  .slctunivr-filed{padding-left:25px;margin-top:12px;}
530
  .slect2bx{border:1px solid #C6C6C6;width:258px;height:42px;}
531
  .botslectbxitem{margin-bottom:9px;}
@@ -663,7 +663,7 @@ input[type="radio"], input[type="checkbox"]{margin:0;}
663
  /*---- navinfo section ------*/
664
  .navinfowrap{margin-top:20px;}
665
  .navinfotopnav{padding:16px 0px 0;background-color: #ffffff; border-bottom:1px solid #E9E9E9; position: sticky; top: 0; z-index: 2;
666
- overflow: hidden; border-radius:6px 6px 0 0;
667
  }
668
  .navinfotopnav ul{margin:0;padding:0;list-style:none;display:inline-flex;flex-wrap:wrap}
669
  .navinfotopnav ul li a{padding:0 15px 16px;display:flex;align-items:center;position:relative;font-size:16px;font-weight:500;line-height:1;color:#515151;}
@@ -1157,7 +1157,7 @@ button:disabled,button[disabled], button:disabled:hover,button[disabled]:hover{b
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;}
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 ************/
@@ -1358,7 +1358,7 @@ img.img-upload {
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: -33px; float: right; right: -15px;}
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;}
@@ -1368,6 +1368,7 @@ img.img-upload {
1368
 
1369
 
1370
  .tvc-auto-product-sync-form .ga-title{position: relative;}
 
1371
  .tvc-product-sync-toolip{ position: absolute; display: inline-block; width: auto; top: -5px; margin-left: 2px;}
1372
  .tvc-product-sync-toolip .tvc-tooltip-right{ line-height: 1.2; bottom: 6px; left: 125%; top: auto;}
1373
  .tvc-auto-product-sync-form .tvc-pro {margin-left: 20px;}
@@ -1382,4 +1383,57 @@ img.img-upload {
1382
  .contct-lnk{ color: blue; }
1383
  #wpfooter {
1384
  position: relative;
1385
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
 
384
  .tvc-dropdown-header{
385
+ padding: 10px 10px;
386
  background-color: #fff;
387
  border: 1px solid #C6C6C6;
388
  border-radius: 6px;
389
  box-sizing: border-box;
390
  cursor: pointer;
391
  display: block;
392
+ line-height: 16px;
393
  height: 42px;
394
  user-select: none;
395
  -webkit-user-select: none;
396
  top: 50%;
397
+ width: 350px;
398
  vertical-align: middle;
399
  display: table-cell;
400
  }
526
  .chckbxbgbx .cstmcheck-item:last-child{margin-right:0px;}
527
  .stepnextbtn{display:inline-block;width:154px;height:42px;background-color:#2FBB0E;text-align:center;padding:10px;border-radius:6px;color:#ffffff;font-size:16px;font-weight:700;box-shadow:none;border:none;cursor:pointer;}
528
  .stepnextbtn:hover{background-color:#28d000;color:#ffffff;}
 
529
  .slctunivr-filed{padding-left:25px;margin-top:12px;}
530
  .slect2bx{border:1px solid #C6C6C6;width:258px;height:42px;}
531
  .botslectbxitem{margin-bottom:9px;}
663
  /*---- navinfo section ------*/
664
  .navinfowrap{margin-top:20px;}
665
  .navinfotopnav{padding:16px 0px 0;background-color: #ffffff; border-bottom:1px solid #E9E9E9; position: sticky; top: 0; z-index: 2;
666
+ /*overflow: hidden;*/ border-radius:6px 6px 0 0;
667
  }
668
  .navinfotopnav ul{margin:0;padding:0;list-style:none;display:inline-flex;flex-wrap:wrap}
669
  .navinfotopnav ul li a{padding:0 15px 16px;display:flex;align-items:center;position:relative;font-size:16px;font-weight:500;line-height:1;color:#515151;}
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 ************/
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;}
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;}
1372
  .tvc-product-sync-toolip{ position: absolute; display: inline-block; width: auto; top: -5px; margin-left: 2px;}
1373
  .tvc-product-sync-toolip .tvc-tooltip-right{ line-height: 1.2; bottom: 6px; left: 125%; top: auto;}
1374
  .tvc-auto-product-sync-form .tvc-pro {margin-left: 20px;}
1383
  .contct-lnk{ color: blue; }
1384
  #wpfooter {
1385
  position: relative;
1386
+ }
1387
+ .tvc-onboardEdit{display: inline-block;height: fit-content;padding: 12px;margin: 0px 5px;}
1388
+ .tvc-onboardEdit:hover {color:#fff;}
1389
+ .tvc-onboardEdit{border:none; box-shadow: none; background-color: #002BFC; color: #ffffff; font-weight: 700; font-size: 16px; line-height: 17px;border-radius: 6px;text-align: center;}
1390
+ .tvc-onboardEdit:hover{background-color: #135e96;}
1391
+ .tvc-multi-dropdown{display:flex;flex-direction: row;margin: 10px 0px;}
1392
+ .tvc-disable-edits * {pointer-events: none;background: #CCCCCC;}
1393
+ .tvc-disable-edits{cursor: not-allowed;}
1394
+ .configuration-section .confg-card .card .card-body .list-unstyled li .list-image img {
1395
+ max-width: 18px;
1396
+ }
1397
+ site-verified-pos{
1398
+ margin-left:70px;
1399
+ }
1400
+
1401
+
1402
+
1403
+ /* Dropdown Button */
1404
+ /* The container <div> - needed to position the dropdown content */
1405
+ .con-dropdown{
1406
+ position: relative;
1407
+ display: inline-block;
1408
+ }
1409
+
1410
+ /* Dropdown Content (Hidden by Default) */
1411
+ .con-dropdown-content {
1412
+ display: none;
1413
+ position: absolute;
1414
+ background-color: #fff;
1415
+ min-width: 160px;
1416
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1417
+ z-index: 1;
1418
+ }
1419
+ /* Links inside the dropdown */
1420
+ .navinfotopnav ul li .con-dropdown-content a {
1421
+ text-decoration: none;
1422
+ display: block;
1423
+ padding: 7px;
1424
+ }
1425
+ .navinfotopnav ul li.active .con-dropdown-content a{border-bottom: 2px solid #fff;}
1426
+ .navinfotopnav ul li.active .con-dropdown-content a:before{opacity: 0;}
1427
+ .navinfotopnav ul li.active .con-dropdown-content a:hover{border-bottom: 2px solid #515151;}
1428
+ .navinfotopnav ul li.active .con-dropdown-content a{color: #515151;}
1429
+
1430
+
1431
+ /* Show the dropdown menu on hover */
1432
+ .con-dropdown:hover .con-dropdown-content {display: block;}
1433
+
1434
+ .table>:not(caption)>*>* {
1435
+ padding: 0.5rem 0.5rem;
1436
+ background-color: var(--bs-table-bg);
1437
+ border-bottom-width: 0px;
1438
+ box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
1439
+ }
admin/helper/class-onboarding-helper.php CHANGED
@@ -9,16 +9,17 @@
9
  */
10
 
11
  if(!defined('ABSPATH')){
12
- exit; // Exit if accessed directly
13
  }
14
  if(!class_exists('Conversios_Onboarding_Helper')):
15
- class Conversios_Onboarding_Helper{
16
- protected $apiDomain;
17
- protected $token;
18
- public function __construct(){
19
- $this->req_int();
20
  //analytics
21
- add_action('wp_ajax_get_analytics_web_properties', array($this,'get_analytics_web_properties') );
 
22
  add_action('wp_ajax_save_analytics_data', array($this,'save_analytics_data') );
23
  //googl_ads
24
  add_action('wp_ajax_list_googl_ads_account', array($this,'list_googl_ads_account') );
@@ -39,7 +40,7 @@ if(!class_exists('Conversios_Onboarding_Helper')):
39
 
40
  add_action('admin_init',array($this,'add_schedule_ut'));
41
  add_action('ee_ut_cron',array($this,'ee_ut_crons'));
42
- }
43
 
44
  public function add_schedule_ut(){
45
  $options_val = get_option('ee_ut');
@@ -64,36 +65,54 @@ if(!class_exists('Conversios_Onboarding_Helper')):
64
  }
65
 
66
 
67
- public function req_int(){
68
- if (!class_exists('CustomApi.php')) {
69
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
70
  }
71
- }
72
- protected function admin_safe_ajax_call( $nonce, $registered_nonce_name ) {
73
- // only return results when the user is an admin with manage options
74
- if ( is_admin() && wp_verify_nonce($nonce,$registered_nonce_name) ) {
75
- return true;
76
- } else {
77
- return false;
78
- }
79
- }
80
-
81
- /**
82
- * Ajax code for get analytics web properties.
83
- * @since 4.0.2
84
- */
85
- public function get_analytics_web_properties(){
86
- $nonce = (isset($_POST['conversios_onboarding_nonce']))?sanitize_text_field($_POST['conversios_onboarding_nonce']):"";
87
- if($this->admin_safe_ajax_call($nonce, 'conversios_onboarding_nonce')){
88
- $data = isset($_POST['tvc_data'])?sanitize_text_field($_POST['tvc_data']):"";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  $tvc_data = json_decode(str_replace("&quot;", "\"", $data));
90
- $api_obj = new Conversios_Onboarding_ApiCall(sanitize_text_field($tvc_data->access_token), sanitize_text_field($tvc_data->refresh_token));
91
- echo json_encode($api_obj->getAnalyticsWebProperties($_POST));
92
- wp_die();
93
- }else{
94
- echo esc_html__("Admin security nonce is not verified.","enhanced-e-commerce-for-woocommerce-store");
95
- }
96
- }
 
97
 
98
  /**
99
  * Ajax code for save analytics data.
@@ -462,26 +481,26 @@ if(!class_exists('Conversios_Onboarding_Helper')):
462
  * function call for save API data in WP DB
463
  */
464
  $TVC_Admin_Helper->set_update_api_to_db($googleDetail);
465
- }
466
- }
467
  endif; // class_exists
468
  new Conversios_Onboarding_Helper();
469
 
470
  if(!class_exists('Conversios_Onboarding_ApiCall') ){
471
- class Conversios_Onboarding_ApiCall {
472
- protected $apiDomain;
473
- protected $token;
474
  protected $merchantId;
475
  protected $access_token;
476
  protected $refresh_token;
477
- public function __construct($access_token, $refresh_token) {
478
  $merchantInfo = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR.'includes/setup/json/merchant-info.json'), true);
479
  $this->refresh_token = $refresh_token;
480
  $this->access_token = base64_encode( $this->generateAccessToken( base64_decode($access_token), base64_decode($this->refresh_token) ) );
481
  $this->apiDomain = TVC_API_CALL_URL;
482
  $this->token = 'MTIzNA==';
483
  $this->merchantId = sanitize_text_field($merchantInfo['merchantId']);
484
- }
485
  public function tc_wp_remot_call_post($url, $args){
486
  try {
487
  if(!empty($args)){
@@ -540,9 +559,49 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
540
  }
541
  }
542
 
543
- public function getAnalyticsWebProperties($postData) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  try {
545
- $url = $this->apiDomain . '/google-analytics/account-list';
546
 
547
  $access_token = sanitize_text_field(base64_decode($this->access_token));
548
  $max_results = 10;
@@ -552,7 +611,6 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
552
  $page = (($page-1) * $max_results)+1;
553
  }
554
  $data = [
555
- 'type' => sanitize_text_field($postData['type']),
556
  'page'=>sanitize_text_field($page),
557
  'max_results'=>sanitize_text_field($max_results)
558
  ];
@@ -579,7 +637,7 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
579
  return $return;
580
  }else{
581
  $return->error = true;
582
- $return->data = $response->data;
583
  $return->status = $response_code;
584
  $return->errors = json_encode($response->errors);
585
  return $return;
@@ -588,7 +646,6 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
588
  return $e->getMessage();
589
  }
590
  }
591
-
592
  public function getGoogleAdsAccountList($postData) {
593
  try {
594
  if($this->refresh_token != ""){
@@ -1179,5 +1236,5 @@ if(!class_exists('Conversios_Onboarding_ApiCall') ){
1179
  }
1180
  }
1181
 
1182
- }
1183
  }
9
  */
10
 
11
  if(!defined('ABSPATH')){
12
+ exit; // Exit if accessed directly
13
  }
14
  if(!class_exists('Conversios_Onboarding_Helper')):
15
+ class Conversios_Onboarding_Helper{
16
+ protected $apiDomain;
17
+ protected $token;
18
+ public function __construct(){
19
+ $this->req_int();
20
  //analytics
21
+ add_action('wp_ajax_get_analytics_account_list', array($this,'get_analytics_account_list') );
22
+ add_action('wp_ajax_get_analytics_web_properties', array($this,'get_analytics_web_properties') );
23
  add_action('wp_ajax_save_analytics_data', array($this,'save_analytics_data') );
24
  //googl_ads
25
  add_action('wp_ajax_list_googl_ads_account', array($this,'list_googl_ads_account') );
40
 
41
  add_action('admin_init',array($this,'add_schedule_ut'));
42
  add_action('ee_ut_cron',array($this,'ee_ut_crons'));
43
+ }
44
 
45
  public function add_schedule_ut(){
46
  $options_val = get_option('ee_ut');
65
  }
66
 
67
 
68
+ public function req_int(){
69
+ if (!class_exists('CustomApi.php')) {
70
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
71
  }
72
+ }
73
+ protected function admin_safe_ajax_call( $nonce, $registered_nonce_name ) {
74
+ // only return results when the user is an admin with manage options
75
+ if ( is_admin() && wp_verify_nonce($nonce,$registered_nonce_name) ) {
76
+ return true;
77
+ } else {
78
+ return false;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Ajax code for get analytics web properties.
84
+ * @since 4.0.2
85
+ */
86
+ public function get_analytics_web_properties(){
87
+ $nonce = (isset($_POST['conversios_onboarding_nonce']))?sanitize_text_field($_POST['conversios_onboarding_nonce']):"";
88
+ if($this->admin_safe_ajax_call($nonce, 'conversios_onboarding_nonce')){
89
+ $data = isset($_POST['tvc_data'])?sanitize_text_field($_POST['tvc_data']):"";
90
+ $tvc_data = json_decode(str_replace("&quot;", "\"", $data));
91
+ $api_obj = new Conversios_Onboarding_ApiCall(sanitize_text_field($tvc_data->access_token), sanitize_text_field($tvc_data->refresh_token));
92
+ echo json_encode($api_obj->getAnalyticsWebProperties($_POST));
93
+ wp_die();
94
+ }else{
95
+ echo esc_html__("Admin security nonce is not verified.","enhanced-e-commerce-for-woocommerce-store");
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Ajax code for get analytics account list.
101
+ * @since 4.0.2
102
+ */
103
+ public function get_analytics_account_list(){
104
+ $nonce = (isset($_POST['conversios_onboarding_nonce']))?sanitize_text_field($_POST['conversios_onboarding_nonce']):"";
105
+ if($this->admin_safe_ajax_call($nonce, 'conversios_onboarding_nonce')){
106
+ $data = isset($_POST['tvc_data'])?sanitize_text_field($_POST['tvc_data']):"";
107
  $tvc_data = json_decode(str_replace("&quot;", "\"", $data));
108
+ $api_obj = new Conversios_Onboarding_ApiCall(sanitize_text_field($tvc_data->access_token), sanitize_text_field($tvc_data->refresh_token));
109
+ echo json_encode($api_obj->getAnalyticsAccountList($_POST));
110
+ wp_die();
111
+ }else{
112
+ echo esc_html__("Admin security nonce is not verified.","enhanced-e-commerce-for-woocommerce-store");
113
+ }
114
+ }
115
+
116
 
117
  /**
118
  * Ajax code for save analytics data.
481
  * function call for save API data in WP DB
482
  */
483
  $TVC_Admin_Helper->set_update_api_to_db($googleDetail);
484
+ }
485
+ }
486
  endif; // class_exists
487
  new Conversios_Onboarding_Helper();
488
 
489
  if(!class_exists('Conversios_Onboarding_ApiCall') ){
490
+ class Conversios_Onboarding_ApiCall {
491
+ protected $apiDomain;
492
+ protected $token;
493
  protected $merchantId;
494
  protected $access_token;
495
  protected $refresh_token;
496
+ public function __construct($access_token, $refresh_token) {
497
  $merchantInfo = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR.'includes/setup/json/merchant-info.json'), true);
498
  $this->refresh_token = $refresh_token;
499
  $this->access_token = base64_encode( $this->generateAccessToken( base64_decode($access_token), base64_decode($this->refresh_token) ) );
500
  $this->apiDomain = TVC_API_CALL_URL;
501
  $this->token = 'MTIzNA==';
502
  $this->merchantId = sanitize_text_field($merchantInfo['merchantId']);
503
+ }
504
  public function tc_wp_remot_call_post($url, $args){
505
  try {
506
  if(!empty($args)){
559
  }
560
  }
561
 
562
+ public function getAnalyticsWebProperties($postData) {
563
+ try {
564
+ $url = $this->apiDomain . '/google-analytics/wep-details/account-id';
565
+ $access_token = sanitize_text_field(base64_decode($this->access_token));
566
+ $data = [
567
+ 'type' => sanitize_text_field($postData['type']),
568
+ 'account_id' => sanitize_text_field($postData['account_id'])
569
+ ];
570
+ $args = array(
571
+ 'timeout' => 10000,
572
+ 'headers' => array(
573
+ 'Authorization' => "Bearer MTIzNA==",
574
+ 'Content-Type' => 'application/json',
575
+ 'AccessToken' => $access_token
576
+ ),
577
+ 'body' => wp_json_encode($data)
578
+ );
579
+ $request = wp_remote_post(esc_url_raw($url), $args);
580
+
581
+ // Retrieve information
582
+ $response_code = wp_remote_retrieve_response_code($request);
583
+ $response_message = wp_remote_retrieve_response_message($request);
584
+ $response = json_decode(wp_remote_retrieve_body($request));
585
+ $return = new \stdClass();
586
+ if (isset($response->error) && $response->error == '') {
587
+ $return->status = $response_code;
588
+ $return->data = $response->data;
589
+ $return->error = false;
590
+ return $return;
591
+ }else{
592
+ $return->error = true;
593
+ $return->data = ($response->data)?$response->data:"";
594
+ $return->status = $response_code;
595
+ $return->errors = json_encode($response->errors);
596
+ return $return;
597
+ }
598
+ } catch (Exception $e) {
599
+ return $e->getMessage();
600
+ }
601
+ }
602
+ public function getAnalyticsAccountList($postData) {
603
  try {
604
+ $url = $this->apiDomain . '/google-analytics/ga-account-list';
605
 
606
  $access_token = sanitize_text_field(base64_decode($this->access_token));
607
  $max_results = 10;
611
  $page = (($page-1) * $max_results)+1;
612
  }
613
  $data = [
 
614
  'page'=>sanitize_text_field($page),
615
  'max_results'=>sanitize_text_field($max_results)
616
  ];
637
  return $return;
638
  }else{
639
  $return->error = true;
640
+ $return->data = ($response->data)?$response->data:"";
641
  $return->status = $response_code;
642
  $return->errors = json_encode($response->errors);
643
  return $return;
646
  return $e->getMessage();
647
  }
648
  }
 
649
  public function getGoogleAdsAccountList($postData) {
650
  try {
651
  if($this->refresh_token != ""){
1236
  }
1237
  }
1238
 
1239
+ }
1240
  }
admin/js/onboarding-custom.js CHANGED
@@ -94,42 +94,7 @@ jQuery(document).ready(function () {
94
  jQuery(window).click(function(){
95
  jQuery('.tvc-dropdown-content').hide();
96
  })
97
- jQuery(document.body).on('click', 'option:not(.more)', function(event){
98
- //alert('clicked option ' + this.innerHTML);
99
-
100
- var option_id = jQuery(this).parent().parent().attr("id");
101
- //console.log(option_id);
102
- var val = jQuery(this).attr("value");
103
- var accountid = jQuery(this).attr("data-accountid");
104
-
105
- var text = jQuery(this).html();
106
- let tracking_option = jQuery('input:radio[name=analytic_tag_type]:checked').val();
107
-
108
- if(tracking_option == "UA" || (tracking_option == "BOTH" && option_id == "both_ua_web_property_id_option")){
109
- var profileid = jQuery(this).attr("data-profileid");
110
- profileid = (profileid == undefined)?"":profileid;
111
- accountid = (accountid == undefined)?"":accountid;
112
- //console.log(accountid+"="+profileid);
113
-
114
- jQuery("#"+option_id+"_val").html(text);
115
- jQuery("#"+option_id+"_val").attr("data-accountid",accountid);
116
- jQuery("#"+option_id+"_val").attr("data-profileid",profileid);
117
- jQuery("#"+option_id+"_val").attr("data-val",val);
118
-
119
- }else if(tracking_option == "GA4" || (tracking_option == "BOTH" && option_id == "both_ga4_web_measurement_id_option") ){
120
- var name = jQuery(this).attr("data-name");
121
- name = (name == undefined)?"":name;
122
- accountid = (accountid == undefined)?"":accountid;
123
- jQuery("#"+option_id+"_val").html(text);
124
- jQuery("#"+option_id+"_val").attr("data-accountid",accountid);
125
- jQuery("#"+option_id+"_val").attr("data-name",name);
126
- jQuery("#"+option_id+"_val").attr("data-val",val);
127
- }
128
- jQuery(this).parent().parent().toggle();
129
- validate_google_analytics_sel();
130
- event.stopPropagation();
131
- })
132
-
133
  /*jQuery(".google_analytics_sel").on( "change", function() {
134
  is_validate_step("step_1");
135
  jQuery(".onbrdstep-1").removeClass('selectedactivestep');
@@ -175,23 +140,6 @@ function validate_google_analytics_sel(){
175
  jQuery("[data-id=step_3]").attr("data-is-done",0);
176
  }
177
 
178
- jQuery(document).ready(function () {
179
- jQuery('input[type=radio][name=analytic_tag_type]').click(function(){
180
- var tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
181
- if(tracking_option == 'UA'){
182
- var btn_cam = 'tracking_o_ga3';
183
- }
184
- else if(tracking_option == 'GA4'){
185
- var btn_cam = 'tracking_o_ga4';
186
- }
187
- else if(tracking_option == 'BOTH'){
188
- var btn_cam = 'tracking_o_both';
189
- }
190
- error_msg = 'null';
191
- user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Select_tracking_option');
192
- });
193
- });
194
-
195
  function is_change_analytics_account(){
196
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
197
  let old_tracking_option = jQuery('#old_tracking').attr("data-tracking_option");
@@ -295,12 +243,12 @@ function save_analytics_web_properties(tracking_option, tvc_data, subscription_i
295
  if (response.error === false) {
296
  add_message("success","Google Analytics successfully updated.");
297
  var error_msg = 'null';
298
- user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Analytics_account');
299
  return true;
300
  }else{
301
  var error_msg = response.errors;
302
  add_message("error","Error while updating Google Analytics.");
303
- user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Analytics_account');
304
  return false;
305
  }
306
 
@@ -344,7 +292,7 @@ function save_google_ads_data(google_ads_id, tvc_data, subscription_id, is_skip=
344
  var btn_cam = 'save_ads';
345
  if(response.error === false) {
346
  var error_msg = 'null';
347
- user_tracking_data(btn_cam, error_msg, 'conversios_onboarding','Save_Google_Ads_account');
348
  add_message("success","Google Ads successfully updated.");
349
  let tracking_option = jQuery('input:radio[name=analytic_tag_type]:checked').val();
350
  var s_tracking_option = tracking_option.toLowerCase();
@@ -410,7 +358,7 @@ function save_google_ads_data(google_ads_id, tvc_data, subscription_id, is_skip=
410
  url: tvc_ajax_url,
411
  data: Ga4linkData,
412
  success: function (response) {
413
- console.log(response);
414
  clearTimeout(tvc_time_out);
415
  if(response.error === false){
416
  add_message("success","Google ananlytics and google ads linked successfully.");
@@ -455,7 +403,7 @@ function save_google_ads_data(google_ads_id, tvc_data, subscription_id, is_skip=
455
  url: tvc_ajax_url,
456
  data: Ga4linkData,
457
  success: function (response) {
458
- console.log(response);
459
  clearTimeout(tvc_time_out);
460
  if(response.error === false){
461
  add_message("success","Google ananlytics and google ads linked successfully.");
@@ -481,7 +429,7 @@ function save_google_ads_data(google_ads_id, tvc_data, subscription_id, is_skip=
481
 
482
  }else{
483
  var error_msg = response.errors;
484
- user_tracking_data(btn_cam, error_msg, 'conversios_onboarding','Save_Google_Ads_account');
485
  add_message("error","Error while updating Google Ads.");
486
  }
487
 
@@ -549,7 +497,7 @@ function save_merchant_data(google_merchant_center_id, merchant_id, tvc_data, su
549
  var error_msg = response.errors;
550
  add_message("error","Error while updating Google merchant center.");
551
  }
552
- user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Merchant_account');
553
  //loaderSection(false);
554
  }
555
  });
@@ -680,156 +628,160 @@ function get_subscription_details(tvc_data, subscription_id) {
680
  });
681
  }
682
  /* List function */
683
- //call get list propertie function base on tracking_option
684
- function call_list_analytics_web_properties(tracking_option, tvc_data, page =1){
685
- if (tracking_option == 'UA'){
686
- let web_property_id_length = jQuery('#ua_web_property_id_option option').length;
687
- if(web_property_id_length < 2 || page != 1){
688
- list_analytics_web_properties("UA", tvc_data, page);
689
- }else if( page != 1){
690
- list_analytics_web_properties("UA", tvc_data, page);
691
  }
692
- }else if (tracking_option == 'GA4' ){
693
- let web_measurement_id_length = jQuery('#ga4_web_measurement_id_option option').length;
694
- if(web_measurement_id_length < 2){
695
- list_analytics_web_properties("GA4", tvc_data, page);
696
  }else if( page != 1){
697
- list_analytics_web_properties("GA4", tvc_data, page);
698
- }
699
- }else if (tracking_option == 'BOTH'){
700
- let web_property_id_length = jQuery('#both_ua_web_property_id_option option').length;
701
- let web_measurement_id_length = jQuery('#both_ga4_web_measurement_id_option option').length;
702
- if(web_measurement_id_length < 2 && web_property_id_length < 2){
703
- list_analytics_web_properties("BOTH", tvc_data);
704
- }else if(web_property_id_length < 2 ){
705
- list_analytics_web_properties("UA", tvc_data);
706
- }else if(web_measurement_id_length < 2 ){
707
- list_analytics_web_properties("GA4", tvc_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  }
709
-
710
- }
711
  }
 
712
  // get list properties dropdown options
713
- function list_analytics_web_properties(type, tvc_data, page =1) {
714
  loaderSection(true);
715
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
716
- //console.log("page"+page);
717
  jQuery.ajax({
718
  type: "POST",
719
  dataType: "json",
720
  url: tvc_ajax_url,
721
- data: {action: "get_analytics_web_properties", type: type, page:page, tvc_data:tvc_data, conversios_onboarding_nonce:conversios_onboarding_nonce},
722
  success: function (response) {
723
- //console.log(response);
724
- var s_tracking_option = type.toLowerCase()
725
-
726
- if(type == "GA4" || type == "BOTH")
727
- {
728
- btn_cam = 'ga4_list';
729
- }
730
- else if(type == "UA" || type == "BOTH")
731
- {
732
- btn_cam = 'ga3_list'
733
- }
734
 
735
- if (response != null && response.error == false) {
736
- var error_msg = 'null';
737
- if (type == "UA" || type == "BOTH") {
738
- //web_properties_dropdown
739
- var subscriptionPropertyId = jQuery("#subscriptionPropertyId").val();
740
- var ga_view_id = jQuery("#ga_view_id").val();
741
- var PropOptions = '';
742
-
743
- //console.log("call option");
744
- //console.log(Object.keys(response.data.wep_properties).length +"=="+response.data.wep_properties.length);
745
- if(response.data != null && response.data.wep_properties.length > 0){
746
- jQuery.each(response.data.wep_properties, function (propKey, propValue) {
747
- var selected ="";
748
- if (subscriptionPropertyId == propValue.webPropertyId) {
749
- if(ga_view_id != "" && ga_view_id == propValue.id){
750
- selected = "selected='selected'";
751
- }else if(ga_view_id =="" ){
752
- selected = "selected='selected'";
753
- }
754
- /*if(type == "BOTH"){
755
- s_tracking_option = "both_ua";
756
- }*/
757
- jQuery("#both_ua_web_property_id_option_val").attr("data-profileid",propValue.id);
758
- jQuery("#"+s_tracking_option+"_web_property_id_option_val").attr("data-profileid",propValue.id);
759
  }else{
760
- selected = "";
761
- }
762
- PropOptions = PropOptions + '<option value="' + propValue.webPropertyId + '" ' + selected + ' data-accountid="' + propValue.accountId + '" data-profileid="' + propValue.id + '"> ' + propValue.accountName + ' - ' + propValue.propertyName + ' - ' + propValue.name + ' - ' + propValue.webPropertyId +'</option>';
763
- });
764
- }else{
765
- //console.log("hide option");
766
- if(page == 1){
767
- list_analytics_web_properties(type, tvc_data, 2);
768
- return;
769
- }
770
- jQuery(".tvc-ua-option-more").hide();
771
- }
772
- jQuery('#ua_web_property_id_option > .tvc-select-items').append(PropOptions);
773
- jQuery('#both_ua_web_property_id_option > .tvc-select-items').append(PropOptions);
774
- }
775
- if (type == "GA4" || type == "BOTH") {
776
- //web_measurement_dropdown
777
- var subscriptionMeasurementId = jQuery("#subscriptionMeasurementId").val();
778
- var MeasOptions = '';
779
- if(response.data != null && response.data.wep_measurement.length > 0){
780
- jQuery.each(response.data.wep_measurement, function (measKey, measValue) {
781
- var web_property = measValue.name.split("/");
782
- if (subscriptionMeasurementId == measValue.measurementId) {
783
- var selected = "selected='selected'";
784
- /*if(type == "BOTH"){
785
- s_tracking_option = "both_ga4";
786
- };*/
787
- jQuery("#both_ga4_web_measurement_id_option_val").attr('data-name',web_property[1]);
788
- jQuery("#"+s_tracking_option+"_web_measurement_id_option_val").attr('data-name',web_property[1]);
789
- } else {
790
- var selected = "";
791
- }
792
- MeasOptions = MeasOptions + '<option value="' + measValue.measurementId + '" ' + selected + ' data-name="'+web_property[1] +'"'+ ' data-accountid="' + measValue.accountId + '"> ' + measValue.accountName + ' - ' + web_property[1] + ' - ' + measValue.measurementId + '</option>';
793
- });
794
- }else{
795
- //console.log("hide option");
796
- if(page == 1){
797
- list_analytics_web_properties(type, tvc_data, 2);
798
- return;
799
- }
800
- jQuery(".tvc-ga4-option-more").hide();
801
- }
802
- jQuery('#ga4_web_measurement_id_option > .tvc-select-items').append(MeasOptions);
803
- jQuery('#both_ga4_web_measurement_id_option > .tvc-select-items').append(MeasOptions);
804
- }
805
- // tracking code
806
- jQuery(".slect2bx").select2();
807
-
808
- }else if( response != null && response.error == true && response.errors != undefined){
809
- const errors = response.errors[0];
810
  add_message("error",errors);
811
- var error_msg = response.errors;
812
  }else{
813
- add_message("error","It seems "+type +" Google analytics account not fetched");
814
- }
815
- setTimeout(function(){
816
- user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Analytics_account_list');
817
- }, 15000);
818
-
819
- is_validate_step("step_1");
820
  loaderSection(false);
821
  }
822
  });
823
  }
824
  function call_list_googl_ads_account(tvc_data){
825
- let ads_account_length = jQuery('#ads-account option').length;
826
- if(ads_account_length < 2){
827
  list_googl_ads_account(tvc_data);
828
- }
829
  }
830
  // get list google ads dropdown options
831
  function list_googl_ads_account(tvc_data) {
832
- //loaderSection(true);
833
  var selectedValue = jQuery("#subscriptionGoogleAdsId").val();
834
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
835
  jQuery.ajax({
@@ -838,7 +790,6 @@ function list_googl_ads_account(tvc_data) {
838
  url: tvc_ajax_url,
839
  data: {action: "list_googl_ads_account", tvc_data:tvc_data, conversios_onboarding_nonce:conversios_onboarding_nonce},
840
  success: function (response) {
841
- console.log(response);
842
  var btn_cam = 'ads_list';
843
  if (response.error === false) {
844
  var error_msg = 'null';
@@ -862,28 +813,31 @@ function list_googl_ads_account(tvc_data) {
862
  }
863
  }
864
  });
 
865
  }
866
  }
867
  } else {
868
  add_message("warning","There are no Google ads accounts associated with email.");
869
  var error_msg = response.errors;
870
  }
871
- setTimeout(function(){
872
  user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Ads_account_list');
873
- }, 5000);
874
 
875
- //loaderSection(false);
 
876
  }
877
  });
878
  }
879
 
880
  function call_list_google_merchant_account(tvc_data){
881
- let mcc_account_length = jQuery('#google_merchant_center_id option').length;
882
- if(mcc_account_length < 2){
883
  list_google_merchant_account(tvc_data);
884
- }
885
  }
886
  function list_google_merchant_account(tvc_data){
 
887
  var selectedValue = jQuery("#subscriptionMerchantCenId").val();
888
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
889
  jQuery.ajax({
@@ -910,6 +864,7 @@ function list_google_merchant_account(tvc_data){
910
  }
911
  }
912
  });
 
913
  }else{
914
  add_message("error","There are no Google merchant center accounts associated with email.");
915
  }
@@ -918,13 +873,13 @@ function list_google_merchant_account(tvc_data){
918
  var error_msg = response.errors;
919
  add_message("error","There are no Google merchant center accounts associated with email.");
920
  }
921
- setTimeout(function(){
922
  user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Merchant_account_list');
923
- }, 10000);
924
-
 
925
  }
926
  });
927
- loaderSection(false);
928
  }
929
  /* Create function */
930
  function create_google_ads_account(tvc_data){
@@ -933,7 +888,7 @@ function create_google_ads_account(tvc_data){
933
  var btn_cam = 'create_new';
934
  var ename = 'conversios_onboarding';
935
  var event_label = 'ads';
936
- user_tracking_data(btn_cam, error_msg,ename,event_label);
937
  jQuery.ajax({
938
  type: "POST",
939
  dataType: "json",
@@ -966,7 +921,7 @@ function create_google_ads_account(tvc_data){
966
  var error_msg = response.errors;
967
  add_message("error",response.data.message);
968
  }
969
- user_tracking_data(btn_cam, error_msg,ename,event_label);
970
 
971
  loaderSection(false);
972
  }
@@ -1003,7 +958,7 @@ function create_google_merchant_center_account(tvc_data){
1003
  var btn_cam = 'create_new';
1004
  var ename = 'conversios_onboarding';
1005
  var event_label = 'gmc';
1006
- user_tracking_data(btn_cam, error_msg,ename,event_label);
1007
 
1008
  var data = {
1009
  action: "create_google_merchant_center_account",
@@ -1042,7 +997,7 @@ function create_google_merchant_center_account(tvc_data){
1042
  } else {
1043
  add_message("error","There was error to create merchant center account");
1044
  }
1045
- user_tracking_data(btn_cam, error_msg,ename,event_label);
1046
 
1047
  jQuery("#createmerchantpopup").removeClass('showpopup');
1048
  jQuery('body').removeClass('scrlnone');
@@ -1063,7 +1018,7 @@ function user_tracking_data(event_name,error_msg,screen_name,event_label=''){
1063
  url: tvc_ajax_url,
1064
  data: {action: "update_user_tracking_data", event_name:event_name, error_msg:error_msg, screen_name:screen_name,event_label:event_label},
1065
  success: function (response) {
1066
- console.log('user tracking');
1067
  }
1068
  });
1069
  }
94
  jQuery(window).click(function(){
95
  jQuery('.tvc-dropdown-content').hide();
96
  })
97
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /*jQuery(".google_analytics_sel").on( "change", function() {
99
  is_validate_step("step_1");
100
  jQuery(".onbrdstep-1").removeClass('selectedactivestep');
140
  jQuery("[data-id=step_3]").attr("data-is-done",0);
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  function is_change_analytics_account(){
144
  let tracking_option = jQuery('input[type=radio][name=analytic_tag_type]:checked').val();
145
  let old_tracking_option = jQuery('#old_tracking').attr("data-tracking_option");
243
  if (response.error === false) {
244
  add_message("success","Google Analytics successfully updated.");
245
  var error_msg = 'null';
246
+ //user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Analytics_account');
247
  return true;
248
  }else{
249
  var error_msg = response.errors;
250
  add_message("error","Error while updating Google Analytics.");
251
+ //user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Analytics_account');
252
  return false;
253
  }
254
 
292
  var btn_cam = 'save_ads';
293
  if(response.error === false) {
294
  var error_msg = 'null';
295
+ //user_tracking_data(btn_cam, error_msg, 'conversios_onboarding','Save_Google_Ads_account');
296
  add_message("success","Google Ads successfully updated.");
297
  let tracking_option = jQuery('input:radio[name=analytic_tag_type]:checked').val();
298
  var s_tracking_option = tracking_option.toLowerCase();
358
  url: tvc_ajax_url,
359
  data: Ga4linkData,
360
  success: function (response) {
361
+ //console.log(response);
362
  clearTimeout(tvc_time_out);
363
  if(response.error === false){
364
  add_message("success","Google ananlytics and google ads linked successfully.");
403
  url: tvc_ajax_url,
404
  data: Ga4linkData,
405
  success: function (response) {
406
+ //console.log(response);
407
  clearTimeout(tvc_time_out);
408
  if(response.error === false){
409
  add_message("success","Google ananlytics and google ads linked successfully.");
429
 
430
  }else{
431
  var error_msg = response.errors;
432
+ //user_tracking_data(btn_cam, error_msg, 'conversios_onboarding','Save_Google_Ads_account');
433
  add_message("error","Error while updating Google Ads.");
434
  }
435
 
497
  var error_msg = response.errors;
498
  add_message("error","Error while updating Google merchant center.");
499
  }
500
+ //user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Save_Google_Merchant_account');
501
  //loaderSection(false);
502
  }
503
  });
628
  });
629
  }
630
  /* List function */
631
+ //call get list properties function base on tracking_option
632
+ function call_list_analytics_account(tvc_data,page =1){
633
+ let account_list_length = jQuery('#ua_account_id_option option').length;
634
+ if(page == 1){
635
+ list_analytics_account(tvc_data,page);
636
+ }else if(page > 1 && account_list_length > 2){
637
+ list_analytics_account(tvc_data,page);
 
638
  }
639
+ /*if(account_list_length < 2 || page != 1){
640
+ list_analytics_account(tvc_data,page);
 
 
641
  }else if( page != 1){
642
+ list_analytics_account(tvc_data,page);
643
+ }*/
644
+ }
645
+ // get list of google analytics account
646
+ function list_analytics_account(tvc_data, page =1) {
647
+ loaderSection(true);
648
+ var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
649
+ jQuery.ajax({
650
+ type: "POST",
651
+ dataType: "json",
652
+ url: tvc_ajax_url,
653
+ data: {action: "get_analytics_account_list",tvc_data:tvc_data,page:page,conversios_onboarding_nonce:conversios_onboarding_nonce},
654
+ success: function (response) {
655
+ if (response && response.error == false) {
656
+ var error_msg = 'null';
657
+ if(response?.data?.items.length > 0){
658
+ var AccOptions = '';
659
+ var selected = '';
660
+ response?.data?.items.forEach(function(item){
661
+ AccOptions = AccOptions + '<option value="' + item.id + '" ' + selected + 'data-cat="accounts" data-accountid="' + item.id + '"> ' + item.name +'-'+ item.id +'</option>';
662
+ });
663
+ jQuery('#ga4_account_id_option > .tvc-select-items').append(AccOptions); //GA4
664
+ jQuery('#ua_account_id_option > .tvc-select-items').append(AccOptions); //GA3
665
+ jQuery('#both_ua_account_id_option > .tvc-select-items').append(AccOptions); //BOTH GA3
666
+ jQuery('#both_ga4_account_id_option > .tvc-select-items').append(AccOptions); //BOTH GA4
667
+ jQuery(".tvc-edit-accounts").removeClass('tvc-disable-edits');
668
+ jQuery(".tvc-edit-acc_fire").hide();
669
+ }else if(page > 1){//load more error message
670
+ jQuery('.tvc_load_more_acc').hide(); //hide load more
671
+ add_message("error","There are no more Google Analytics accounts associated with this email.");
672
+ }else{
673
+ add_message("error","There are no Google Analytics accounts associated with this email.");
674
+ }
675
+
676
+ }else if( response && response.error == true && response.error != undefined){
677
+ const errors = response.error[0];
678
+ add_message("error",errors);
679
+ var error_msg = errors;
680
+ }else{
681
+ add_message("error","There are no Google Analytics accounts associated with this email.");
682
+ }
683
+ /*setTimeout(function(){
684
+ user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Analytics_account_list');
685
+ }, 15000);*/
686
+ jQuery("#tvc-ga4-acc-edit-acc_box")?.removeClass('tvc-disable-edits');
687
+ //is_validate_step("step_1");
688
+ loaderSection(false);
689
  }
690
+ });
 
691
  }
692
+
693
  // get list properties dropdown options
694
+ function list_analytics_web_properties(type, tvc_data,account_id) {
695
  loaderSection(true);
696
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
 
697
  jQuery.ajax({
698
  type: "POST",
699
  dataType: "json",
700
  url: tvc_ajax_url,
701
+ data: {action: "get_analytics_web_properties",account_id: account_id,type: type,tvc_data:tvc_data, conversios_onboarding_nonce:conversios_onboarding_nonce},
702
  success: function (response) {
703
+ if (response && response.error == false) {
704
+ var error_msg = 'null';
705
+ if(type == "GA4"){
706
+ jQuery('#both_ga4_web_measurement_id_option_val').html('Select Measurement Id');
707
+ jQuery('#both_ga4_web_measurement_id_option_val').attr("data-val","");
708
+ jQuery('#both_ga4_web_measurement_id_option_val').attr("data-name","");
709
+ jQuery('#both_ga4_web_measurement_id_option_val').attr("data-accountid","");
 
 
 
 
710
 
711
+ jQuery('#ga4_web_measurement_id_option_val').html('Select Measurement Id');
712
+ jQuery('#ga4_web_measurement_id_option_val').attr("data-val","");
713
+ jQuery('#ga4_web_measurement_id_option_val').attr("data-name","");
714
+ jQuery('#ga4_web_measurement_id_option_val').attr("data-accountid","");
715
+
716
+ jQuery('#ga4_web_measurement_id_option > .tvc-select-items').html(''); //GA4
717
+ jQuery('#both_ga4_web_measurement_id_option > .tvc-select-items').html(''); //Both GA4
718
+
719
+ if(response?.data?.wep_measurement.length > 0){
720
+ var streamOptions = '<option value="">Select Measurement Id</option>';
721
+ var selected = '';
722
+ response?.data?.wep_measurement.forEach(function(item){ let dataName = item.name.split("/");
723
+ streamOptions = streamOptions + '<option value="' + item.measurementId + '" data-cat="dataStreams" data-name="'+ dataName[1] +'" data-accountid="' + item.accountId + '">' + item.measurementId +' - '+ item.displayName +'</option>';
724
+ });
725
+ jQuery('#ga4_web_measurement_id_option > .tvc-select-items').append(streamOptions); //GA4
726
+ jQuery('#both_ga4_web_measurement_id_option > .tvc-select-items').append(streamOptions); //BOTH
727
+ jQuery("#tvc-ga4-web-edit_box").removeClass('tvc-disable-edits');
728
+ jQuery("#both-tvc-ga4-web-edit_box").removeClass('tvc-disable-edits');
729
+ jQuery("#both-tvc-ga4-acc-edit").hide();
730
+ jQuery("#tvc-ga4-web-edit").hide();
 
 
 
 
731
  }else{
732
+ add_message("error","There are no Google Analytics 4 Properties associated with this email.");
733
+ }
734
+ }
735
+ if(type == "UA"){
736
+ jQuery('#ua_web_property_id_option_val').html('Select Property Id');
737
+ jQuery('#ua_web_property_id_option_val').attr("data-val","");
738
+ jQuery('#ua_web_property_id_option_val').attr("data-profileid","");
739
+ jQuery('#ua_web_property_id_option_val').attr("data-accountid","");
740
+
741
+ jQuery('#both_ua_web_property_id_option_val').html('Select Property Id');
742
+ jQuery('#both_ua_web_property_id_option_val').attr("data-val","");
743
+ jQuery('#both_ua_web_property_id_option_val').attr("data-profileid","");
744
+ jQuery('#both_ua_web_property_id_option_val').attr("data-accountid","");
745
+
746
+ jQuery('#ua_web_property_id_option > .tvc-select-items').html(''); //GA3
747
+ jQuery('#both_ua_web_property_id_option > .tvc-select-items').html(''); //BOTH GA3
748
+
749
+ if(response?.data?.wep_properties.length > 0){
750
+ var PropOptions = '<option value="">Select Property Id</option>';
751
+ var selected = '';
752
+ response?.data?.wep_properties.forEach(function(item){
753
+ PropOptions = PropOptions + '<option value="' + item.webPropertyId + '" data-profileid="'+item.id+'" data-cat="webProperties" data-accountid="' + item.accountId + '"> ' + item.webPropertyId +' - '+ item.name +'</option>';
754
+ });
755
+ jQuery('#ua_web_property_id_option > .tvc-select-items').append(PropOptions); //GA3
756
+ jQuery('#both_ua_web_property_id_option > .tvc-select-items').append(PropOptions); //BOTH
757
+ jQuery("#tvc-ua-web-edit_box").removeClass('tvc-disable-edits');
758
+ jQuery("#both-tvc-ua-web-edit_box").removeClass('tvc-disable-edits');
759
+ jQuery("#both-tvc-ua-acc-edit").hide();
760
+ jQuery("#tvc-ua-web-edit").hide();
761
+ }else{
762
+ add_message("error","There are no Google Analytics Properties associated with this email.");
763
+ }
764
+ }
765
+ }else if( response && response.error == true && response.error != undefined){
766
+ const errors = response.error[0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
  add_message("error",errors);
768
+ var error_msg = errors;
769
  }else{
770
+ add_message("error","There are no Google Analytics Properties associated with this email.");
771
+ }
 
 
 
 
 
772
  loaderSection(false);
773
  }
774
  });
775
  }
776
  function call_list_googl_ads_account(tvc_data){
777
+ //let ads_account_length = jQuery('#ads-account option').length;
778
+ //if(ads_account_length < 2){
779
  list_googl_ads_account(tvc_data);
780
+ //}
781
  }
782
  // get list google ads dropdown options
783
  function list_googl_ads_account(tvc_data) {
784
+ loaderSection(true);
785
  var selectedValue = jQuery("#subscriptionGoogleAdsId").val();
786
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
787
  jQuery.ajax({
790
  url: tvc_ajax_url,
791
  data: {action: "list_googl_ads_account", tvc_data:tvc_data, conversios_onboarding_nonce:conversios_onboarding_nonce},
792
  success: function (response) {
 
793
  var btn_cam = 'ads_list';
794
  if (response.error === false) {
795
  var error_msg = 'null';
813
  }
814
  }
815
  });
816
+ jQuery('#tvc-gaAds-acc-edit').hide();
817
  }
818
  }
819
  } else {
820
  add_message("warning","There are no Google ads accounts associated with email.");
821
  var error_msg = response.errors;
822
  }
823
+ /*setTimeout(function(){
824
  user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Ads_account_list');
825
+ }, 5000); */
826
 
827
+ loaderSection(false);
828
+ $('#ads-account').prop('disabled', false);
829
  }
830
  });
831
  }
832
 
833
  function call_list_google_merchant_account(tvc_data){
834
+ //let mcc_account_length = jQuery('#google_merchant_center_id option').length;
835
+ //if(mcc_account_length < 2){
836
  list_google_merchant_account(tvc_data);
837
+ //}
838
  }
839
  function list_google_merchant_account(tvc_data){
840
+ loaderSection(true);
841
  var selectedValue = jQuery("#subscriptionMerchantCenId").val();
842
  var conversios_onboarding_nonce = jQuery("#conversios_onboarding_nonce").val();
843
  jQuery.ajax({
864
  }
865
  }
866
  });
867
+ jQuery('#tvc-gmc-acc-edit').hide();
868
  }else{
869
  add_message("error","There are no Google merchant center accounts associated with email.");
870
  }
873
  var error_msg = response.errors;
874
  add_message("error","There are no Google merchant center accounts associated with email.");
875
  }
876
+ /*setTimeout(function(){
877
  user_tracking_data(btn_cam, error_msg,'conversios_onboarding','Get_Google_Merchant_account_list');
878
+ }, 10000); */
879
+ loaderSection(false);
880
+ $('#google_merchant_center_id').prop('disabled', false);
881
  }
882
  });
 
883
  }
884
  /* Create function */
885
  function create_google_ads_account(tvc_data){
888
  var btn_cam = 'create_new';
889
  var ename = 'conversios_onboarding';
890
  var event_label = 'ads';
891
+ //user_tracking_data(btn_cam, error_msg,ename,event_label);
892
  jQuery.ajax({
893
  type: "POST",
894
  dataType: "json",
921
  var error_msg = response.errors;
922
  add_message("error",response.data.message);
923
  }
924
+ //user_tracking_data(btn_cam, error_msg,ename,event_label);
925
 
926
  loaderSection(false);
927
  }
958
  var btn_cam = 'create_new';
959
  var ename = 'conversios_onboarding';
960
  var event_label = 'gmc';
961
+ //user_tracking_data(btn_cam, error_msg,ename,event_label);
962
 
963
  var data = {
964
  action: "create_google_merchant_center_account",
997
  } else {
998
  add_message("error","There was error to create merchant center account");
999
  }
1000
+ //user_tracking_data(btn_cam, error_msg,ename,event_label);
1001
 
1002
  jQuery("#createmerchantpopup").removeClass('showpopup');
1003
  jQuery('body').removeClass('scrlnone');
1018
  url: tvc_ajax_url,
1019
  data: {action: "update_user_tracking_data", event_name:event_name, error_msg:error_msg, screen_name:screen_name,event_label:event_label},
1020
  success: function (response) {
1021
+ //console.log('user tracking');
1022
  }
1023
  });
1024
  }
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>
@@ -138,13 +138,12 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
138
  'icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/conversios-menu.png"),
139
  'acitve_icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/active-conversios-menu.png")
140
  ),
141
- 'conversios-google-shopping-feed'=>array('title'=>esc_html__('Google Shopping','enhanced-e-commerce-for-woocommerce-store')),
142
- 'conversios-google-ads'=>array('title'=>esc_html__('Google Ads','enhanced-e-commerce-for-woocommerce-store')),
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")
146
  ),
147
- 'conversios-google-analytics'=>array('title'=>esc_html__('Account Settings','enhanced-e-commerce-for-woocommerce-store')),
148
  );
149
  }
150
  if($this->plan_id == 1){
@@ -180,9 +179,32 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
180
  $icon =$value['acitve_icon'];
181
  }
182
  }
183
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  <li class="<?php echo esc_attr($is_active); ?>">
185
- <a href="<?php echo esc_url_raw($this->site_url.$key); ?>">
186
  <?php if($icon != ""){?>
187
  <span class="navinfoicon"><img src="<?php echo esc_url_raw($icon); ?>" /></span>
188
  <?php } ?>
@@ -190,6 +212,8 @@ if ( ! class_exists( 'Conversios_Header' ) ) {
190
  </a>
191
  </li>
192
  <?php
 
 
193
  }
194
  }?>
195
  </ul>
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>
138
  'icon'=>esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/conversios-menu.png"),
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")
146
  ),
 
147
  );
148
  }
149
  if($this->plan_id == 1){
179
  $icon =$value['acitve_icon'];
180
  }
181
  }
182
+ $menu_url = $this->site_url.$key;
183
+ if(isset($value['slug']) && $value['slug'] ){
184
+ $menu_url = $this->site_url.$value['slug'];
185
+ }
186
+ if($key == "conversios-google-shopping-feed"){
187
+ ?>
188
+ <li class="<?php echo esc_attr($is_active); ?>">
189
+ <div class="con-dropdown">
190
+ <a href="<?php echo esc_url_raw($menu_url); ?>" class="dropbtn">
191
+ <?php if($icon != ""){?>
192
+ <span class="navinfoicon"><img src="<?php echo esc_url_raw($icon); ?>" /></span>
193
+ <?php } ?>
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>
203
+ <?php
204
+ }else{
205
+ ?>
206
  <li class="<?php echo esc_attr($is_active); ?>">
207
+ <a href="<?php echo esc_url_raw($menu_url); ?>">
208
  <?php if($icon != ""){?>
209
  <span class="navinfoicon"><img src="<?php echo esc_url_raw($icon); ?>" /></span>
210
  <?php } ?>
212
  </a>
213
  </li>
214
  <?php
215
+ }
216
+
217
  }
218
  }?>
219
  </ul>
admin/partials/general-fields.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  echo "<script>var return_url ='".esc_url_raw($this->url)."';</script>";
3
  $TVC_Admin_Helper = new TVC_Admin_Helper();
 
4
  $class="";
5
  $message_p = "";
6
  if (isset($_POST['ee_submit_plugin'])) {
@@ -38,17 +39,61 @@ if (isset($_POST['ee_submit_plugin'])) {
38
  $settings[$val] = isset($_POST[$val])?sanitize_text_field($_POST[$val]):"";
39
  }
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
 
48
  $class='alert-message tvc-alert-success';
49
  $message_p = esc_html__( 'Your settings have been saved.', 'enhanced-e-commerce-for-woocommerce-store' );
50
  }
51
  $data = unserialize(get_option('ee_options'));
 
52
  $subscription_id = $TVC_Admin_Helper->get_subscriptionId();
53
  $TVC_Admin_Helper->add_spinner_html();
54
  $google_detail = $TVC_Admin_Helper->get_ee_options_data();
@@ -86,82 +131,52 @@ if(isset($google_detail['setting'])){
86
  </div>
87
  </div>
88
  <?php }?>
89
- <div class="">
90
- <div class="row mb-3">
91
- <div class="col-6 col-md-6 col-lg-6">
92
- <h2 class="ga-title"><?php esc_html_e("Connected Google Analytics Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
93
- </div>
94
- <div class="col-6 col-md-6 col-lg-6 text-right">
95
- <div class="acc-num">
96
- <p class="ga-text">
97
- <?php echo (isset($data['ga_id']) && $data['ga_id'] != '') ? $data['ga_id'] : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
98
- </p>
99
- <?php
100
- if (isset($data['ga_id']) && $data['ga_id'] != '') {
101
- 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>';
102
- } else {
103
- 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>';
104
- }?>
105
- </div>
106
- </div>
107
- </div>
108
- <div class="row mb-3">
109
- <div class="col-6 col-md-6 col-lg-6">
110
- <h2 class="ga-title"><?php esc_html_e("Connected Google Analytics 4 Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
111
- </div>
112
- <div class="col-6 col-md-6 col-lg-6 text-right">
113
- <div class="acc-num">
114
- <p class="ga-text">
115
- <?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>'; ?>
116
- </p>
117
- <?php
118
- if (isset($data['gm_id']) && esc_attr($data['gm_id']) != '') {
119
- 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>';
120
- } else {
121
- 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>';
122
- }?>
123
- </div>
124
- </div>
125
- </div>
126
- <div class="row mb-3">
127
- <div class="col-6 col-md-6 col-lg-6">
128
- <h2 class="ga-title"><?php esc_html_e("Linked Google Ads Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
129
- </div>
130
- <div class="col-6 col-md-6 col-lg-6 text-right">
131
- <div class="acc-num">
132
- <p class="ga-text">
133
- <?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>'; ?>
134
- </p>
135
- <?php
136
- if (isset($data['google_ads_id']) && esc_attr($data['google_ads_id']) != '') {
137
- 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>';
138
- } else {
139
- 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>';
140
- }?>
141
  </div>
142
- </div>
143
- </div>
144
- <div class="row mb-3">
145
- <div class="col-6 col-md-6 col-lg-6">
146
- <h2 class="ga-title"><?php esc_html_e("Linked Google Merchant Center Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  </div>
148
- <div class="col-6 col-md-6 col-lg-6 text-right">
149
- <div class="acc-num">
150
- <p class="ga-text">
151
- <?php echo (isset($data['google_merchant_id']) && $data['google_merchant_id'] != '') ? esc_attr($data['google_merchant_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
152
- </p>
153
- <?php
154
- if (isset($data['google_merchant_id']) && esc_attr($data['google_merchant_id']) != '') {
155
- 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>';
156
- } else {
157
- 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>';
158