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 | 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 +9 -17
- admin/class-conversios-onboarding.php +274 -92
- admin/css/enhanced-ecommerce-google-analytics-admin.css +4 -0
- admin/css/style.css +61 -7
- admin/helper/class-onboarding-helper.php +105 -48
- admin/js/onboarding-custom.js +156 -201
- admin/partials/class-conversios-header.php +30 -6
- admin/partials/general-fields.php +563 -388
- enhanced-ecommerce-google-analytics.php +2 -2
- includes/setup/google-shopping-feed-gaa-config.php +147 -1
- includes/setup/google-shopping-feed.php +1 -1
- readme.txt +7 -3
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 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
);
|
252 |
add_submenu_page(
|
253 |
'conversios',
|
254 |
-
esc_html__('
|
255 |
-
esc_html__('
|
256 |
'manage_options',
|
257 |
-
'conversios-google-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
284 |
-
</div>
|
285 |
</div>
|
286 |
-
|
|
|
|
|
287 |
</div>
|
288 |
</div>
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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="
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
|
|
328 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
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 |
-
|
|
|
|
|
|
|
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.','
|
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 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
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.
|
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 |
-
|
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 |
-
|
831 |
-
|
832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
}
|
834 |
|
835 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
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:
|
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:
|
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
|
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:
|
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 |
-
|
13 |
}
|
14 |
if(!class_exists('Conversios_Onboarding_Helper')):
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
//analytics
|
21 |
-
|
|
|
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 |
-
|
68 |
-
|
69 |
require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
$tvc_data = json_decode(str_replace(""", "\"", $data));
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
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 |
-
|
472 |
-
|
473 |
-
|
474 |
protected $merchantId;
|
475 |
protected $access_token;
|
476 |
protected $refresh_token;
|
477 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(""", "\"", $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(""", "\"", $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 |
-
|
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
|
684 |
-
function
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
list_analytics_web_properties("UA", tvc_data, page);
|
691 |
}
|
692 |
-
|
693 |
-
|
694 |
-
if(web_measurement_id_length < 2){
|
695 |
-
list_analytics_web_properties("GA4", tvc_data, page);
|
696 |
}else if( page != 1){
|
697 |
-
|
698 |
-
}
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
}
|
709 |
-
|
710 |
-
}
|
711 |
}
|
|
|
712 |
// get list properties dropdown options
|
713 |
-
function list_analytics_web_properties(type, tvc_data,
|
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,
|
722 |
success: function (response) {
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
else if(type == "UA" || type == "BOTH")
|
731 |
-
{
|
732 |
-
btn_cam = 'ga3_list'
|
733 |
-
}
|
734 |
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
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 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
jQuery("#
|
788 |
-
jQuery("#"
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
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 =
|
812 |
}else{
|
813 |
-
|
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 |
-
|
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 |
-
|
|
|
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 |
-
|
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 |
-
|
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-
|
142 |
-
'conversios-google-
|
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($
|
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 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
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 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
</div>
|
148 |
-
<
|
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 |
-
}?>
|
159 |
-
</div>
|
160 |
-
</div>
|
161 |
-
</div>
|
162 |
</div>
|
163 |
-
|
164 |
-
<form id="ee_plugin_form" class="tvc_ee_plugin_form" name="google-analytic-setting-form" method="post" >
|
165 |
<table class="table">
|
166 |
<tbody>
|
167 |
<tr>
|
@@ -195,10 +210,10 @@ if(isset($google_detail['setting'])){
|
|
195 |
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you have Guest Check out enable, we recommend you to add this code.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
196 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
197 |
</div>
|
198 |
-
</label>
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
<tr>
|
203 |
<th>
|
204 |
<label class="ga-title align-middle"><?php esc_html_e("GA4 - API secrets ","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></label>
|
@@ -280,329 +295,465 @@ if(isset($google_detail['setting'])){
|
|
280 |
</label>
|
281 |
</td>
|
282 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
<tr>
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
<div class="tvc-tooltip">
|
291 |
-
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("
|
292 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
293 |
</div>
|
294 |
-
|
|
|
295 |
</tr>
|
296 |
<tr>
|
297 |
-
<
|
298 |
-
<
|
299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
<div class="tvc-tooltip">
|
301 |
-
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("
|
302 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
303 |
</div>
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
}
|
339 |
-
}?>
|
340 |
-
</select>
|
341 |
-
<div class="tvc-tooltip">
|
342 |
-
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When product impressions, clicks or add to cart google analytics ecommerce events are not working on your store, select the implemented hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
343 |
-
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
344 |
-
</div>
|
345 |
-
<small>(At home, collection, shop, product details and cart page)</small>
|
346 |
-
</td>
|
347 |
-
</tr>
|
348 |
-
<tr>
|
349 |
-
<th style="padding: 0 1rem;">
|
350 |
-
<label class="ga-title align-middle"><?php esc_html_e("Product detail page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
351 |
-
</th>
|
352 |
-
<td>
|
353 |
-
<?php $tvc_product_detail_data_collection_method = isset($data['tvc_product_detail_data_collection_method'])?$data['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
|
354 |
-
$list = array(
|
355 |
-
"woocommerce_before_single_product" => "woocommerce_before_single_product (default hook)",
|
356 |
-
"woocommerce_after_single_product" => "woocommerce_after_single_product (default hook)",
|
357 |
-
"woocommerce_single_product_summary" => "woocommerce_single_product_summary (default hook)",
|
358 |
-
"conversios_single_product" => "conversios_single_product (conversios hook)",
|
359 |
-
"on_page" => "On page load"
|
360 |
-
); ?>
|
361 |
-
<select name="tvc_product_detail_data_collection_method" class="data_collection_method">
|
362 |
-
<?php if(!empty($list)){
|
363 |
-
foreach($list as $key => $val){
|
364 |
-
$selected = ($tvc_product_detail_data_collection_method == $key)?"selected":"";
|
365 |
-
?>
|
366 |
-
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
367 |
-
<?php
|
368 |
-
}
|
369 |
-
}?>
|
370 |
-
</select>
|
371 |
-
<div class="tvc-tooltip">
|
372 |
-
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your product detail page is not being tracked in google analytics (view_item), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
373 |
-
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
374 |
-
</div>
|
375 |
-
</td>
|
376 |
-
</tr>
|
377 |
-
<tr>
|
378 |
-
<th style="padding: 0 1rem;">
|
379 |
-
<label class="ga-title align-middle"><?php esc_html_e("Checkout page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
380 |
-
</th>
|
381 |
-
<td>
|
382 |
-
<?php
|
383 |
-
$tvc_checkout_data_collection_method = isset($data['tvc_checkout_data_collection_method'])?$data['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
|
384 |
-
$list = array(
|
385 |
-
"woocommerce_before_checkout_form" => "woocommerce_before_checkout_form (default hook)",
|
386 |
-
"woocommerce_after_checkout_form" => "woocommerce_after_checkout_form (default hook)",
|
387 |
-
"woocommerce_checkout_billing" => "woocommerce_checkout_billing (default hook)",
|
388 |
-
"woocommerce_checkout_shipping" => "woocommerce_checkout_shipping (default hook)",
|
389 |
-
"woocommerce_checkout_order_review" => "woocommerce_checkout_order_review (default hook)",
|
390 |
-
"conversios_checkout_form" => "conversios_checkout_form (conversios hook)",
|
391 |
-
"on_page" =>"On page load"
|
392 |
-
); ?>
|
393 |
-
<select name="tvc_checkout_data_collection_method" class="data_collection_method">
|
394 |
-
<?php if(!empty($list)){
|
395 |
-
foreach($list as $key => $val){
|
396 |
-
$selected = ($tvc_checkout_data_collection_method == $key)?"selected":"";
|
397 |
-
?>
|
398 |
-
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
399 |
-
<?php
|
400 |
-
}
|
401 |
-
}?>
|
402 |
-
</select>
|
403 |
-
<div class="tvc-tooltip">
|
404 |
-
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your checkout is not being tracked in google analytics (checkout events), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
405 |
-
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
406 |
-
</div>
|
407 |
-
</td>
|
408 |
-
</tr>
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
</td>
|
601 |
-
</tr>
|
602 |
-
</table>
|
603 |
-
</div>
|
604 |
</td>
|
605 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
<tr>
|
607 |
<th>
|
608 |
<label class="ga-title align-middle" for="ga_PrivacyPolicy"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
@@ -652,6 +803,7 @@ jQuery(document).ready(function () {
|
|
652 |
jQuery(this).toggleClass('active');
|
653 |
jQuery('#'+faq_id).toggleClass('active');
|
654 |
});
|
|
|
655 |
jQuery(document).on('change','.css-selector',function(event){
|
656 |
//console.log(jQuery(this).val());
|
657 |
if(jQuery(this).val() == "custom"){
|
@@ -748,4 +900,27 @@ jQuery(document).ready(function () {
|
|
748 |
}
|
749 |
});
|
750 |
});
|
751 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
echo "<script>var return_url ='".esc_url_raw($this->url)."';</script>";
|
3 |
$TVC_Admin_Helper = new TVC_Admin_Helper();
|
4 |
+
$this->customApiObj = new CustomApi();
|
5 |
$class="";
|
6 |
$message_p = "";
|
7 |
if (isset($_POST['ee_submit_plugin'])) {
|
39 |
$settings[$val] = isset($_POST[$val])?sanitize_text_field($_POST[$val]):"";
|
40 |
}
|
41 |
|
|
|
42 |
$settings['fb_pixel_id'] = isset($_POST["fb_pixel_id"])?sanitize_text_field($_POST["fb_pixel_id"]):"";
|
43 |
$settings['ga4_api_secret'] = isset($_POST["ga4_api_secret"])?sanitize_text_field($_POST["ga4_api_secret"]):"";
|
44 |
|
45 |
$TVC_Admin_Helper->save_ee_options_settings($settings);
|
46 |
$TVC_Admin_Helper->update_app_status();
|
47 |
+
//google ads start
|
48 |
+
$response = $this->customApiObj->updateTrackingOption($_POST);
|
49 |
+
$googleDetail = $this->google_detail;
|
50 |
+
$googleDetail_setting = $this->google_detail['setting'];
|
51 |
+
if(isset($_POST['remarketing_tags'])){
|
52 |
+
update_option('ads_ert', sanitize_text_field($_POST['remarketing_tags']) );
|
53 |
+
$googleDetail_setting->remarketing_tags = sanitize_text_field($_POST['remarketing_tags']);
|
54 |
+
}else{
|
55 |
+
update_option('ads_ert', 0);
|
56 |
+
$googleDetail_setting->remarketing_tags = 0;
|
57 |
+
}
|
58 |
+
if(isset($_POST['dynamic_remarketing_tags'])){
|
59 |
+
update_option('ads_edrt', sanitize_text_field($_POST['dynamic_remarketing_tags']) );
|
60 |
+
$googleDetail_setting->dynamic_remarketing_tags = sanitize_text_field($_POST['dynamic_remarketing_tags']);
|
61 |
+
}else{
|
62 |
+
update_option('ads_edrt', 0);
|
63 |
+
$googleDetail_setting->dynamic_remarketing_tags = 0;
|
64 |
+
}
|
65 |
+
if($this->plan_id != 1){
|
66 |
+
if(isset($_POST['google_ads_conversion_tracking'])){
|
67 |
+
update_option('google_ads_conversion_tracking', sanitize_text_field($_POST['google_ads_conversion_tracking']) );
|
68 |
+
$googleDetail_setting->google_ads_conversion_tracking = sanitize_text_field($_POST['google_ads_conversion_tracking']);
|
69 |
+
}else{
|
70 |
+
update_option('google_ads_conversion_tracking', 0);
|
71 |
+
$googleDetail_setting->google_ads_conversion_tracking = 0;
|
72 |
+
}
|
73 |
+
if(isset($_POST['ga_EC'])){
|
74 |
+
update_option('ga_EC', sanitize_text_field($_POST['ga_EC']) );
|
75 |
+
}else{
|
76 |
+
update_option('ga_EC', 0);
|
77 |
+
}
|
78 |
+
if(isset($_POST['ee_conversio_send_to'])){
|
79 |
+
update_option('ee_conversio_send_to', sanitize_text_field($_POST['ee_conversio_send_to']) );
|
80 |
+
$googleDetail_setting->ee_conversio_send_to = sanitize_text_field($_POST['ee_conversio_send_to']);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
if(isset($_POST['link_google_analytics_with_google_ads'])){
|
84 |
+
$googleDetail_setting->link_google_analytics_with_google_ads = sanitize_text_field($_POST['link_google_analytics_with_google_ads']);
|
85 |
+
}else{
|
86 |
+
$googleDetail_setting->link_google_analytics_with_google_ads = 0;
|
87 |
+
}
|
88 |
+
$googleDetail['setting'] = $googleDetail_setting;
|
89 |
+
$TVC_Admin_Helper->set_ee_options_data($googleDetail);
|
90 |
+
//google ads end
|
91 |
|
92 |
$class='alert-message tvc-alert-success';
|
93 |
$message_p = esc_html__( 'Your settings have been saved.', 'enhanced-e-commerce-for-woocommerce-store' );
|
94 |
}
|
95 |
$data = unserialize(get_option('ee_options'));
|
96 |
+
$this->current_customer_id = $TVC_Admin_Helper->get_currentCustomerId();
|
97 |
$subscription_id = $TVC_Admin_Helper->get_subscriptionId();
|
98 |
$TVC_Admin_Helper->add_spinner_html();
|
99 |
$google_detail = $TVC_Admin_Helper->get_ee_options_data();
|
131 |
</div>
|
132 |
</div>
|
133 |
<?php }?>
|
134 |
+
<div class="row mb-3">
|
135 |
+
<div class="col-6 col-md-6 col-lg-6">
|
136 |
+
<h2 class="ga-title"><?php esc_html_e("Connected Google Analytics Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
|
137 |
+
</div>
|
138 |
+
<div class="col-6 col-md-6 col-lg-6 text-right">
|
139 |
+
<div class="acc-num">
|
140 |
+
<p class="ga-text">
|
141 |
+
<?php echo (isset($data['ga_id']) && $data['ga_id'] != '') ? $data['ga_id'] : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
|
142 |
+
</p>
|
143 |
+
<?php
|
144 |
+
if (isset($data['ga_id']) && $data['ga_id'] != '') {
|
145 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'.esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
|
146 |
+
} else {
|
147 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
|
148 |
+
}?>
|
149 |
+
</div>
|
150 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
</div>
|
152 |
+
<div class="row mb-3">
|
153 |
+
<div class="col-6 col-md-6 col-lg-6">
|
154 |
+
<h2 class="ga-title"><?php esc_html_e("Connected Google Analytics 4 Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
|
155 |
+
</div>
|
156 |
+
<div class="col-6 col-md-6 col-lg-6 text-right">
|
157 |
+
<div class="acc-num">
|
158 |
+
<p class="ga-text">
|
159 |
+
<?php echo (isset($data['gm_id']) && $data['gm_id'] != '') ? esc_attr($data['gm_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
|
160 |
+
</p>
|
161 |
+
<?php
|
162 |
+
if (isset($data['gm_id']) && esc_attr($data['gm_id']) != '') {
|
163 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
|
164 |
+
} else {
|
165 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
|
166 |
+
}?>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
<form id="ee_plugin_form" class="tvc_ee_plugin_form" name="google-analytic-setting-form" method="post" >
|
171 |
+
<div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_advset">
|
172 |
+
<?php esc_html_e("Advance Setting","enhanced-e-commerce-for-woocommerce-store"); ?>
|
173 |
+
<div class="tvc-tooltip">
|
174 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" Advance Setting.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
175 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
176 |
</div>
|
177 |
+
<img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
</div>
|
179 |
+
<div class="sec_con_integration advance-setting" id="sec_con_integration_advset">
|
|
|
180 |
<table class="table">
|
181 |
<tbody>
|
182 |
<tr>
|
210 |
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you have Guest Check out enable, we recommend you to add this code.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
211 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
212 |
</div>
|
213 |
+
</label>
|
214 |
+
</td>
|
215 |
+
</tr>
|
216 |
+
<?php if(isset($data['gm_id']) && $data['gm_id'] != '' && $plan_id != 1){ ?>
|
217 |
<tr>
|
218 |
<th>
|
219 |
<label class="ga-title align-middle"><?php esc_html_e("GA4 - API secrets ","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></label>
|
295 |
</label>
|
296 |
</td>
|
297 |
</tr>
|
298 |
+
</tbody>
|
299 |
+
</table>
|
300 |
+
</div>
|
301 |
+
<br />
|
302 |
+
<div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration">
|
303 |
+
<?php esc_html_e("Google Analytics Event Tracking - Custom Integration","enhanced-e-commerce-for-woocommerce-store"); ?>
|
304 |
+
<div class="tvc-tooltip">
|
305 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("This feature is for the woocommerce store which has changed standard woocommerce hooks or implemented custom woocommerce hooks.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
306 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
307 |
+
</div>
|
308 |
+
<img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" ></div>
|
309 |
+
<div class="sec_con_integration" id="sec_con_integration">
|
310 |
+
<table class="tracking-trigger">
|
311 |
+
<tr><th colspan="2">
|
312 |
+
<span>
|
313 |
+
<?php esc_html_e("Product data collection method ","enhanced-e-commerce-for-woocommerce-store"); ?>
|
314 |
+
<div class="tvc-tooltip">
|
315 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When you have custom woocommerce implementation and you have modified standard woocommerce hooks, you can configure/select your custom hooks from below to enable google analytics tracking for specific events.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
316 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
317 |
+
</div>
|
318 |
+
</span>
|
319 |
+
<span style="float: right;"><a href="<?php echo esc_url_raw("https://".TVC_AUTH_CONNECT_URL."/help-center/event-tracking-custom-integration.pdf"); ?>" target="_blank">Detailed Document</a></span>
|
320 |
+
</th></tr>
|
321 |
<tr>
|
322 |
+
<th style="padding: 0 1rem; width: 35%;">
|
323 |
+
<label class="ga-title align-middle"><?php esc_html_e("Product list","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
324 |
+
</th>
|
325 |
+
<td>
|
326 |
+
<?php $tvc_product_list_data_collection_method = isset($data['tvc_product_list_data_collection_method'])?$data['tvc_product_list_data_collection_method']:"woocommerce_after_shop_loop_item";
|
327 |
+
$list = array(
|
328 |
+
"woocommerce_before_shop_loop_item" => "woocommerce_before_shop_loop_item (default hook)",
|
329 |
+
"woocommerce_after_shop_loop_item" => "woocommerce_after_shop_loop_item (default hook)",
|
330 |
+
"woocommerce_before_shop_loop_item_title" => "woocommerce_before_shop_loop_item_title (default hook)",
|
331 |
+
"woocommerce_shop_loop_item_title" => "woocommerce_shop_loop_item_title (default hook)",
|
332 |
+
"woocommerce_after_shop_loop_item_title" => "woocommerce_after_shop_loop_item_title (default hook)",
|
333 |
+
"conversios_shop_loop_item" => "conversios_shop_loop_item (conversios hook)"
|
334 |
+
); ?>
|
335 |
+
<select name="tvc_product_list_data_collection_method" class="data_collection_method">
|
336 |
+
<?php if(!empty($list)){
|
337 |
+
foreach($list as $key => $val){
|
338 |
+
$selected = ($tvc_product_list_data_collection_method == $key)?"selected":"";
|
339 |
+
?>
|
340 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
341 |
+
<?php
|
342 |
+
}
|
343 |
+
}?>
|
344 |
+
</select>
|
345 |
<div class="tvc-tooltip">
|
346 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When product impressions, clicks or add to cart google analytics ecommerce events are not working on your store, select the implemented hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
347 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
348 |
</div>
|
349 |
+
<small>(At home, collection, shop, product details and cart page)</small>
|
350 |
+
</td>
|
351 |
</tr>
|
352 |
<tr>
|
353 |
+
<th style="padding: 0 1rem;">
|
354 |
+
<label class="ga-title align-middle"><?php esc_html_e("Product detail page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
355 |
+
</th>
|
356 |
+
<td>
|
357 |
+
<?php $tvc_product_detail_data_collection_method = isset($data['tvc_product_detail_data_collection_method'])?$data['tvc_product_detail_data_collection_method']:"woocommerce_after_single_product";
|
358 |
+
$list = array(
|
359 |
+
"woocommerce_before_single_product" => "woocommerce_before_single_product (default hook)",
|
360 |
+
"woocommerce_after_single_product" => "woocommerce_after_single_product (default hook)",
|
361 |
+
"woocommerce_single_product_summary" => "woocommerce_single_product_summary (default hook)",
|
362 |
+
"conversios_single_product" => "conversios_single_product (conversios hook)",
|
363 |
+
"on_page" => "On page load"
|
364 |
+
); ?>
|
365 |
+
<select name="tvc_product_detail_data_collection_method" class="data_collection_method">
|
366 |
+
<?php if(!empty($list)){
|
367 |
+
foreach($list as $key => $val){
|
368 |
+
$selected = ($tvc_product_detail_data_collection_method == $key)?"selected":"";
|
369 |
+
?>
|
370 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
371 |
+
<?php
|
372 |
+
}
|
373 |
+
}?>
|
374 |
+
</select>
|
375 |
<div class="tvc-tooltip">
|
376 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your product detail page is not being tracked in google analytics (view_item), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
377 |
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
378 |
</div>
|
379 |
+
</td>
|
380 |
+
</tr>
|
381 |
+
<tr>
|
382 |
+
<th style="padding: 0 1rem;">
|
383 |
+
<label class="ga-title align-middle"><?php esc_html_e("Checkout page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
384 |
+
</th>
|
385 |
+
<td>
|
386 |
+
<?php
|
387 |
+
$tvc_checkout_data_collection_method = isset($data['tvc_checkout_data_collection_method'])?$data['tvc_checkout_data_collection_method']:"woocommerce_before_checkout_form";
|
388 |
+
$list = array(
|
389 |
+
"woocommerce_before_checkout_form" => "woocommerce_before_checkout_form (default hook)",
|
390 |
+
"woocommerce_after_checkout_form" => "woocommerce_after_checkout_form (default hook)",
|
391 |
+
"woocommerce_checkout_billing" => "woocommerce_checkout_billing (default hook)",
|
392 |
+
"woocommerce_checkout_shipping" => "woocommerce_checkout_shipping (default hook)",
|
393 |
+
"woocommerce_checkout_order_review" => "woocommerce_checkout_order_review (default hook)",
|
394 |
+
"conversios_checkout_form" => "conversios_checkout_form (conversios hook)",
|
395 |
+
"on_page" =>"On page load"
|
396 |
+
); ?>
|
397 |
+
<select name="tvc_checkout_data_collection_method" class="data_collection_method">
|
398 |
+
<?php if(!empty($list)){
|
399 |
+
foreach($list as $key => $val){
|
400 |
+
$selected = ($tvc_checkout_data_collection_method == $key)?"selected":"";
|
401 |
+
?>
|
402 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
403 |
+
<?php
|
404 |
+
}
|
405 |
+
}?>
|
406 |
+
</select>
|
407 |
+
<div class="tvc-tooltip">
|
408 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your checkout is not being tracked in google analytics (checkout events), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
409 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
410 |
+
</div>
|
411 |
+
</td>
|
412 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
|
414 |
+
<tr>
|
415 |
+
<th style="padding: 0 1rem;">
|
416 |
+
<label class="ga-title align-middle"><?php esc_html_e("Order confirmation page","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
417 |
+
</th>
|
418 |
+
<td>
|
419 |
+
<?php
|
420 |
+
$tvc_thankyou_data_collection_method = isset($data['tvc_thankyou_data_collection_method'])?$data['tvc_thankyou_data_collection_method']:"woocommerce_thankyou";
|
421 |
+
$list = array(
|
422 |
+
"woocommerce_thankyou" => "woocommerce_thankyou (default hook)",
|
423 |
+
"woocommerce_before_thankyou" => "woocommerce_before_thankyou (default hook)",
|
424 |
+
"conversios_thankyou" => "conversios_thankyou (conversios hook)",
|
425 |
+
"on_page" =>"On page load"
|
426 |
+
); ?>
|
427 |
+
<select name="tvc_thankyou_data_collection_method" class="data_collection_method">
|
428 |
+
<?php if(!empty($list)){
|
429 |
+
foreach($list as $key => $val){
|
430 |
+
$selected = ($tvc_thankyou_data_collection_method == $key)?"selected":"";
|
431 |
+
?>
|
432 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
433 |
+
<?php
|
434 |
+
}
|
435 |
+
}?>
|
436 |
+
</select>
|
437 |
+
<div class="tvc-tooltip">
|
438 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("When your transactions are not being tracked in google analytics (purchase event), try changing the relevant hook from the dropdown.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
439 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
440 |
+
</div>
|
441 |
+
</td>
|
442 |
+
</tr>
|
443 |
+
|
444 |
+
<tr><th colspan="2">
|
445 |
+
<span>
|
446 |
+
<?php esc_html_e("Event selector","enhanced-e-commerce-for-woocommerce-store"); ?>
|
447 |
+
<div class="tvc-tooltip">
|
448 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("If you change your front end class or id for below events, select/input the changed class or id.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
449 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
450 |
+
</div>
|
451 |
+
</span>
|
452 |
+
</th></tr>
|
453 |
+
<tr>
|
454 |
+
<th style="padding: 0 1rem;">
|
455 |
+
<label class="ga-title align-middle"><?php esc_html_e("Product page AddToCart button","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
456 |
+
</th>
|
457 |
+
<td>
|
458 |
+
<?php $tvc_product_detail_addtocart_selector = isset($data['tvc_product_detail_addtocart_selector'])?$data['tvc_product_detail_addtocart_selector']:"default";
|
459 |
+
$list = array(
|
460 |
+
"default" => "default",
|
461 |
+
"custom" => "custom"
|
462 |
+
); ?>
|
463 |
+
<select name="tvc_product_detail_addtocart_selector" class="select-sm css-selector">
|
464 |
+
<?php if(!empty($list)){
|
465 |
+
foreach($list as $key => $val){
|
466 |
+
$selected = ($tvc_product_detail_addtocart_selector == $key)?"selected":"";
|
467 |
+
?>
|
468 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
469 |
+
<?php
|
470 |
+
}
|
471 |
+
}?>
|
472 |
+
</select>
|
473 |
|
474 |
+
<span class="tvc-css-selector-sec default-selector-sec <?php echo ($tvc_product_detail_addtocart_selector != "default")?"tvc-hide":""; ?>">
|
475 |
+
<input type="text" class="select-sm" value="class" disabled>
|
476 |
+
|
477 |
+
<input type="text" class="fromfiled default_selector_val" value="single_add_to_cart_button" disabled>
|
478 |
+
</span>
|
479 |
|
480 |
+
<span class="tvc-css-selector-sec <?php echo ($tvc_product_detail_addtocart_selector == "default")?"tvc-hide":""; ?>">
|
481 |
+
<?php $tvc_product_detail_addtocart_selector_type = isset($data['tvc_product_detail_addtocart_selector_type'])?$data['tvc_product_detail_addtocart_selector_type']:"class";
|
482 |
+
$list = array(
|
483 |
+
"id" => "id",
|
484 |
+
"class" => "class"
|
485 |
+
); ?>
|
486 |
+
<select name="tvc_product_detail_addtocart_selector_type" class="select-sm">
|
487 |
+
<?php if(!empty($list)){
|
488 |
+
foreach($list as $key => $val){
|
489 |
+
$selected = ($tvc_product_detail_addtocart_selector_type == $key)?"selected":"";
|
490 |
+
?>
|
491 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
492 |
+
<?php
|
493 |
+
}
|
494 |
+
}?>
|
495 |
+
</select>
|
496 |
+
<?php $tvc_product_detail_addtocart_selector_val = isset($data['tvc_product_detail_addtocart_selector_val'])?$data['tvc_product_detail_addtocart_selector_val']:""; ?>
|
497 |
+
<input type="text" class="fromfiled" name="tvc_product_detail_addtocart_selector_val" id="tvc_product_detail_addtocart_selector_val" value="<?php echo esc_attr($tvc_product_detail_addtocart_selector_val); ?>">
|
498 |
+
<div class="tvc-tooltip">
|
499 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter your button selector (id or calss) value. You can add multiple classes using comma separated string.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
500 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
501 |
+
</div>
|
502 |
+
</span>
|
503 |
+
|
504 |
+
</td>
|
505 |
+
</tr>
|
506 |
+
<tr>
|
507 |
+
<th style="padding: 0 1rem;">
|
508 |
+
<label class="ga-title align-middle"><?php esc_html_e("Checkout Step 2","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
509 |
+
</th>
|
510 |
+
<td>
|
511 |
+
<?php $tvc_checkout_step_2_selector = isset($data['tvc_checkout_step_2_selector'])?$data['tvc_checkout_step_2_selector']:"default";
|
512 |
+
$list = array(
|
513 |
+
"default" => "default",
|
514 |
+
"custom" => "custom"
|
515 |
+
); ?>
|
516 |
+
<select name="tvc_checkout_step_2_selector" class="select-sm css-selector">
|
517 |
+
<?php if(!empty($list)){
|
518 |
+
foreach($list as $key => $val){
|
519 |
+
$selected = ($tvc_checkout_step_2_selector == $key)?"selected":"";
|
520 |
+
?>
|
521 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
522 |
+
<?php
|
523 |
+
}
|
524 |
+
}?>
|
525 |
+
</select>
|
526 |
+
<span class="tvc-css-selector-sec default-selector-sec <?php echo ($tvc_checkout_step_2_selector != "default")?"tvc-hide":""; ?>">
|
527 |
+
<input type="text" class="select-sm" value="name" disabled>
|
528 |
+
|
529 |
+
<input type="text" class="fromfiled default_selector_val" value="input[name=billing_first_name]" disabled>
|
530 |
+
</span>
|
531 |
+
<span class="tvc-css-selector-sec <?php echo ($tvc_checkout_step_2_selector == "default")?"tvc-hide":""; ?>">
|
532 |
+
<?php $tvc_checkout_step_2_selector_type = isset($data['tvc_checkout_step_2_selector_type'])?$data['tvc_checkout_step_2_selector_type']:"";
|
533 |
+
$list = array(
|
534 |
+
"id" => "id",
|
535 |
+
"class" => "class"
|
536 |
+
); ?>
|
537 |
+
<select name="tvc_checkout_step_2_selector_type" class="select-sm">
|
538 |
+
<?php if(!empty($list)){
|
539 |
+
foreach($list as $key => $val){
|
540 |
+
$selected = ($tvc_checkout_step_2_selector_type == $key)?"selected":"";
|
541 |
+
?>
|
542 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
543 |
+
<?php
|
544 |
+
}
|
545 |
+
}?>
|
546 |
+
</select>
|
547 |
+
<?php $tvc_checkout_step_2_selector_val = isset($data['tvc_checkout_step_2_selector_val'])?$data['tvc_checkout_step_2_selector_val']:""; ?>
|
548 |
+
<input type="text" class="fromfiled" name="tvc_checkout_step_2_selector_val" id="tvc_checkout_step_2_selector_val" value="<?php echo esc_attr($tvc_checkout_step_2_selector_val); ?>">
|
549 |
+
<div class="tvc-tooltip">
|
550 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter your selector (id or calss) value. You can add multiple classes using comma separated string.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
551 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
552 |
+
</div>
|
553 |
+
</span>
|
554 |
+
</td>
|
555 |
+
</tr>
|
556 |
+
<tr>
|
557 |
+
<th style="padding: 0 1rem;">
|
558 |
+
<label class="ga-title align-middle"><?php esc_html_e("Checkout Step 3","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
559 |
+
</th>
|
560 |
+
<td>
|
561 |
+
<?php $tvc_checkout_step_3_selector = isset($data['tvc_checkout_step_3_selector'])?$data['tvc_checkout_step_3_selector']:"default";
|
562 |
+
$list = array(
|
563 |
+
"default" => "default",
|
564 |
+
"custom" => "custom"
|
565 |
+
); ?>
|
566 |
+
<select name="tvc_checkout_step_3_selector" class="select-sm css-selector">
|
567 |
+
<?php if(!empty($list)){
|
568 |
+
foreach($list as $key => $val){
|
569 |
+
$selected = ($tvc_checkout_step_3_selector == $key)?"selected":"";
|
570 |
+
?>
|
571 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
572 |
+
<?php
|
573 |
+
}
|
574 |
+
}?>
|
575 |
+
</select>
|
576 |
+
<span class="tvc-css-selector-sec default-selector-sec <?php echo ($tvc_checkout_step_3_selector != "default")?"tvc-hide":""; ?>">
|
577 |
+
<input type="text" class="select-sm" value="id" disabled>
|
578 |
+
|
579 |
+
<input type="text" class="fromfiled default_selector_val" value="place_order" disabled>
|
580 |
+
</span>
|
581 |
+
<span class="tvc-css-selector-sec <?php echo ($tvc_checkout_step_3_selector == "default")?"tvc-hide":""; ?>">
|
582 |
+
<?php $tvc_checkout_step_3_selector_type = isset($data['tvc_checkout_step_3_selector_type'])?$data['tvc_checkout_step_3_selector_type']:"";
|
583 |
+
$list = array(
|
584 |
+
"id" => "id",
|
585 |
+
"class" => "class"
|
586 |
+
); ?>
|
587 |
+
<select name="tvc_checkout_step_3_selector_type" class="select-sm">
|
588 |
+
<?php if(!empty($list)){
|
589 |
+
foreach($list as $key => $val){
|
590 |
+
$selected = ($tvc_checkout_step_3_selector_type == $key)?"selected":"";
|
591 |
+
?>
|
592 |
+
<option value="<?php echo esc_attr($key);?>" <?php echo $selected; ?>><?php echo esc_attr($val);?></option>
|
593 |
+
<?php
|
594 |
+
}
|
595 |
+
}?>
|
596 |
+
</select>
|
597 |
+
<?php $tvc_checkout_step_3_selector_val = isset($data['tvc_checkout_step_3_selector_val'])?$data['tvc_checkout_step_3_selector_val']:""; ?>
|
598 |
+
<input type="text" class="fromfiled" name="tvc_checkout_step_3_selector_val" id="tvc_checkout_step_3_selector_val" value="<?php echo esc_attr($tvc_checkout_step_3_selector_val); ?>">
|
599 |
+
<div class="tvc-tooltip">
|
600 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("Enter your button selector (id or calss) value. You can add multiple classes using comma separated string.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
601 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
602 |
+
</div>
|
603 |
+
</span>
|
|
|
|
|
|
|
|
|
604 |
</td>
|
605 |
</tr>
|
606 |
+
</table>
|
607 |
+
</div>
|
608 |
+
<br />
|
609 |
+
<hr>
|
610 |
+
|
611 |
+
<div class="row mb-3">
|
612 |
+
<div class="col-6 col-md-6 col-lg-6">
|
613 |
+
<h2 class="ga-title"><?php esc_html_e("Linked Google Ads Account:","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
|
614 |
+
</div>
|
615 |
+
<div class="col-6 col-md-6 col-lg-6 text-right">
|
616 |
+
<div class="acc-num">
|
617 |
+
<p class="ga-text">
|
618 |
+
<?php echo (isset($data['google_ads_id']) && $data['google_ads_id'] != '') ? esc_attr($data['google_ads_id']) : '<span>'.esc_html__("Get started","enhanced-e-commerce-for-woocommerce-store").'</span>'; ?>
|
619 |
+
</p>
|
620 |
+
<?php
|
621 |
+
if (isset($data['google_ads_id']) && esc_attr($data['google_ads_id']) != '') {
|
622 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg').'" alt="refresh"/></a></p>';
|
623 |
+
} else {
|
624 |
+
echo '<p class="ga-text text-right"><a href="' . esc_url_raw($this->url) . '" class="text-underline"><img src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg').'" alt="connect account"/></a></p>';
|
625 |
+
}?>
|
626 |
+
</div>
|
627 |
+
</div>
|
628 |
+
</div>
|
629 |
+
|
630 |
+
<div class="ga-title con_tracking_integration con_faq_title" data-id="sec_con_integration_GAds">
|
631 |
+
<?php esc_html_e("Google Ads Setting","enhanced-e-commerce-for-woocommerce-store"); ?>
|
632 |
+
<div class="tvc-tooltip">
|
633 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e(" Advance Setting.","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
634 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
635 |
+
</div>
|
636 |
+
<img class="faq_icon" style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/arrow-down-sign.png"); ?>" >
|
637 |
+
</div>
|
638 |
+
<div class="sec_con_integration" id="sec_con_integration_GAds">
|
639 |
+
<?php //google ads code start
|
640 |
+
|
641 |
+
if (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != '') { ?>
|
642 |
+
<label class="align-middle">
|
643 |
+
<div class="tvc-custom-control tvc-custom-checkbox">
|
644 |
+
<input type="checkbox" class="tvc-custom-control-input" id="customCheck1" name="remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->remarketing_tags) == 1) ? 'checked="checked"' : ''; ?> >
|
645 |
+
<label class="custom-control-label" for="customCheck1"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
646 |
+
</div>
|
647 |
+
</label>
|
648 |
+
<br />
|
649 |
+
<label class="align-middle">
|
650 |
+
<div class="tvc-custom-control tvc-custom-checkbox">
|
651 |
+
<input type="checkbox" class="tvc-custom-control-input" id="customCheck2" name="dynamic_remarketing_tags" value="1" <?php echo (esc_attr($googleDetail->dynamic_remarketing_tags) == 1) ? 'checked="checked"' : ''; ?>>
|
652 |
+
<label class="custom-control-label" for="customCheck2"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
653 |
+
</div>
|
654 |
+
</label>
|
655 |
+
<br />
|
656 |
+
<label class="align-middle">
|
657 |
+
<div class="tvc-custom-control tvc-custom-checkbox">
|
658 |
+
<input type="checkbox" class="tvc-custom-control-input" id="customCheck3" name="link_google_analytics_with_google_ads" value="1" <?php echo (esc_attr($googleDetail->link_google_analytics_with_google_ads) == 1) ? 'checked="checked"' : ''; ?> >
|
659 |
+
<label class="custom-control-label" for="customCheck3"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
660 |
+
</div>
|
661 |
+
</label>
|
662 |
+
<?php }else{ ?>
|
663 |
+
<h2 class="ga-title"><?php esc_html_e("Connect Google Ads account to enable below features.","enhanced-e-commerce-for-woocommerce-store"); ?></h2>
|
664 |
+
<br>
|
665 |
+
<ul>
|
666 |
+
<li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
|
667 |
+
<li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable dynamic remarketing tags","enhanced-e-commerce-for-woocommerce-store"); ?></li>
|
668 |
+
<li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span></li>
|
669 |
+
<li><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg'); ?>" alt="configuration success" class="config-success"><?php esc_html_e("Link Google analytics with google ads","enhanced-e-commerce-for-woocommerce-store"); ?></li>
|
670 |
+
</ul>
|
671 |
+
<?php
|
672 |
+
} ?>
|
673 |
+
<?php if($this->plan_id != 1 && isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ''){ ?>
|
674 |
+
<br/>
|
675 |
+
|
676 |
+
<label class="align-middle">
|
677 |
+
<div class="tvc-custom-control tvc-custom-checkbox">
|
678 |
+
<input type="checkbox" class="tvc-custom-control-input" id="google_ads_conversion_tracking" class="google_ads_conversion_tracking" name="google_ads_conversion_tracking" value="1" <?php echo (esc_attr($googleDetail->google_ads_conversion_tracking) == 1) ? 'checked="checked"' : ''; ?>>
|
679 |
+
<label for="google_ads_conversion_tracking"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
680 |
+
</div>
|
681 |
+
</label>
|
682 |
+
<br />
|
683 |
+
<div class="form-group google_ads_conversion_sec" id="google_ads_conversion_sec">
|
684 |
+
<?php $ga_EC = get_option("ga_EC"); ?>
|
685 |
+
<label class="align-middle">
|
686 |
+
<div class="tvc-custom-control tvc-custom-checkbox">
|
687 |
+
<input type="checkbox" class="tvc-custom-control-input" id="ga_EC" name="ga_EC" value="1"<?php if(!empty($ga_EC)){ echo (esc_attr($ga_EC) == 1) ? 'checked="checked"' : '';}?> <?php if($googleDetail->google_ads_conversion_tracking!=1){ echo 'disabled'; } ?>>
|
688 |
+
<label for="ga_EC"><?php esc_html_e("Enable Google Ads Enhanced Conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?>
|
689 |
+
</label>
|
690 |
+
</div>
|
691 |
+
</label>
|
692 |
+
<br>
|
693 |
+
<label class="align-middle">
|
694 |
+
<?php
|
695 |
+
if($this->current_customer_id != ""){
|
696 |
+
$response = $this->customApiObj->get_conversion_list($this->current_customer_id);
|
697 |
+
if(property_exists($response,"error") && $response->error == true){
|
698 |
+
echo "<div class='google_conversion_label_message alert alert-danger google_ads_conversion_label_message' role='alert'>No conversion labels are retrived, kindly refersh once else check if conversion label is available in your google ads account.</div>";
|
699 |
+
}
|
700 |
+
if(property_exists($response,"error") && $response->error == false){
|
701 |
+
if(property_exists($response,"data") && $response->data != "" && !empty($response->data)){
|
702 |
+
$selected_conversio_send_to = get_option('ee_conversio_send_to');?>
|
703 |
+
<select name='ee_conversio_send_to' id='google_ads_conversion_label' <?php if($googleDetail->google_ads_conversion_tracking!=1){ echo 'disabled'; } ?>>
|
704 |
+
<?php $selected = "";
|
705 |
+
foreach ($response->data as $key => $value) {
|
706 |
+
$con_string=strip_tags($value->tagSnippets);
|
707 |
+
$conversion_label = $TVC_Admin_Helper->get_conversion_label($con_string);
|
708 |
+
if($selected_conversio_send_to==$conversion_label){
|
709 |
+
$selected = "selected";
|
710 |
+
}else{
|
711 |
+
$selected = "";
|
712 |
+
}
|
713 |
+
?>
|
714 |
+
<option <?php echo $selected; ?> value="<?php echo esc_attr($conversion_label); ?>"><?php echo esc_attr($conversion_label); ?>
|
715 |
+
</option>
|
716 |
+
<?php }
|
717 |
+
echo "</select>";
|
718 |
+
}
|
719 |
+
}
|
720 |
+
}
|
721 |
+
?>
|
722 |
+
</label>
|
723 |
+
</div>
|
724 |
+
<?php }else{?>
|
725 |
+
|
726 |
+
<ul>
|
727 |
+
<li>
|
728 |
+
<label class="align-middle">
|
729 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
|
730 |
+
</label>
|
731 |
+
</li>
|
732 |
+
<li>
|
733 |
+
|
734 |
+
<label class="align-middle">
|
735 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/lock-orange.png'); ?>" class="config-success"><?php esc_html_e("Enable Google Ads Enhanced conversion tracking","enhanced-e-commerce-for-woocommerce-store"); ?><span class="tvc-pro"> (PRO)</span>
|
736 |
+
</label>
|
737 |
+
</li>
|
738 |
+
</ul>
|
739 |
+
<?php } ?>
|
740 |
+
</div>
|
741 |
+
<hr>
|
742 |
+
<table class="table">
|
743 |
+
<tbody>
|
744 |
+
<tr>
|
745 |
+
<th>
|
746 |
+
<label class="ga-title align-middle"><img style="height: 20px;" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL . "/admin/images/fb-icon.png"); ?>" > <?php esc_html_e("Facebook pixel ID","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
747 |
+
</th>
|
748 |
+
<td>
|
749 |
+
<?php $fb_pixel_id = isset($data['fb_pixel_id'])?$data['fb_pixel_id']:""; ?>
|
750 |
+
<input type="text" class="fromfiled" name="fb_pixel_id" id="fb_pixel_id" value="<?php echo esc_attr($fb_pixel_id); ?>">
|
751 |
+
<div class="tvc-tooltip">
|
752 |
+
<span class="tvc-tooltiptext tvc-tooltip-right"><?php esc_html_e("The Facebook pixel ID looks like. 518896233175751","enhanced-e-commerce-for-woocommerce-store"); ?></span>
|
753 |
+
<img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL."/admin/images/icon/informationI.svg"); ?>" alt=""/>
|
754 |
+
</div>
|
755 |
+
</td>
|
756 |
+
</tr>
|
757 |
<tr>
|
758 |
<th>
|
759 |
<label class="ga-title align-middle" for="ga_PrivacyPolicy"><?php esc_html_e("Privacy Policy","enhanced-e-commerce-for-woocommerce-store"); ?></label>
|
803 |
jQuery(this).toggleClass('active');
|
804 |
jQuery('#'+faq_id).toggleClass('active');
|
805 |
});
|
806 |
+
|
807 |
jQuery(document).on('change','.css-selector',function(event){
|
808 |
//console.log(jQuery(this).val());
|
809 |
if(jQuery(this).val() == "custom"){
|
900 |
}
|
901 |
});
|
902 |
});
|
903 |
+
|
904 |
+
jQuery(function () {
|
905 |
+
jQuery("#google_ads_conversion_tracking").click(function () {
|
906 |
+
if (jQuery("#google_ads_conversion_tracking").is(":checked")) {
|
907 |
+
jQuery('#google_ads_conversion_sec :input').removeAttr('disabled');
|
908 |
+
jQuery('#google_ads_conversion_sec :select').removeAttr('disabled');
|
909 |
+
} else {
|
910 |
+
//To disable all input elements within div use the following code:
|
911 |
+
jQuery('#google_ads_conversion_sec :input').attr('disabled', 'disabled');
|
912 |
+
|
913 |
+
//To disable all select elements within div use the following code:
|
914 |
+
jQuery('#google_ads_conversion_sec :select').attr('disabled', 'disabled');
|
915 |
+
}
|
916 |
+
});
|
917 |
+
});
|
918 |
+
|
919 |
+
jQuery('#google_ads_conversion_tracking').click(function(){
|
920 |
+
if(!this.checked){
|
921 |
+
jQuery("#ga_EC").prop("checked", false);
|
922 |
+
}else{
|
923 |
+
jQuery("#ga_EC").prop("checked", true);
|
924 |
+
}
|
925 |
+
});
|
926 |
+
</script>
|
enhanced-ecommerce-google-analytics.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Conversios.io - Google Analytics and Google Shopping plugin for WooCommerce
|
16 |
* Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
|
17 |
* Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
|
18 |
-
* Version: 4.9.
|
19 |
* Author: Conversios
|
20 |
* Author URI: conversios.io
|
21 |
* License: GPL-2.0+
|
@@ -37,7 +37,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
37 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
38 |
* Rename this for your plugin and update it as you release new versions.
|
39 |
*/
|
40 |
-
define( 'PLUGIN_TVC_VERSION', '4.9.
|
41 |
$fullName = plugin_basename( __FILE__ );
|
42 |
$dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
|
43 |
if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
|
15 |
* Plugin Name: Conversios.io - Google Analytics and Google Shopping plugin for WooCommerce
|
16 |
* Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
|
17 |
* Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
|
18 |
+
* Version: 4.9.4
|
19 |
* Author: Conversios
|
20 |
* Author URI: conversios.io
|
21 |
* License: GPL-2.0+
|
37 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
38 |
* Rename this for your plugin and update it as you release new versions.
|
39 |
*/
|
40 |
+
define( 'PLUGIN_TVC_VERSION', '4.9.4' );
|
41 |
$fullName = plugin_basename( __FILE__ );
|
42 |
$dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
|
43 |
if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
|
includes/setup/google-shopping-feed-gaa-config.php
CHANGED
@@ -25,6 +25,46 @@ class GAAConfiguration {
|
|
25 |
$this->create_form();
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
public function create_form() {
|
29 |
if(isset($_GET['welcome_msg']) && sanitize_textarea_field($_GET['welcome_msg']) == true){
|
30 |
$class = 'notice notice-success';
|
@@ -51,12 +91,36 @@ class GAAConfiguration {
|
|
51 |
if ($google_detail['setting']) {
|
52 |
$googleDetail = $google_detail['setting'];
|
53 |
}
|
54 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
<div class="tab-content">
|
56 |
<div class="tab-pane show active" id="googleShoppingFeed">
|
57 |
<div class="tab-card">
|
58 |
<div class="row">
|
59 |
<div class="col-md-6 col-lg-8 edit-section">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
<div class="configuration-section" id="config-pt1">
|
61 |
<?php echo get_google_shopping_tabs_html($this->site_url,(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:""); ?>
|
62 |
</div>
|
@@ -169,6 +233,23 @@ class GAAConfiguration {
|
|
169 |
</select>
|
170 |
</div>
|
171 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
<div class="auto_product_sync_save_button mb-3">
|
173 |
<div class="col-12 col-md-12 col-lg-12">
|
174 |
<button type="submit" id="auto_product_sync_save" class="auto_product_sync_save btn btn-primary btn-success" name="auto_product_sync_setting_save"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
|
@@ -328,6 +409,71 @@ if(isset($googleDetail->google_merchant_center_id) && esc_attr($googleDetail->go
|
|
328 |
}
|
329 |
}
|
330 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
</script>
|
332 |
<?php
|
333 |
} //create_form
|
25 |
$this->create_form();
|
26 |
}
|
27 |
|
28 |
+
public function configuration_list_html($title, $val){
|
29 |
+
$imge = (isset($val) && $val != "" && $val != 0) ? esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/config-success.svg') : esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png');
|
30 |
+
return '<li>
|
31 |
+
<div class="row">
|
32 |
+
<div class="col-7 col-md-7 col-lg-9 align-self-center pr-0">
|
33 |
+
<span class="text">'.esc_attr($title).'</span>
|
34 |
+
</div>
|
35 |
+
<div class="col-5 col-md-5 col-lg-3 text-end">
|
36 |
+
<div class="list-image"><img src="'.esc_url_raw($imge).'"></div>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</li>';
|
40 |
+
}
|
41 |
+
|
42 |
+
public function configuration_error_list_html($title, $val, $call_domain_claim, $googleDetail){
|
43 |
+
if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" ){
|
44 |
+
return '<li>
|
45 |
+
<div class="row">
|
46 |
+
<div class="col-6 col-md-6 col-lg-6">
|
47 |
+
<span class="text"><b>'.esc_attr($title).'</b></span>
|
48 |
+
</div>
|
49 |
+
<div class="col-4 col-md-4 col-lg-4 text-right">
|
50 |
+
<div class="list-image"><img id="refresh_'.esc_attr($call_domain_claim).'" onclick="'.esc_attr($call_domain_claim).'();" src="'. esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png').'"><img src="' .esc_url_raw( ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
</li>';
|
54 |
+
}else{
|
55 |
+
return '<li>
|
56 |
+
<div class="row">
|
57 |
+
<div class="col-7 col-md-7 col-lg-7 align-self-center pr-0">
|
58 |
+
<span class="text">'.esc_attr($title).'</span>
|
59 |
+
</div>
|
60 |
+
<div class="col-5 col-md-5 col-lg-5 align-self-center text-left">
|
61 |
+
<div class="list-image"><img src="' . esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png').'" alt="no-config-success"/></div>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</li>';
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
public function create_form() {
|
69 |
if(isset($_GET['welcome_msg']) && sanitize_textarea_field($_GET['welcome_msg']) == true){
|
70 |
$class = 'notice notice-success';
|
91 |
if ($google_detail['setting']) {
|
92 |
$googleDetail = $google_detail['setting'];
|
93 |
}
|
94 |
+
}
|
95 |
+
|
96 |
+
$last_api_sync_up = "";
|
97 |
+
if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
|
98 |
+
$date_formate=get_option('date_format')." ".get_option('time_format');
|
99 |
+
if($date_formate ==""){
|
100 |
+
$date_formate = 'M-d-Y H:i';
|
101 |
+
}
|
102 |
+
$last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
|
103 |
+
}
|
104 |
+
$is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
|
105 |
+
$args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
|
106 |
+
$products = new WP_Query($args);
|
107 |
+
$woo_product = $products->found_posts;
|
108 |
+
?>
|
109 |
<div class="tab-content">
|
110 |
<div class="tab-pane show active" id="googleShoppingFeed">
|
111 |
<div class="tab-card">
|
112 |
<div class="row">
|
113 |
<div class="col-md-6 col-lg-8 edit-section">
|
114 |
+
<?php if($this->subscriptionId != ""){?>
|
115 |
+
<div class="tvc-api-sunc">
|
116 |
+
<span>
|
117 |
+
<?php if($last_api_sync_up){
|
118 |
+
echo esc_html__("Merchant center products details last synced at ","enhanced-e-commerce-for-woocommerce-store").esc_attr($last_api_sync_up);
|
119 |
+
}else{
|
120 |
+
echo esc_html__("Refresh sync up","enhanced-e-commerce-for-woocommerce-store");
|
121 |
+
}?>.</span><span id="products_count"></span><img id="refresh_api" onclick="call_tvc_api_sync_up();" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png'); ?>">
|
122 |
+
</div>
|
123 |
+
<?php } ?>
|
124 |
<div class="configuration-section" id="config-pt1">
|
125 |
<?php echo get_google_shopping_tabs_html($this->site_url,(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:""); ?>
|
126 |
</div>
|
233 |
</select>
|
234 |
</div>
|
235 |
</div>
|
236 |
+
<div class="card-body">
|
237 |
+
<ul class="list-unstyled"><?php
|
238 |
+
$is_domain_claim = (isset($googleDetail->is_domain_claim))?esc_attr($googleDetail->is_domain_claim):"";
|
239 |
+
$is_site_verified = (isset($googleDetail->is_site_verified))?esc_attr($googleDetail->is_site_verified):"";
|
240 |
+
if($is_site_verified ==1){
|
241 |
+
echo $this->configuration_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"), esc_attr($is_site_verified));
|
242 |
+
}else{
|
243 |
+
echo $this->configuration_error_list_html(esc_html__("Site Verified","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_site_verified),"call_site_verified", $googleDetail);
|
244 |
+
}
|
245 |
+
if($is_domain_claim ==1){
|
246 |
+
echo $this->configuration_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim));
|
247 |
+
}else{
|
248 |
+
echo $this->configuration_error_list_html(esc_html__("Domain claim","enhanced-e-commerce-for-woocommerce-store"),esc_attr($is_domain_claim), 'call_domain_claim', $googleDetail);
|
249 |
+
}
|
250 |
+
?>
|
251 |
+
</ul>
|
252 |
+
</div>
|
253 |
<div class="auto_product_sync_save_button mb-3">
|
254 |
<div class="col-12 col-md-12 col-lg-12">
|
255 |
<button type="submit" id="auto_product_sync_save" class="auto_product_sync_save btn btn-primary btn-success" name="auto_product_sync_setting_save"><?php esc_html_e("Save","enhanced-e-commerce-for-woocommerce-store"); ?></button>
|
409 |
}
|
410 |
}
|
411 |
});
|
412 |
+
|
413 |
+
function call_site_verified(){
|
414 |
+
var tvs_this = event.target;
|
415 |
+
jQuery("#refresh_call_site_verified").css("visibility","hidden");
|
416 |
+
jQuery(tvs_this).after('<div class="domain-claim-spinner tvc-nb-spinner" id="site-verified-spinner"></div>');
|
417 |
+
jQuery.post(tvc_ajax_url,{
|
418 |
+
action: "tvc_call_site_verified"
|
419 |
+
},function( response ){
|
420 |
+
var rsp = JSON.parse(response);
|
421 |
+
if(rsp.status == "success"){
|
422 |
+
tvc_helper.tvc_alert("success","",rsp.message,true);
|
423 |
+
location.reload();
|
424 |
+
}else{
|
425 |
+
tvc_helper.tvc_alert("error","",rsp.message,true);
|
426 |
+
}
|
427 |
+
user_tracking_data('refresh_call', 'null','conversios-google-shopping-feed','call_site_verified');
|
428 |
+
jQuery("#site-verified-spinner").remove();
|
429 |
+
});
|
430 |
+
}
|
431 |
+
function call_domain_claim(){
|
432 |
+
var tvs_this = event.target;
|
433 |
+
jQuery("#refresh_call_domain_claim").css("visibility","hidden");
|
434 |
+
jQuery(tvs_this).after('<div class="domain-claim-spinner tvc-nb-spinner" id="domain-claim-spinner"></div>');
|
435 |
+
jQuery.post(tvc_ajax_url,{
|
436 |
+
action: "tvc_call_domain_claim"
|
437 |
+
},function( response ){
|
438 |
+
var rsp = JSON.parse(response);
|
439 |
+
if(rsp.status == "success"){
|
440 |
+
tvc_helper.tvc_alert("success","",rsp.message,true);
|
441 |
+
//alert(rsp.message);
|
442 |
+
location.reload();
|
443 |
+
}else{
|
444 |
+
tvc_helper.tvc_alert("error","",rsp.message,true)
|
445 |
+
}
|
446 |
+
user_tracking_data('refresh_call', 'null','conversios-google-shopping-feed','call_domain_claim');
|
447 |
+
jQuery("#domain-claim-spinner").remove();
|
448 |
+
});
|
449 |
+
}
|
450 |
+
jQuery(document).ready(function() {
|
451 |
+
var is_need_to_update = "<?php echo esc_attr($is_need_to_update); ?>";
|
452 |
+
if(is_need_to_update == 1 || is_need_to_update == true){
|
453 |
+
call_tvc_api_sync_up();
|
454 |
+
}
|
455 |
+
});
|
456 |
+
function call_tvc_api_sync_up(){
|
457 |
+
var tvs_this = jQuery("#refresh_api");
|
458 |
+
jQuery("#tvc_msg").remove();
|
459 |
+
jQuery("#refresh_api").css("visibility","hidden");
|
460 |
+
jQuery(tvs_this).after('<div class="tvc-nb-spinner" id="tvc-nb-spinner"></div>');
|
461 |
+
tvc_helper.tvc_alert("error","<?php esc_html_e("Attention !","enhanced-e-commerce-for-woocommerce-store"); ?>","<?php esc_html_e("Sync up is in the process do not refresh the page. it may take few minutes.","enhanced-e-commerce-for-woocommerce-store"); ?>");
|
462 |
+
jQuery.post(tvc_ajax_url,{
|
463 |
+
action: "tvc_call_api_sync"
|
464 |
+
},function( response ){
|
465 |
+
var rsp = JSON.parse(response);
|
466 |
+
if(rsp.error == false){
|
467 |
+
jQuery("#tvc-nb-spinner").remove();
|
468 |
+
tvc_helper.tvc_alert("success","",rsp.message,true,2000);
|
469 |
+
}else{
|
470 |
+
tvc_helper.tvc_alert("error","",rsp.message,true,2000);
|
471 |
+
}
|
472 |
+
user_tracking_data('refresh_api', 'null','conversios-google-shopping-feed','details_last_synced');
|
473 |
+
setTimeout(function(){ location.reload();}, 2000);
|
474 |
+
});
|
475 |
+
}
|
476 |
+
|
477 |
</script>
|
478 |
<?php
|
479 |
} //create_form
|
includes/setup/google-shopping-feed.php
CHANGED
@@ -173,7 +173,7 @@ class GoogleShoppingFeed {
|
|
173 |
<h4 class="confg-title"><?php esc_html_e("Configuration","enhanced-e-commerce-for-woocommerce-store"); ?></h4>
|
174 |
</div>
|
175 |
<div class="card-body">
|
176 |
-
<ul class="list-unstyled"><?php
|
177 |
$is_domain_claim = (isset($googleDetail->is_domain_claim))?esc_attr($googleDetail->is_domain_claim):"";
|
178 |
$is_site_verified = (isset($googleDetail->is_site_verified))?esc_attr($googleDetail->is_site_verified):"";
|
179 |
echo $this->configuration_list_html("Google merchant center",(isset($googleDetail->google_merchant_center_id))?esc_attr($googleDetail->google_merchant_center_id):"");
|
173 |
<h4 class="confg-title"><?php esc_html_e("Configuration","enhanced-e-commerce-for-woocommerce-store"); ?></h4>
|
174 |
</div>
|
175 |
<div class="card-body">
|
176 |
+
<ul class="list-unstyled"><?php
|
177 |
$is_domain_claim = (isset($googleDetail->is_domain_claim))?esc_attr($googleDetail->is_domain_claim):"";
|
178 |
$is_site_verified = (isset($googleDetail->is_site_verified))?esc_attr($googleDetail->is_site_verified):"";
|
179 |
echo $this->configuration_list_html("Google merchant center",(isset($googleDetail->google_merchant_center_id))?esc_attr($googleDetail->google_merchant_center_id):"");
|
readme.txt
CHANGED
@@ -8,8 +8,8 @@ Author: Tatvic
|
|
8 |
Requires at least: 4.6
|
9 |
Tested up to: 6.0.2
|
10 |
Requires PHP: 5.6 or Higher
|
11 |
-
Stable tag: 4.9.
|
12 |
-
Version: 4.9.
|
13 |
License: GPLv3
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
|
@@ -416,8 +416,12 @@ In GA3 (Universal Analytics) usually, it takes 0 to 45 mins and in GA4 it can ta
|
|
416 |
|
417 |
|
418 |
== Changelog ==
|
|
|
|
|
|
|
|
|
419 |
= 4.9.3 - 27/09/2022 =
|
420 |
-
* Changed the text domain for internationalization and making it compatible with other locales
|
421 |
|
422 |
= 4.9.2 - 16/09/2022 =
|
423 |
* In our latest release we have fixed the issues of product attribute mapping with SKU, GTIN and MPIN for variable products.
|
8 |
Requires at least: 4.6
|
9 |
Tested up to: 6.0.2
|
10 |
Requires PHP: 5.6 or Higher
|
11 |
+
Stable tag: 4.9.4
|
12 |
+
Version: 4.9.4
|
13 |
License: GPLv3
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
|
416 |
|
417 |
|
418 |
== Changelog ==
|
419 |
+
= 4.9.4 - 06/10/2022 =
|
420 |
+
* Enhancement: Latest optimization will create smooth on-boarding for new and returning users, decreasing the page load time for configuration of Google analytics, Google ads and GMC accounts.
|
421 |
+
* We also changed our Conversios GA and Google shopping Plugin Menu structure for better flow and easy naming convention.
|
422 |
+
|
423 |
= 4.9.3 - 27/09/2022 =
|
424 |
+
* Changed the text domain for internationalization and making it compatible with other locales.
|
425 |
|
426 |
= 4.9.2 - 16/09/2022 =
|
427 |
* In our latest release we have fixed the issues of product attribute mapping with SKU, GTIN and MPIN for variable products.
|