Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more - Version 1.14.2

Version Description

17.02.2022

  • Tweak: Added items to Microsoft Ads purchase event
  • Tweak: Added 'wpm-js' to optimization exclusion list
  • Fix: Added a safeguard when checking for order purchase redirects in the UX
  • Fix: Fixed a double json encoded string for the GA4 browser purchase event
Download this release

Release Info

Developer alekv
Plugin Icon 128x128 Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more
Version 1.14.2
Comparing to
See all releases

Code changes from version 1.16.6 to 1.14.2

Files changed (121) hide show
  1. classes/admin/class-admin.php +270 -100
  2. classes/admin/class-ask-for-rating.php +2 -2
  3. classes/admin/class-debug-info.php +17 -19
  4. classes/admin/class-documentation.php +38 -38
  5. classes/admin/class-environment-check.php +135 -233
  6. classes/admin/class-notifications.php +2 -2
  7. classes/class-default-options.php +14 -50
  8. classes/pixels/class-cookie-consent-management.php +2 -2
  9. classes/pixels/class-pixel-manager.php +282 -264
  10. classes/pixels/class-pixel.php +55 -2
  11. classes/pixels/class-script-manager.php +0 -284
  12. classes/pixels/class-shortcodes.php +45 -104
  13. classes/pixels/facebook/class-facebook-pixel-manager-microdata.php +2 -2
  14. classes/pixels/facebook/class-facebook-pixel-manager.php +76 -2
  15. classes/pixels/google/class-google-ads.php +47 -41
  16. classes/pixels/google/class-google-analytics-refund.php +2 -37
  17. classes/pixels/google/class-google-analytics.php +48 -0
  18. classes/pixels/google/class-google-pixel-manager.php +145 -19
  19. classes/pixels/google/class-google.php +520 -284
  20. classes/pixels/google/trait-google.php +168 -377
  21. classes/pixels/trait-product.php +63 -80
  22. classes/pixels/trait-shop.php +231 -282
  23. css/admin.css +2 -2
  24. js/admin/ask-for-rating.js +0 -37
  25. js/admin/environment-check.js +0 -84
  26. js/admin/freemius-keep-deactivate-button-enabled.js +0 -22
  27. js/admin/helpers.js +0 -12
  28. js/admin/main-freemius.js +0 -1
  29. js/admin/main.js +0 -8
  30. js/admin/script-blocker-warning.js +0 -13
  31. js/admin/tabs.js +0 -172
  32. js/admin/wpm-admin-freemius.p1.min.js +1 -1
  33. js/admin/wpm-admin-freemius.p1.min.js.map +1 -1
  34. js/admin/wpm-admin.p1.min.js +1 -1
  35. js/admin/wpm-admin.p1.min.js.map +1 -1
  36. js/public/wpm-public.p1.min.js +1 -1
  37. js/public/wpm-public.p1.min.js.map +1 -1
  38. languages/woocommerce-google-adwords-conversion-tracking-tag.pot +228 -191
  39. readme.txt +34 -136
  40. vendor/composer/autoload_psr4.php +0 -1
  41. vendor/composer/autoload_static.php +0 -5
  42. vendor/composer/installed.json +6 -38
  43. vendor/composer/installed.php +5 -14
  44. vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png +0 -0
  45. vendor/freemius/wordpress-sdk/assets/img/theme-icon.png +0 -0
  46. vendor/freemius/wordpress-sdk/assets/img/woocommerce-google-adwords-conversion-tracking-tag.png +0 -0
  47. vendor/freemius/wordpress-sdk/includes/class-freemius.php +2 -25
  48. vendor/freemius/wordpress-sdk/includes/managers/class-fs-admin-notice-manager.php +2 -7
  49. vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/ArgumentNotExistException.php +1 -5
  50. vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/EmptyArgumentException.php +1 -5
  51. vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/Exception.php +1 -5
  52. vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/InvalidArgumentException.php +1 -5
  53. vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/OAuthException.php +1 -5
  54. vendor/freemius/wordpress-sdk/includes/sdk/FreemiusBase.php +0 -4
  55. vendor/freemius/wordpress-sdk/includes/sdk/FreemiusWordPress.php +1 -4
  56. vendor/freemius/wordpress-sdk/require.php +1 -5
  57. vendor/freemius/wordpress-sdk/start.php +1 -1
  58. vendor/freemius/wordpress-sdk/templates/account/partials/addon.php +1 -6
  59. vendor/freemius/wordpress-sdk/templates/ajax-loader.php +1 -6
  60. vendor/freemius/wordpress-sdk/templates/debug.php +2 -8
  61. vendor/freemius/wordpress-sdk/templates/firewall-issues-js.php +6 -10
  62. vendor/freemius/wordpress-sdk/templates/partials/network-activation.php +1 -6
  63. vendor/freemius/wordpress-sdk/templates/sticky-admin-notice-js.php +2 -4
  64. vendor/giggsey/libphonenumber-for-php/METADATA-VERSION.txt +1 -1
  65. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/229.php +5 -1
  66. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/238.php +3 -0
  67. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/248.php +0 -2
  68. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/32.php +0 -1
  69. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/354.php +0 -1
  70. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/502.php +0 -1
  71. vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/507.php +0 -1
  72. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AG.php +1 -1
  73. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AI.php +1 -1
  74. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AS.php +1 -1
  75. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BB.php +1 -1
  76. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BJ.php +1 -1
  77. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BM.php +1 -1
  78. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BS.php +1 -1
  79. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CA.php +1 -1
  80. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CL.php +4 -4
  81. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CV.php +2 -3
  82. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_DM.php +1 -1
  83. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_DO.php +1 -1
  84. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GA.php +6 -6
  85. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GD.php +1 -1
  86. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GU.php +1 -1
  87. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_IS.php +3 -3
  88. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_JM.php +1 -1
  89. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KN.php +1 -1
  90. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KR.php +1 -1
  91. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KW.php +1 -1
  92. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KY.php +3 -3
  93. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_LC.php +1 -1
  94. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_LI.php +1 -1
  95. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_MP.php +1 -1
  96. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_MS.php +1 -1
  97. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_PA.php +1 -1
  98. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_PR.php +1 -1
  99. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SC.php +3 -3
  100. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SG.php +1 -1
  101. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SL.php +1 -1
  102. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SX.php +1 -1
  103. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_TC.php +1 -1
  104. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_TT.php +1 -1
  105. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_US.php +3 -3
  106. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VC.php +1 -1
  107. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VG.php +1 -1
  108. vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VI.php +1 -1
  109. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_BE.php +1 -1
  110. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_MS.php +3 -3
  111. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_PT.php +1 -1
  112. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_SC.php +3 -3
  113. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_SE.php +4 -1
  114. vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_US.php +2 -2
  115. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/13.php +1 -0
  116. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/238.php +3 -3
  117. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/56.php +0 -1
  118. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/61.php +5 -5
  119. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/es/56.php +0 -1
  120. vendor/giggsey/libphonenumber-for-php/src/geocoding/data/pt/238.php +3 -3
  121. wgact.php +33 -13
classes/admin/class-admin.php CHANGED
@@ -1,10 +1,13 @@
1
  <?php
2
 
3
  // TODO move script for copying debug info into a proper .js enqueued file, or switch tabs to JavaScript switching and always save all settings at the same time
 
4
  namespace WCPM\Classes\Admin;
5
 
6
- use WCPM\Classes\Pixels\Google\Google ;
 
7
  use WCPM\Classes\Pixels\Trait_Shop ;
 
8
 
9
  if ( !defined( 'ABSPATH' ) ) {
10
  exit;
@@ -13,6 +16,7 @@ if ( !defined( 'ABSPATH' ) ) {
13
 
14
  class Admin
15
  {
 
16
  use Trait_Shop ;
17
  public $ip ;
18
  protected $text_domain ;
@@ -21,13 +25,11 @@ class Admin
21
  protected $documentation ;
22
  private $consent_mode_regions ;
23
  private $validations ;
24
- private $google ;
25
  public function __construct( $options )
26
  {
27
  $this->options = $options;
28
  $this->plugin_hook = 'woocommerce_page_wpm';
29
  $this->documentation = new Documentation();
30
- $this->google = new Google( $this->options );
31
  add_action( 'admin_enqueue_scripts', [ $this, 'wpm_admin_scripts' ] );
32
  // add the admin options page
33
  add_action( 'admin_menu', [ $this, 'wpm_plugin_admin_add_page' ], 99 );
@@ -46,7 +48,7 @@ class Admin
46
 
47
  protected function if_is_wpm_admin_page()
48
  {
49
- $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
50
 
51
  if ( !empty($_get['page']) && 'wpm' === $_get['page'] ) {
52
  return true;
@@ -75,7 +77,7 @@ class Admin
75
 
76
  public function my_after_purchase_js( $js_function )
77
  {
78
- return "function ( response ) {\n\n let\n isTrial = (null != response.purchase.trial_ends),\n isSubscription = (null != response.purchase.initial_amount),\n total = isTrial ? 0 : (isSubscription ? response.purchase.initial_amount : response.purchase.gross).toString(),\n productName = 'WooCommerce Pixel Manager',\n // storeUrl = 'https://sweetcode.com',\n storeName = 'SweetCode';\n \n window.dataLayer = window.dataLayer || [];\n\n function gtag() {\n dataLayer.push(arguments);\n }\n \n gtag('js', new Date()); \n \n gtag('config', 'UA-39746956-10', {'anonymize_ip': true});\n gtag('config', 'G-2QE000DX8D');\n gtag('config', 'AW-406204436');\n \n gtag('event', 'purchase', {\n 'send_to':['UA-39746956-10', 'G-2QE000DX8D'],\n 'transaction_id':response.purchase.id.toString(),\n 'currency': response.purchase.currency.toUpperCase(),\n 'discount':0,\n 'items':[{\n 'id':response.purchase.plan_id.toString(),\n 'quantity':1,\n 'price':total,\n 'name':productName,\n 'category': 'Plugin',\n }],\n 'affiliation': storeName,\n 'value':response.purchase.initial_amount.toString()\n });\n \n gtag('event', 'conversion', {\n 'send_to': 'AW-406204436/XrUYCK3J8YoCEJTg2MEB',\n 'value': response.purchase.initial_amount.toString(),\n 'currency': response.purchase.currency.toUpperCase(),\n 'transaction_id': response.purchase.id.toString()\n });\n \n !function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '257839909406661');\n fbq('track', 'PageView');\n \n fbq('track', 'Purchase', {\n currency: 'USD',\n value: total\n });\n \n var _dcq = _dcq || [];\n\t\t\tvar _dcs = _dcs || {};\n\t\t\t_dcs.account = '5594556';\n\t\n\t\t\t(function() {\n\t\t\t\tvar dc = document.createElement('script');\n\t\t\t\tdc.type = 'text/javascript'; dc.async = true;\n\t\t\t\tdc.src = '//tag.getdrip.com/5594556.js';\n\t\t\t\tvar s = document.getElementsByTagName('script')[0];\n\t\t\t\ts.parentNode.insertBefore(dc, s);\n\t\t\t})();\n\t\t\t\n\t\t\twindow._dcq.push([\n\t\t\t\t'track',\n\t\t\t\t'Placed an order',\n\t\t\t]);\n\t\t\t\n\t\t\twindow._dcq.push([\n\t\t\t\t'track',\n\t\t\t\t'purchase,\n\t\t\t\t{\n\t\t\t\t\tvalue: total * 100,\n\t\t\t\t\tcurrency_code: response.purchase.currency.toUpperCase(),\n\t\t\t\t}\n\t\t\t]);\n \n }";
79
  }
80
 
81
  public function my_checkout_enrich( $html )
@@ -203,7 +205,7 @@ class Admin
203
  // add the field for the conversion label
204
  add_settings_field(
205
  'wpm_plugin_conversion_label',
206
- esc_html__( 'Google Ads Purchase Conversion Label', 'woocommerce-google-adwords-conversion-tracking-tag' ),
207
  [ $this, 'wpm_option_html_google_ads_conversion_label' ],
208
  'wpm_plugin_options_page',
209
  $section_ids['settings_name']
@@ -234,7 +236,7 @@ class Admin
234
  public function add_section_main_subsection_facebook( $section_ids )
235
  {
236
  $sub_section_ids = [
237
- 'title' => esc_html__( 'Meta (Facebook)', 'woocommerce-google-adwords-conversion-tracking-tag' ),
238
  'slug' => 'facebook',
239
  ];
240
  add_settings_field(
@@ -249,7 +251,7 @@ class Admin
249
  // add the field for the conversion label
250
  add_settings_field(
251
  'wpm_plugin_facebook_pixel_id',
252
- esc_html__( 'Meta (Facebook) pixel ID', 'woocommerce-google-adwords-conversion-tracking-tag' ),
253
  [ $this, 'wpm_option_html_facebook_pixel_id' ],
254
  'wpm_plugin_options_page',
255
  $section_ids['settings_name']
@@ -388,16 +390,6 @@ class Admin
388
  'wpm_plugin_options_page',
389
  $section_ids['settings_name']
390
  );
391
- if ( wpm_fs()->is__premium_only() || $this->options['general']['pro_version_demo'] ) {
392
- // add checkbox for disabling tracking for user roles
393
- add_settings_field(
394
- 'wpm_setting_disable_tracking_for_user_roles',
395
- esc_html__( 'Disable Tracking for User Roles', 'woocommerce-google-adwords-conversion-tracking-tag' ),
396
- [ $this, 'wpm_setting_html_disable_tracking_for_user_roles' ],
397
- 'wpm_plugin_options_page',
398
- $section_ids['settings_name']
399
- );
400
- }
401
  }
402
 
403
  public function add_section_advanced_subsection_google( $section_ids )
@@ -415,6 +407,16 @@ class Admin
415
  'wpm_plugin_options_page',
416
  $section_ids['settings_name']
417
  );
 
 
 
 
 
 
 
 
 
 
418
  // add the field for the aw_merchant_id
419
  add_settings_field(
420
  'wpm_plugin_aw_merchant_id',
@@ -532,7 +534,7 @@ class Admin
532
  'wpm_plugin_options_page',
533
  $section_ids['settings_name']
534
  );
535
- if ( ( new Environment_Check( $this->options ) )->is_borlabs_cookie_active() ) {
536
  // add fields for the Borlabs Cookie support
537
  add_settings_field(
538
  'wpm_setting_borlabs_support',
@@ -542,7 +544,7 @@ class Admin
542
  $section_ids['settings_name']
543
  );
544
  }
545
- if ( ( new Environment_Check( $this->options ) )->is_cookiebot_active() ) {
546
  // add fields for the Cookiebot support
547
  add_settings_field(
548
  'wpm_setting_cookiebot_support',
@@ -552,7 +554,17 @@ class Admin
552
  $section_ids['settings_name']
553
  );
554
  }
555
- if ( ( new Environment_Check( $this->options ) )->is_complianz_active() ) {
 
 
 
 
 
 
 
 
 
 
556
  // add fields for the Complianz GDPR support
557
  add_settings_field(
558
  'wpm_setting_complianz_support',
@@ -562,7 +574,7 @@ class Admin
562
  $section_ids['settings_name']
563
  );
564
  }
565
- if ( ( new Environment_Check( $this->options ) )->is_cookie_notice_active() ) {
566
  // add fields for the Cookie Notice by hu-manity.co support
567
  add_settings_field(
568
  'wpm_setting_cookie_notice_support',
@@ -572,7 +584,7 @@ class Admin
572
  $section_ids['settings_name']
573
  );
574
  }
575
- if ( ( new Environment_Check( $this->options ) )->is_cookie_script_active() ) {
576
  // add fields for the Cookie Script support
577
  add_settings_field(
578
  'wpm_setting_cookie_script_support',
@@ -582,7 +594,7 @@ class Admin
582
  $section_ids['settings_name']
583
  );
584
  }
585
- if ( ( new Environment_Check( $this->options ) )->is_moove_gdpr_active() ) {
586
  // add fields for the GDPR Cookie Compliance support
587
  add_settings_field(
588
  'wpm_setting_moove_gdpr_support',
@@ -592,7 +604,7 @@ class Admin
592
  $section_ids['settings_name']
593
  );
594
  }
595
- if ( ( new Environment_Check( $this->options ) )->is_cookie_law_info_active() ) {
596
  // add fields for the GDPR Cookie Consent support
597
  add_settings_field(
598
  'wpm_setting_cookie_law_info_support',
@@ -607,7 +619,7 @@ class Admin
607
  public function add_section_advanced_subsection_facebook( $section_ids )
608
  {
609
  $sub_section_ids = [
610
- 'title' => 'Meta (Facebook)',
611
  'slug' => 'facebook',
612
  ];
613
  add_settings_field(
@@ -622,7 +634,7 @@ class Admin
622
  // add field for the Facebook CAPI token
623
  add_settings_field(
624
  'wpm_setting_facebook_capi_token',
625
- esc_html__( 'Meta (Facebook) CAPI: token', 'woocommerce-google-adwords-conversion-tracking-tag' ),
626
  [ $this, 'wpm_setting_html_facebook_capi_token' ],
627
  'wpm_plugin_options_page',
628
  $section_ids['settings_name']
@@ -630,7 +642,7 @@ class Admin
630
  // add field for the Facebook CAPI user transparency process anonymous hits
631
  add_settings_field(
632
  'wpm_setting_facebook_capi_user_transparency_process_anonymous_hits',
633
- esc_html__( 'Meta (Facebook) CAPI: process anonymous hits', 'woocommerce-google-adwords-conversion-tracking-tag' ),
634
  [ $this, 'wpm_setting_facebook_capi_user_transparency_process_anonymous_hits' ],
635
  'wpm_plugin_options_page',
636
  $section_ids['settings_name']
@@ -638,7 +650,7 @@ class Admin
638
  // add field for the Facebook CAPI user transparency send additional client identifiers
639
  add_settings_field(
640
  'wpm_setting_facebook_capi_user_transparency_send_additional_client_identifiers',
641
- esc_html__( 'Meta (Facebook) CAPI: send additional visitor identifiers', 'woocommerce-google-adwords-conversion-tracking-tag' ),
642
  [ $this, 'wpm_setting_facebook_capi_user_transparency_send_additional_client_identifiers' ],
643
  'wpm_plugin_options_page',
644
  $section_ids['settings_name']
@@ -646,7 +658,7 @@ class Admin
646
  // add fields for Facebook microdata
647
  add_settings_field(
648
  'wpm_setting_facebook_microdata_active',
649
- esc_html__( 'Meta (Facebook) Microdata Tags for Catalogues', 'woocommerce-google-adwords-conversion-tracking-tag' ),
650
  [ $this, 'wpm_setting_html_facebook_microdata' ],
651
  'wpm_plugin_options_page',
652
  $section_ids['settings_name']
@@ -668,6 +680,39 @@ class Admin
668
  [ $this, 'wpm_plugin_section_add_cart_data_description' ],
669
  'wpm_plugin_options_page'
670
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
671
  // add checkbox for dynamic remarketing
672
  add_settings_field(
673
  'wpm_plugin_option_gads_dynamic_remarketing',
@@ -785,7 +830,7 @@ class Admin
785
 
786
  <script>
787
  if (typeof wpm_hide_script_blocker_warning === "function") {
788
- wpm_hide_script_blocker_warning()
789
  }
790
  </script>
791
 
@@ -922,7 +967,7 @@ class Admin
922
  style="display:block; margin-bottom: 10px; width: 100%;resize: none;color:dimgrey;"
923
  cols="100%" rows="30"
924
  readonly><?php
925
- esc_html_e( ( new Debug_Info( $this->options ) )->get_debug_info() );
926
  ?>
927
  </textarea>
928
  <button id="debug-info-button"
@@ -1103,7 +1148,7 @@ class Admin
1103
  $this->get_status_icon_new( $this->options['google']['ads']['conversion_label'], $this->options['google']['ads']['conversion_id'] );
1104
  $this->get_documentation_html_by_key( 'google_ads_conversion_label' );
1105
  echo '<br><br>' ;
1106
- esc_html_e( 'The purchase conversion label looks similar to this:', 'woocommerce-google-adwords-conversion-tracking-tag' );
1107
  echo '&nbsp;<i>Xt19CO3axGAX0vg6X3gM</i>' ;
1108
 
1109
  if ( $this->options['google']['ads']['conversion_label'] && !$this->options['google']['ads']['conversion_id'] ) {
@@ -1149,7 +1194,7 @@ class Admin
1149
  $this->get_status_icon_new( $this->options['facebook']['pixel_id'] );
1150
  $this->get_documentation_html_by_key( 'facebook_pixel_id' );
1151
  echo '<br><br>' ;
1152
- esc_html_e( 'The Meta (Facebook) pixel ID looks similar to this:', 'woocommerce-google-adwords-conversion-tracking-tag' );
1153
  echo '&nbsp;<i>765432112345678</i>' ;
1154
  }
1155
 
@@ -1335,7 +1380,7 @@ class Admin
1335
  <a class="documentation-icon" href="<?php
1336
  echo esc_url( $path ) ;
1337
  ?>" target="_blank">
1338
- <span style="vertical-align: top; margin-top: 0" class="dashicons dashicons-info-outline tooltip"><span
1339
  class="tooltiptext">
1340
  <?php
1341
  esc_html_e( 'open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag' );
@@ -1345,6 +1390,42 @@ class Admin
1345
  <?php
1346
  }
1347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1348
  public function wpm_setting_html_google_consent_mode_active()
1349
  {
1350
  // adding the hidden input is a hack to make WordPress save the option with the value zero,
@@ -1395,7 +1476,7 @@ class Admin
1395
  <option value="<?php
1396
  esc_html_e( $region_code );
1397
  ?>" <?php
1398
- esc_html_e( ( in_array( $region_code, $this->options['google']['consent_mode']['regions'], true ) ? 'selected' : '' ) );
1399
  ?>><?php
1400
  esc_html_e( $region_name );
1401
  ?></option>
@@ -1405,9 +1486,9 @@ class Admin
1405
 
1406
  </select>
1407
  <script>
1408
- jQuery("#wpm_setting_google_consent_regions").select2({
1409
  // theme: "classic"
1410
- })
1411
  </script>
1412
  <?php
1413
  $this->get_documentation_html_by_key( 'google_consent_regions' );
@@ -1553,7 +1634,7 @@ class Admin
1553
  ?>
1554
  </label>
1555
  <?php
1556
- $this->get_status_icon_new( $this->options['google']['user_id'], $this->options['google']['analytics']['universal']['property_id'] || $this->options['google']['analytics']['ga4']['measurement_id'] || $this->google->is_google_ads_active(), true );
1557
  $this->html_pro_feature();
1558
  // echo $this->get_documentation_html('/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode#/consent-mgmt/google-consent-mode');
1559
  ?>
@@ -1590,13 +1671,13 @@ class Admin
1590
  ?>
1591
  </label>
1592
  <?php
1593
- $this->get_status_icon_new( $this->options['google']['ads']['enhanced_conversions'], $this->google->is_google_ads_active(), false );
1594
  $this->html_pro_feature();
1595
  $this->get_documentation_html_by_key( 'google_ads_enhanced_conversions' );
1596
  ?>
1597
  <?php
1598
 
1599
- if ( !$this->google->is_google_ads_active() ) {
1600
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1601
  esc_html_e( 'You need to activate Google Ads', 'woocommerce-google-adwords-conversion-tracking-tag' );
1602
  echo '</p><br>' ;
@@ -1620,7 +1701,7 @@ class Admin
1620
  ?>
1621
  />
1622
  <?php
1623
- $this->get_status_icon_new( $this->options['google']['ads']['phone_conversion_number'], $this->options['google']['ads']['phone_conversion_label'] && $this->options['google']['ads']['phone_conversion_number'] );
1624
  $this->get_documentation_html_by_key( 'google_ads_phone_conversion_number' );
1625
  $this->html_pro_feature();
1626
  echo '<br><br>' ;
@@ -1643,7 +1724,7 @@ class Admin
1643
  ?>
1644
  />
1645
  <?php
1646
- $this->get_status_icon_new( $this->options['google']['ads']['phone_conversion_label'], $this->options['google']['ads']['phone_conversion_label'] && $this->options['google']['ads']['phone_conversion_number'] );
1647
  $this->get_documentation_html_by_key( 'google_ads_phone_conversion_label' );
1648
  $this->html_pro_feature();
1649
  echo '<br><br>' ;
@@ -1664,6 +1745,40 @@ class Admin
1664
  $this->html_pro_feature();
1665
  }
1666
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1667
  public function wpm_setting_html_complianz_support()
1668
  {
1669
  esc_html_e( 'Complianz GDPR detected. Automatic support is:', 'woocommerce-google-adwords-conversion-tracking-tag' );
@@ -1750,7 +1865,7 @@ class Admin
1750
 
1751
  if ( !$this->options['facebook']['pixel_id'] ) {
1752
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1753
- esc_html_e( 'You need to activate the Meta (Facebook) pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1754
  echo '</p><br>' ;
1755
  }
1756
 
@@ -1780,7 +1895,7 @@ class Admin
1780
  ?>
1781
  />
1782
  <?php
1783
- esc_html_e( 'Send CAPI hits for anonymous visitors who likely have blocked the Meta (Facebook) pixel.', 'woocommerce-google-adwords-conversion-tracking-tag' );
1784
  ?>
1785
  </label>
1786
  <?php
@@ -1790,7 +1905,7 @@ class Admin
1790
 
1791
  if ( $this->options['facebook']['capi']['user_transparency']['process_anonymous_hits'] && !$this->options['facebook']['pixel_id'] ) {
1792
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1793
- esc_html_e( 'You need to activate the Meta (Facebook) pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1794
  echo '</p><br>' ;
1795
  }
1796
 
@@ -1826,7 +1941,7 @@ class Admin
1826
 
1827
  if ( $this->options['facebook']['capi']['user_transparency']['send_additional_client_identifiers'] && !$this->options['facebook']['pixel_id'] ) {
1828
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1829
- esc_html_e( 'You need to activate the Meta (Facebook) pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1830
  echo '</p><br>' ;
1831
  }
1832
 
@@ -1851,7 +1966,7 @@ class Admin
1851
  ?>
1852
  />
1853
  <?php
1854
- esc_html_e( 'Enable Meta (Facebook) product microdata output', 'woocommerce-google-adwords-conversion-tracking-tag' );
1855
  ?>
1856
  </label>
1857
  <?php
@@ -1861,12 +1976,44 @@ class Admin
1861
 
1862
  if ( $this->options['facebook']['microdata'] && !$this->options['facebook']['pixel_id'] ) {
1863
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1864
- esc_html_e( 'You need to activate the Meta (Facebook) pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1865
  echo '</p><br>' ;
1866
  }
1867
 
1868
  }
1869
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1870
  public function wpm_setting_html_order_duplication_prevention()
1871
  {
1872
  // adding the hidden input is a hack to make WordPress save the option with the value zero,
@@ -1916,49 +2063,10 @@ class Admin
1916
  ?>
1917
  </label>
1918
  <?php
1919
- $this->get_status_icon_new( $this->options['general']['maximum_compatibility_mode'], true, true );
1920
  $this->get_documentation_html_by_key( 'maximum_compatibility_mode' );
1921
  }
1922
 
1923
- public function wpm_setting_html_disable_tracking_for_user_roles()
1924
- {
1925
- // https://semantic-ui.com/modules/dropdown.html#multiple-selection
1926
- // https://developer.woocommerce.com/2017/08/08/selectwoo-an-accessible-replacement-for-select2/
1927
- // https://github.com/woocommerce/selectWoo
1928
- ?>
1929
- <select id="wpm_setting_disable_tracking_for_user_roles" multiple="multiple"
1930
- name="wgact_plugin_options[shop][disable_tracking_for][]"
1931
- style="width:350px; padding-left: 10px" data-placeholder="Choose roles&hellip;" aria-label="Roles"
1932
- class="wc-enhanced-select"
1933
- <?php
1934
- esc_html_e( $this->disable_if_demo() );
1935
- ?>
1936
- >
1937
- <?php
1938
- foreach ( get_editable_roles() as $role => $details ) {
1939
- ?>
1940
- <option value="<?php
1941
- esc_html_e( $role );
1942
- ?>" <?php
1943
- esc_html_e( ( in_array( $role, $this->options['shop']['disable_tracking_for'], true ) ? 'selected' : '' ) );
1944
- ?>><?php
1945
- esc_html_e( $details['name'] );
1946
- ?></option>
1947
- <?php
1948
- }
1949
- ?>
1950
-
1951
- </select>
1952
- <script>
1953
- jQuery("#wpm_setting_disable_tracking_for_user_roles").select2({
1954
- // theme: "classic"
1955
- })
1956
- </script>
1957
- <?php
1958
- // $this->get_documentation_html_by_key('google_consent_regions');
1959
- $this->html_pro_feature();
1960
- }
1961
-
1962
  private function get_order_duplication_prevention_text()
1963
  {
1964
  esc_html_e( 'Basic order duplication prevention is ', 'woocommerce-google-adwords-conversion-tracking-tag' );
@@ -2191,6 +2299,67 @@ class Admin
2191
  esc_html_e( 'ID of your Google Merchant Center account. It looks like this: 12345678', 'woocommerce-google-adwords-conversion-tracking-tag' );
2192
  }
2193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2194
  public function wpm_plugin_option_product_identifier()
2195
  {
2196
  ?>
@@ -2442,7 +2611,7 @@ class Admin
2442
 
2443
  if ( !$this->validations->is_facebook_pixel_id( $input['facebook']['pixel_id'] ) ) {
2444
  $input['facebook']['pixel_id'] = ( isset( $this->options['facebook']['pixel_id'] ) ? $this->options['facebook']['pixel_id'] : '' );
2445
- add_settings_error( 'wgact_plugin_options', 'invalid-facebook-pixel-id', esc_html__( 'You have entered an invalid Meta (Facebook) pixel ID. It only contains 14 to 16 digits.', 'woocommerce-google-adwords-conversion-tracking-tag' ) );
2446
  }
2447
 
2448
  }
@@ -2451,7 +2620,7 @@ class Admin
2451
 
2452
  if ( !$this->validations->is_facebook_capi_token( $input['facebook']['capi']['token'] ) ) {
2453
  $input['facebook']['capi']['token'] = ( isset( $this->options['facebook']['capi']['token'] ) ? $this->options['facebook']['capi']['token'] : '' );
2454
- add_settings_error( 'wgact_plugin_options', 'invalid-facebook-pixel-id', esc_html__( 'You have entered an invalid Meta (Facebook) CAPI token.', 'woocommerce-google-adwords-conversion-tracking-tag' ) );
2455
  }
2456
 
2457
  }
@@ -2509,12 +2678,16 @@ class Admin
2509
  }
2510
 
2511
  }
2512
- /**
2513
- * Merging with the existing options and overwriting old values
2514
- * since disabling a checkbox doesn't send a value,
2515
- * we need to set one to overwrite the old value
2516
- */
2517
- return array_replace_recursive( $this->non_form_keys( $input ), $input );
 
 
 
 
2518
  }
2519
 
2520
  // Recursively go through the array and merge (overwrite old values with new ones
@@ -2554,9 +2727,6 @@ class Admin
2554
  // but should be preserved
2555
  $non_form_keys = [
2556
  'db_version' => $this->options['db_version'],
2557
- 'shop' => [
2558
- 'disable_tracking_for' => [],
2559
- ],
2560
  ];
2561
  // in case the form field input is missing
2562
  // if (!array_key_exists('google_business_vertical', $input['google']['ads'])) {
1
  <?php
2
 
3
  // TODO move script for copying debug info into a proper .js enqueued file, or switch tabs to JavaScript switching and always save all settings at the same time
4
+ // TODO debug info list of active payment gateways
5
  namespace WCPM\Classes\Admin;
6
 
7
+ use WC_Geolocation ;
8
+ use WCPM\Classes\Pixels\Google\Trait_Google ;
9
  use WCPM\Classes\Pixels\Trait_Shop ;
10
+ use WP_Screen ;
11
 
12
  if ( !defined( 'ABSPATH' ) ) {
13
  exit;
16
 
17
  class Admin
18
  {
19
+ use Trait_Google ;
20
  use Trait_Shop ;
21
  public $ip ;
22
  protected $text_domain ;
25
  protected $documentation ;
26
  private $consent_mode_regions ;
27
  private $validations ;
 
28
  public function __construct( $options )
29
  {
30
  $this->options = $options;
31
  $this->plugin_hook = 'woocommerce_page_wpm';
32
  $this->documentation = new Documentation();
 
33
  add_action( 'admin_enqueue_scripts', [ $this, 'wpm_admin_scripts' ] );
34
  // add the admin options page
35
  add_action( 'admin_menu', [ $this, 'wpm_plugin_admin_add_page' ], 99 );
48
 
49
  protected function if_is_wpm_admin_page()
50
  {
51
+ $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
52
 
53
  if ( !empty($_get['page']) && 'wpm' === $_get['page'] ) {
54
  return true;
77
 
78
  public function my_after_purchase_js( $js_function )
79
  {
80
+ return "function ( response ) {\n\n let\n isTrial = (null != response.purchase.trial_ends),\n isSubscription = (null != response.purchase.initial_amount),\n total = isTrial ? 0 : (isSubscription ? response.purchase.initial_amount : response.purchase.gross).toString(),\n productName = 'WooCommerce Pixel Manager',\n // storeUrl = 'https://sweetcode.com',\n storeName = 'SweetCode';\n \n window.dataLayer = window.dataLayer || [];\n\n function gtag() {\n dataLayer.push(arguments);\n }\n \n gtag('js', new Date()); \n \n gtag('config', 'UA-39746956-10', {'anonymize_ip':'true'});\n gtag('config', 'G-LWRCPMQS9T');\n gtag('config', 'AW-406204436');\n \n gtag('event', 'purchase', {\n 'send_to':['UA-39746956-10', 'G-LWRCPMQS9T'],\n 'transaction_id':response.purchase.id.toString(),\n 'currency':'USD',\n 'discount':0,\n 'items':[{\n 'id':response.purchase.plan_id.toString(),\n 'quantity':1,\n 'price':total,\n 'name':productName,\n 'category': 'Plugin',\n }],\n 'affiliation': storeName,\n 'value':response.purchase.initial_amount.toString()\n });\n \n gtag('event', 'conversion', {\n 'send_to': 'AW-406204436/XrUYCK3J8YoCEJTg2MEB',\n 'value': response.purchase.initial_amount.toString(),\n 'currency': 'USD',\n 'transaction_id': response.purchase.id.toString()\n });\n \n !function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '257839909406661');\n fbq('track', 'PageView');\n \n fbq('track', 'Purchase', {\n currency: 'USD',\n value: total\n });\n }";
81
  }
82
 
83
  public function my_checkout_enrich( $html )
205
  // add the field for the conversion label
206
  add_settings_field(
207
  'wpm_plugin_conversion_label',
208
+ esc_html__( 'Google Ads Conversion Label', 'woocommerce-google-adwords-conversion-tracking-tag' ),
209
  [ $this, 'wpm_option_html_google_ads_conversion_label' ],
210
  'wpm_plugin_options_page',
211
  $section_ids['settings_name']
236
  public function add_section_main_subsection_facebook( $section_ids )
237
  {
238
  $sub_section_ids = [
239
+ 'title' => esc_html__( 'Facebook', 'woocommerce-google-adwords-conversion-tracking-tag' ),
240
  'slug' => 'facebook',
241
  ];
242
  add_settings_field(
251
  // add the field for the conversion label
252
  add_settings_field(
253
  'wpm_plugin_facebook_pixel_id',
254
+ esc_html__( 'Facebook pixel ID', 'woocommerce-google-adwords-conversion-tracking-tag' ),
255
  [ $this, 'wpm_option_html_facebook_pixel_id' ],
256
  'wpm_plugin_options_page',
257
  $section_ids['settings_name']
390
  'wpm_plugin_options_page',
391
  $section_ids['settings_name']
392
  );
 
 
 
 
 
 
 
 
 
 
393
  }
394
 
395
  public function add_section_advanced_subsection_google( $section_ids )
407
  'wpm_plugin_options_page',
408
  $section_ids['settings_name']
409
  );
410
+ if ( $this->options['google']['gtag']['deactivation'] ) {
411
+ // add fields for the gtag insertion
412
+ add_settings_field(
413
+ 'wpm_plugin_option_gtag_deactivation',
414
+ esc_html__( 'gtag Deactivation', 'woocommerce-google-adwords-conversion-tracking-tag' ),
415
+ [ $this, 'wpm_setting_html_google_gtag_deactivation' ],
416
+ 'wpm_plugin_options_page',
417
+ $section_ids['settings_name']
418
+ );
419
+ }
420
  // add the field for the aw_merchant_id
421
  add_settings_field(
422
  'wpm_plugin_aw_merchant_id',
534
  'wpm_plugin_options_page',
535
  $section_ids['settings_name']
536
  );
537
+ if ( ( new Environment_Check() )->is_borlabs_cookie_active() ) {
538
  // add fields for the Borlabs Cookie support
539
  add_settings_field(
540
  'wpm_setting_borlabs_support',
544
  $section_ids['settings_name']
545
  );
546
  }
547
+ if ( ( new Environment_Check() )->is_cookiebot_active() ) {
548
  // add fields for the Cookiebot support
549
  add_settings_field(
550
  'wpm_setting_cookiebot_support',
554
  $section_ids['settings_name']
555
  );
556
  }
557
+ if ( !( new Environment_Check() )->is_some_cmp_active() ) {
558
+ // add fields for the Cookiebot support
559
+ add_settings_field(
560
+ 'wpm_setting_cookiebot_active',
561
+ esc_html__( 'Cookiebot support', 'woocommerce-google-adwords-conversion-tracking-tag' ),
562
+ [ $this, 'wpm_setting_html_cookiebot_manual_setting' ],
563
+ 'wpm_plugin_options_page',
564
+ $section_ids['settings_name']
565
+ );
566
+ }
567
+ if ( ( new Environment_Check() )->is_complianz_active() ) {
568
  // add fields for the Complianz GDPR support
569
  add_settings_field(
570
  'wpm_setting_complianz_support',
574
  $section_ids['settings_name']
575
  );
576
  }
577
+ if ( ( new Environment_Check() )->is_cookie_notice_active() ) {
578
  // add fields for the Cookie Notice by hu-manity.co support
579
  add_settings_field(
580
  'wpm_setting_cookie_notice_support',
584
  $section_ids['settings_name']
585
  );
586
  }
587
+ if ( ( new Environment_Check() )->is_cookie_script_active() ) {
588
  // add fields for the Cookie Script support
589
  add_settings_field(
590
  'wpm_setting_cookie_script_support',
594
  $section_ids['settings_name']
595
  );
596
  }
597
+ if ( ( new Environment_Check() )->is_moove_gdpr_active() ) {
598
  // add fields for the GDPR Cookie Compliance support
599
  add_settings_field(
600
  'wpm_setting_moove_gdpr_support',
604
  $section_ids['settings_name']
605
  );
606
  }
607
+ if ( ( new Environment_Check() )->is_cookie_law_info_active() ) {
608
  // add fields for the GDPR Cookie Consent support
609
  add_settings_field(
610
  'wpm_setting_cookie_law_info_support',
619
  public function add_section_advanced_subsection_facebook( $section_ids )
620
  {
621
  $sub_section_ids = [
622
+ 'title' => 'Facebook',
623
  'slug' => 'facebook',
624
  ];
625
  add_settings_field(
634
  // add field for the Facebook CAPI token
635
  add_settings_field(
636
  'wpm_setting_facebook_capi_token',
637
+ esc_html__( 'Facebook CAPI: token', 'woocommerce-google-adwords-conversion-tracking-tag' ),
638
  [ $this, 'wpm_setting_html_facebook_capi_token' ],
639
  'wpm_plugin_options_page',
640
  $section_ids['settings_name']
642
  // add field for the Facebook CAPI user transparency process anonymous hits
643
  add_settings_field(
644
  'wpm_setting_facebook_capi_user_transparency_process_anonymous_hits',
645
+ esc_html__( 'Facebook CAPI: process anonymous hits', 'woocommerce-google-adwords-conversion-tracking-tag' ),
646
  [ $this, 'wpm_setting_facebook_capi_user_transparency_process_anonymous_hits' ],
647
  'wpm_plugin_options_page',
648
  $section_ids['settings_name']
650
  // add field for the Facebook CAPI user transparency send additional client identifiers
651
  add_settings_field(
652
  'wpm_setting_facebook_capi_user_transparency_send_additional_client_identifiers',
653
+ esc_html__( 'Facebook CAPI: send additional visitor identifiers', 'woocommerce-google-adwords-conversion-tracking-tag' ),
654
  [ $this, 'wpm_setting_facebook_capi_user_transparency_send_additional_client_identifiers' ],
655
  'wpm_plugin_options_page',
656
  $section_ids['settings_name']
658
  // add fields for Facebook microdata
659
  add_settings_field(
660
  'wpm_setting_facebook_microdata_active',
661
+ esc_html__( 'Facebook Microdata Tags for Catalogues', 'woocommerce-google-adwords-conversion-tracking-tag' ),
662
  [ $this, 'wpm_setting_html_facebook_microdata' ],
663
  'wpm_plugin_options_page',
664
  $section_ids['settings_name']
680
  [ $this, 'wpm_plugin_section_add_cart_data_description' ],
681
  'wpm_plugin_options_page'
682
  );
683
+ // add fields for cart data
684
+ // add_settings_field(
685
+ // 'wgact_plugin_add_cart_data',
686
+ // esc_html__(
687
+ // 'Activation',
688
+ // 'woocommerce-google-adwords-conversion-tracking-tag'
689
+ // ),
690
+ // [$this, 'wgact_option_html_google_ads_add_cart_data'],
691
+ // 'wpm_plugin_options_page',
692
+ // 'wpm_plugin_beta_section'
693
+ // );
694
+ // add the field for the aw_feed_country
695
+ // add_settings_field(
696
+ // 'wgact_plugin_aw_feed_country',
697
+ // esc_html__(
698
+ // 'aw_feed_country',
699
+ // 'woocommerce-google-adwords-conversion-tracking-tag'
700
+ // ),
701
+ // [$this, 'wgact_plugin_setting_aw_feed_country'],
702
+ // 'wpm_plugin_options_page',
703
+ // 'wpm_plugin_beta_section'
704
+ // );
705
+ // add the field for the aw_feed_language
706
+ // add_settings_field(
707
+ // 'wgact_plugin_aw_feed_language',
708
+ // esc_html__(
709
+ // 'aw_feed_language',
710
+ // 'woocommerce-google-adwords-conversion-tracking-tag'
711
+ // ),
712
+ // [$this, 'wgact_plugin_setting_aw_feed_language'],
713
+ // 'wpm_plugin_options_page',
714
+ // 'wpm_plugin_beta_section'
715
+ // );
716
  // add checkbox for dynamic remarketing
717
  add_settings_field(
718
  'wpm_plugin_option_gads_dynamic_remarketing',
830
 
831
  <script>
832
  if (typeof wpm_hide_script_blocker_warning === "function") {
833
+ wpm_hide_script_blocker_warning();
834
  }
835
  </script>
836
 
967
  style="display:block; margin-bottom: 10px; width: 100%;resize: none;color:dimgrey;"
968
  cols="100%" rows="30"
969
  readonly><?php
970
+ esc_html_e( ( new Debug_Info() )->get_debug_info() );
971
  ?>
972
  </textarea>
973
  <button id="debug-info-button"
1148
  $this->get_status_icon_new( $this->options['google']['ads']['conversion_label'], $this->options['google']['ads']['conversion_id'] );
1149
  $this->get_documentation_html_by_key( 'google_ads_conversion_label' );
1150
  echo '<br><br>' ;
1151
+ esc_html_e( 'The conversion Label looks similar to this:', 'woocommerce-google-adwords-conversion-tracking-tag' );
1152
  echo '&nbsp;<i>Xt19CO3axGAX0vg6X3gM</i>' ;
1153
 
1154
  if ( $this->options['google']['ads']['conversion_label'] && !$this->options['google']['ads']['conversion_id'] ) {
1194
  $this->get_status_icon_new( $this->options['facebook']['pixel_id'] );
1195
  $this->get_documentation_html_by_key( 'facebook_pixel_id' );
1196
  echo '<br><br>' ;
1197
+ esc_html_e( 'The Facebook pixel ID looks similar to this:', 'woocommerce-google-adwords-conversion-tracking-tag' );
1198
  echo '&nbsp;<i>765432112345678</i>' ;
1199
  }
1200
 
1380
  <a class="documentation-icon" href="<?php
1381
  echo esc_url( $path ) ;
1382
  ?>" target="_blank">
1383
+ <span style="vertical-align: top; margin-top: 0px" class="dashicons dashicons-info-outline tooltip"><span
1384
  class="tooltiptext">
1385
  <?php
1386
  esc_html_e( 'open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag' );
1390
  <?php
1391
  }
1392
 
1393
+ public function wpm_setting_html_google_gtag_deactivation()
1394
+ {
1395
+ // adding the hidden input is a hack to make WordPress save the option with the value zero,
1396
+ // instead of not saving it and remove that array key entirely
1397
+ // https://stackoverflow.com/a/1992745/4688612
1398
+ ?>
1399
+ <label>
1400
+ <input type='hidden' value='0' name='wgact_plugin_options[google][gtag][deactivation]'>
1401
+ <input type='checkbox' id='wpm_plugin_option_gtag_deactivation'
1402
+ name='wgact_plugin_options[google][gtag][deactivation]'
1403
+ value='1' <?php
1404
+ checked( $this->options['google']['gtag']['deactivation'] );
1405
+ ?> />
1406
+ <?php
1407
+ esc_html_e( 'Disable gtag.js insertion, if another plugin is inserting it already', 'woocommerce-google-adwords-conversion-tracking-tag' );
1408
+ ?>
1409
+ </label>
1410
+ <?php
1411
+ $this->get_documentation_html_by_key( 'google_gtag_deactivation' );
1412
+ ?>
1413
+ <br>
1414
+ <p>
1415
+ <span class="dashicons dashicons-info"></span>
1416
+ <?php
1417
+ esc_html_e( 'Only do this, if the other plugin does insert the gtag above this pixel. If not, keep the gtag active.', 'woocommerce-google-adwords-conversion-tracking-tag' );
1418
+ ?>
1419
+ </p>
1420
+ <p>
1421
+ <span class="dashicons dashicons-info"></span>
1422
+ <?php
1423
+ esc_html_e( 'This setting is deprecated. It will be removed in future versions of the plugin. Read more about it in the documentation.', 'woocommerce-google-adwords-conversion-tracking-tag' );
1424
+ ?>
1425
+ </p>
1426
+ <?php
1427
+ }
1428
+
1429
  public function wpm_setting_html_google_consent_mode_active()
1430
  {
1431
  // adding the hidden input is a hack to make WordPress save the option with the value zero,
1476
  <option value="<?php
1477
  esc_html_e( $region_code );
1478
  ?>" <?php
1479
+ esc_html_e( ( in_array( $region_code, $this->options['google']['consent_mode']['regions'] ) ? 'selected' : '' ) );
1480
  ?>><?php
1481
  esc_html_e( $region_name );
1482
  ?></option>
1486
 
1487
  </select>
1488
  <script>
1489
+ jQuery('#wpm_setting_google_consent_regions').select2({
1490
  // theme: "classic"
1491
+ });
1492
  </script>
1493
  <?php
1494
  $this->get_documentation_html_by_key( 'google_consent_regions' );
1634
  ?>
1635
  </label>
1636
  <?php
1637
+ $this->get_status_icon_new( $this->options['google']['user_id'], $this->options['google']['analytics']['universal']['property_id'] || $this->options['google']['analytics']['ga4']['measurement_id'] || $this->is_google_ads_active(), true );
1638
  $this->html_pro_feature();
1639
  // echo $this->get_documentation_html('/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode#/consent-mgmt/google-consent-mode');
1640
  ?>
1671
  ?>
1672
  </label>
1673
  <?php
1674
+ $this->get_status_icon_new( $this->options['google']['ads']['enhanced_conversions'], $this->is_google_ads_active(), false );
1675
  $this->html_pro_feature();
1676
  $this->get_documentation_html_by_key( 'google_ads_enhanced_conversions' );
1677
  ?>
1678
  <?php
1679
 
1680
+ if ( !$this->is_google_ads_active() ) {
1681
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1682
  esc_html_e( 'You need to activate Google Ads', 'woocommerce-google-adwords-conversion-tracking-tag' );
1683
  echo '</p><br>' ;
1701
  ?>
1702
  />
1703
  <?php
1704
+ $this->get_status_icon_new( $this->options['google']['ads']['phone_conversion_number'] );
1705
  $this->get_documentation_html_by_key( 'google_ads_phone_conversion_number' );
1706
  $this->html_pro_feature();
1707
  echo '<br><br>' ;
1724
  ?>
1725
  />
1726
  <?php
1727
+ $this->get_status_icon_new( $this->options['google']['ads']['phone_conversion_label'] );
1728
  $this->get_documentation_html_by_key( 'google_ads_phone_conversion_label' );
1729
  $this->html_pro_feature();
1730
  echo '<br><br>' ;
1745
  $this->html_pro_feature();
1746
  }
1747
 
1748
+ public function wpm_setting_html_cookiebot_manual_setting()
1749
+ {
1750
+ // adding the hidden input is a hack to make WordPress save the option with the value zero,
1751
+ // instead of not saving it and remove that array key entirely
1752
+ // https://stackoverflow.com/a/1992745/4688612
1753
+ ?>
1754
+ <label>
1755
+ <input type='hidden' value='0' name='wgact_plugin_options[shop][cookie_consent_mgmt][cookiebot][active]'>
1756
+ <input type='checkbox' id='wpm_setting_cookiebot_active'
1757
+ name='wgact_plugin_options[shop][cookie_consent_mgmt][cookiebot][active]'
1758
+ value='1'
1759
+ <?php
1760
+ checked( $this->options['shop']['cookie_consent_mgmt']['cookiebot']['active'] );
1761
+ ?>
1762
+ <?php
1763
+ esc_html_e( $this->disable_if_demo() );
1764
+ ?>
1765
+ />
1766
+ <?php
1767
+ esc_html_e( 'Enable Cookiebot settings', 'woocommerce-google-adwords-conversion-tracking-tag' );
1768
+ ?>
1769
+ </label>
1770
+ <?php
1771
+ $this->get_status_icon_new( $this->options['shop']['cookie_consent_mgmt']['cookiebot']['active'], $this->options['google']['consent_mode']['active'], true );
1772
+ $this->html_pro_feature();
1773
+
1774
+ if ( $this->options['shop']['cookie_consent_mgmt']['cookiebot']['active'] && !$this->options['google']['consent_mode']['active'] ) {
1775
+ echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1776
+ esc_html_e( 'You need to activate the Google consent mode', 'woocommerce-google-adwords-conversion-tracking-tag' );
1777
+ echo '</p><br>' ;
1778
+ }
1779
+
1780
+ }
1781
+
1782
  public function wpm_setting_html_complianz_support()
1783
  {
1784
  esc_html_e( 'Complianz GDPR detected. Automatic support is:', 'woocommerce-google-adwords-conversion-tracking-tag' );
1865
 
1866
  if ( !$this->options['facebook']['pixel_id'] ) {
1867
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1868
+ esc_html_e( 'You need to activate the Facebook pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1869
  echo '</p><br>' ;
1870
  }
1871
 
1895
  ?>
1896
  />
1897
  <?php
1898
+ esc_html_e( 'Send CAPI hits for anonymous visitors who likely have blocked the Facebook pixel.', 'woocommerce-google-adwords-conversion-tracking-tag' );
1899
  ?>
1900
  </label>
1901
  <?php
1905
 
1906
  if ( $this->options['facebook']['capi']['user_transparency']['process_anonymous_hits'] && !$this->options['facebook']['pixel_id'] ) {
1907
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1908
+ esc_html_e( 'You need to activate the Facebook pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1909
  echo '</p><br>' ;
1910
  }
1911
 
1941
 
1942
  if ( $this->options['facebook']['capi']['user_transparency']['send_additional_client_identifiers'] && !$this->options['facebook']['pixel_id'] ) {
1943
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1944
+ esc_html_e( 'You need to activate the Facebook pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1945
  echo '</p><br>' ;
1946
  }
1947
 
1966
  ?>
1967
  />
1968
  <?php
1969
+ esc_html_e( 'Enable Facebook product microdata output', 'woocommerce-google-adwords-conversion-tracking-tag' );
1970
  ?>
1971
  </label>
1972
  <?php
1976
 
1977
  if ( $this->options['facebook']['microdata'] && !$this->options['facebook']['pixel_id'] ) {
1978
  echo '<p></p><span class="dashicons dashicons-info"></span>' ;
1979
+ esc_html_e( 'You need to activate the Facebook pixel', 'woocommerce-google-adwords-conversion-tracking-tag' );
1980
  echo '</p><br>' ;
1981
  }
1982
 
1983
  }
1984
 
1985
+ public function wgact_option_html_google_ads_add_cart_data()
1986
+ {
1987
+ // adding the hidden input is a hack to make WordPress save the option with the value zero,
1988
+ // instead of not saving it and remove that array key entirely
1989
+ // https://stackoverflow.com/a/1992745/4688612
1990
+ ?>
1991
+ <label>
1992
+ <input type='hidden' value='0' name='wgact_plugin_options[google][ads][add_cart_data]'>
1993
+ <input type='checkbox' id='wgact_plugin_option_gads_add_cart_data'
1994
+ name='wgact_plugin_options[google][ads][add_cart_data]'
1995
+ value='1' <?php
1996
+ checked( $this->options['google']['ads']['add_cart_data'] );
1997
+ ?> />
1998
+ <?php
1999
+ esc_html_e( 'Add the cart data to the conversion event', 'woocommerce-google-adwords-conversion-tracking-tag' );
2000
+ ?>
2001
+ </label>
2002
+ <?php
2003
+ $this->get_status_icon_new( $this->options['google']['ads']['add_cart_data'], $this->add_to_cart_requirements_fulfilled() );
2004
+
2005
+ if ( !$this->add_to_cart_requirements_fulfilled() ) {
2006
+ ?>
2007
+ <p><span class="dashicons dashicons-info"></span>
2008
+ <?php
2009
+ esc_html_e( 'Requires an active Google Ads Conversion ID, an active Conversion Label and an active Google Merchant Center ID (aw_merchant_id)', 'woocommerce-google-adwords-conversion-tracking-tag' );
2010
+ ?>
2011
+ </p>
2012
+ <?php
2013
+ }
2014
+
2015
+ }
2016
+
2017
  public function wpm_setting_html_order_duplication_prevention()
2018
  {
2019
  // adding the hidden input is a hack to make WordPress save the option with the value zero,
2063
  ?>
2064
  </label>
2065
  <?php
2066
+ $this->get_status_icon_new( $this->options['general']['maximum_compatibility_mode'] );
2067
  $this->get_documentation_html_by_key( 'maximum_compatibility_mode' );
2068
  }
2069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2070
  private function get_order_duplication_prevention_text()
2071
  {
2072
  esc_html_e( 'Basic order duplication prevention is ', 'woocommerce-google-adwords-conversion-tracking-tag' );
2299
  esc_html_e( 'ID of your Google Merchant Center account. It looks like this: 12345678', 'woocommerce-google-adwords-conversion-tracking-tag' );
2300
  }
2301
 
2302
+ public function wgact_plugin_setting_aw_feed_country()
2303
+ {
2304
+ ?>
2305
+ <b><?php
2306
+ esc_html_e( $this->get_visitor_country() );
2307
+ ?></b>
2308
+ <div style="margin-top:10px">
2309
+ <?php
2310
+ esc_html_e( 'Currently the plugin automatically detects the location of the visitor for this setting. In most, if not all, cases this will work fine. Please let us know if you have a use case where you need another output:', 'woocommerce-google-adwords-conversion-tracking-tag' );
2311
+ ?>
2312
+ <a href="mailto:support@sweetcode.com">support@sweetcode.com</a>
2313
+ </div>
2314
+ <?php
2315
+ }
2316
+
2317
+ // dupe in pixel
2318
+ public function get_visitor_country()
2319
+ {
2320
+
2321
+ if ( $this->isLocalhost() ) {
2322
+ // error_log('check external ip');
2323
+ $this->ip = WC_Geolocation::get_external_ip_address();
2324
+ } else {
2325
+ // error_log('check regular ip');
2326
+ $this->ip = WC_Geolocation::get_ip_address();
2327
+ }
2328
+
2329
+ $location = WC_Geolocation::geolocate_ip( $this->ip );
2330
+ // error_log ('ip: ' . $this->>$ip);
2331
+ // error_log ('country: ' . $location['country']);
2332
+ return $location['country'];
2333
+ }
2334
+
2335
+ // dupe in pixel
2336
+ public function isLocalhost()
2337
+ {
2338
+ $_server = filter_input_array( INPUT_SERVER, FILTER_SANITIZE_STRING );
2339
+ return in_array( $_server['REMOTE_ADDR'], [ '127.0.0.1', '::1' ] );
2340
+ }
2341
+
2342
+ public function wgact_plugin_setting_aw_feed_language()
2343
+ {
2344
+ ?>
2345
+ <b><?php
2346
+ esc_html_e( $this->get_gmc_language() );
2347
+ ?></b>
2348
+ <div style="margin-top:10px">
2349
+ <?php
2350
+ esc_html_e( 'The plugin will use the WordPress default language for this setting. If the shop uses translations, in theory we could also use the visitors locale. But, if that language is not set up in the Google Merchant Center we might run into issues. If you need more options here let us know:', 'woocommerce-google-adwords-conversion-tracking-tag' );
2351
+ ?>
2352
+ <a href=\"mailto:support@sweetcode.com\">support@sweetcode.com</a>
2353
+ </div>
2354
+ <?php
2355
+ }
2356
+
2357
+ // dupe in pixel
2358
+ public function get_gmc_language()
2359
+ {
2360
+ return strtoupper( substr( get_locale(), 0, 2 ) );
2361
+ }
2362
+
2363
  public function wpm_plugin_option_product_identifier()
2364
  {
2365
  ?>
2611
 
2612
  if ( !$this->validations->is_facebook_pixel_id( $input['facebook']['pixel_id'] ) ) {
2613
  $input['facebook']['pixel_id'] = ( isset( $this->options['facebook']['pixel_id'] ) ? $this->options['facebook']['pixel_id'] : '' );
2614
+ add_settings_error( 'wgact_plugin_options', 'invalid-facebook-pixel-id', esc_html__( 'You have entered an invalid Facebook pixel ID. It only contains 14 to 16 digits.', 'woocommerce-google-adwords-conversion-tracking-tag' ) );
2615
  }
2616
 
2617
  }
2620
 
2621
  if ( !$this->validations->is_facebook_capi_token( $input['facebook']['capi']['token'] ) ) {
2622
  $input['facebook']['capi']['token'] = ( isset( $this->options['facebook']['capi']['token'] ) ? $this->options['facebook']['capi']['token'] : '' );
2623
+ add_settings_error( 'wgact_plugin_options', 'invalid-facebook-pixel-id', esc_html__( 'You have entered an invalid Facebook CAPI token.', 'woocommerce-google-adwords-conversion-tracking-tag' ) );
2624
  }
2625
 
2626
  }
2678
  }
2679
 
2680
  }
2681
+ // merging with the existing options
2682
+ // and overwriting old values
2683
+ // since disabling a checkbox doesn't send a value,
2684
+ // we need to set one to overwrite the old value
2685
+ $input = array_replace_recursive( $this->non_form_keys( $input ), $input );
2686
+ // error_log(print_r($input, true));
2687
+ // $input = $this->merge_options($this->options, $input);
2688
+ // error_log('input merged');
2689
+ // error_log(print_r($input, true));
2690
+ return $input;
2691
  }
2692
 
2693
  // Recursively go through the array and merge (overwrite old values with new ones
2727
  // but should be preserved
2728
  $non_form_keys = [
2729
  'db_version' => $this->options['db_version'],
 
 
 
2730
  ];
2731
  // in case the form field input is missing
2732
  // if (!array_key_exists('google_business_vertical', $input['google']['ads'])) {
classes/admin/class-ask-for-rating.php CHANGED
@@ -36,7 +36,7 @@ class Ask_For_Rating {
36
  // server side php ajax handler for the admin rating notice
37
  public function ajax_rating_notice_handler() {
38
 
39
- $_post = filter_input_array(INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
40
 
41
  $set = $_post['set'];
42
 
@@ -151,7 +151,7 @@ class Ask_For_Rating {
151
  <?php esc_html_e('I already did', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
152
  </a>
153
  </div>
154
- <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0; margin-right: 5px;align-self: flex-end;">
155
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
156
  target="_blank">
157
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
36
  // server side php ajax handler for the admin rating notice
37
  public function ajax_rating_notice_handler() {
38
 
39
+ $_post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
40
 
41
  $set = $_post['set'];
42
 
151
  <?php esc_html_e('I already did', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
152
  </a>
153
  </div>
154
+ <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0px; margin-right: 5px;align-self: flex-end;">
155
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
156
  target="_blank">
157
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
classes/admin/class-debug-info.php CHANGED
@@ -10,11 +10,9 @@ if (!defined('ABSPATH')) {
10
 
11
  class Debug_Info {
12
  protected $environment_check;
13
- protected $options;
14
 
15
- public function __construct( $options ) {
16
- $this->options = $options;
17
- $this->environment_check = new Environment_Check($this->options);
18
  }
19
 
20
  public function get_debug_info() {
@@ -90,7 +88,7 @@ class Debug_Info {
90
 
91
  // $html .= 'wc_get_page_permalink(\'checkout\'): ' . wc_get_page_permalink('checkout') . PHP_EOL;
92
 
93
- $html .= PHP_EOL . '## WooCommerce Payment Gateways ##' . PHP_EOL . PHP_EOL;
94
  $html .= 'Active payment gateways: ' . PHP_EOL;
95
 
96
  // $this->get_enabled_payment_gateways();
@@ -277,12 +275,12 @@ class Debug_Info {
277
  private function get_last_orders( $limit = 100 ) {
278
  // Get most recent order ids in date descending order.
279
  $query = new WC_Order_Query([
280
- 'limit' => $limit,
281
- 'type' => 'shop_order',
282
- 'orderby' => 'date',
283
- 'order' => 'DESC',
284
- 'return' => 'ids',
285
- ]);
286
 
287
  try {
288
  return $query->get_orders();
@@ -371,14 +369,14 @@ class Debug_Info {
371
 
372
  public function get_earliest_order_with_pixel_fired_tag( $order_ids, $limit ) {
373
  $query = new WC_Order_Query([
374
- 'limit' => $limit,
375
- // 'orderby' => 'date',
376
- // 'order' => 'DESC',
377
- 'type' => 'shop_order',
378
- 'return' => 'ids',
379
- 'post__in' => $order_ids,
380
- 'meta_key' => '_wpm_conversion_pixel_fired'
381
- ]);
382
 
383
  // error_log(print_r($query->get_orders(), true));
384
  // error_log('min: ' . min($query->get_orders()));
10
 
11
  class Debug_Info {
12
  protected $environment_check;
 
13
 
14
+ public function __construct() {
15
+ $this->environment_check = new Environment_Check();
 
16
  }
17
 
18
  public function get_debug_info() {
88
 
89
  // $html .= 'wc_get_page_permalink(\'checkout\'): ' . wc_get_page_permalink('checkout') . PHP_EOL;
90
 
91
+ $html .= PHP_EOL . '## WooCommerce Payment Gateways##' . PHP_EOL . PHP_EOL;
92
  $html .= 'Active payment gateways: ' . PHP_EOL;
93
 
94
  // $this->get_enabled_payment_gateways();
275
  private function get_last_orders( $limit = 100 ) {
276
  // Get most recent order ids in date descending order.
277
  $query = new WC_Order_Query([
278
+ 'limit' => $limit,
279
+ 'type' => 'shop_order',
280
+ 'orderby' => 'date',
281
+ 'order' => 'DESC',
282
+ 'return' => 'ids',
283
+ ]);
284
 
285
  try {
286
  return $query->get_orders();
369
 
370
  public function get_earliest_order_with_pixel_fired_tag( $order_ids, $limit ) {
371
  $query = new WC_Order_Query([
372
+ 'limit' => $limit,
373
+ // 'orderby' => 'date',
374
+ // 'order' => 'DESC',
375
+ 'type' => 'shop_order',
376
+ 'return' => 'ids',
377
+ 'post__in' => $order_ids,
378
+ 'meta_key' => '_wpm_conversion_pixel_fired'
379
+ ]);
380
 
381
  // error_log(print_r($query->get_orders(), true));
382
  // error_log('min: ' . min($query->get_orders()));
classes/admin/class-documentation.php CHANGED
@@ -10,121 +10,121 @@ class Documentation {
10
  protected $documentation_host;
11
 
12
  public function __construct() {
13
- $this->documentation_host = 'sweetcode.com';
14
  }
15
 
16
  public function get_link( $key = 'default' ) {
17
  $documentation_links = [
18
  'default' => [
19
- 'default' => '/docs/wpm/',
20
  'wcm' => '/'],
21
  'script_blockers' => [
22
- 'default' => '/docs/wpm/setup/script-blockers/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=script-blocker-error',
23
  'wcm' => '/'],
24
  'google_analytics_universal_property' => [
25
- 'default' => '/docs/wpm/plugin-configuration/google-analytics?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-property-id',
26
  'wcm' => '/'],
27
  'google_analytics_4_id' => [
28
- 'default' => '/docs/wpm/plugin-configuration/google-analytics#connect-an-existing-google-analytics-4-property?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-4-id',
29
  'wcm' => '/'],
30
  'google_ads_conversion_id' => [
31
- 'default' => '/docs/wpm/plugin-configuration/google-ads#configure-the-plugin?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-configure-the-plugin',
32
  'wcm' => '/'],
33
  'google_ads_conversion_label' => [
34
- 'default' => '/docs/wpm/plugin-configuration/google-ads#configure-the-plugin?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-configure-the-plugin',
35
  'wcm' => '/'],
36
  'google_optimize_container_id' => [
37
- 'default' => '/docs/wpm/plugin-configuration/google-optimize?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-optimize',
38
  'wcm' => '/'],
39
  'facebook_pixel_id' => [
40
- 'default' => '/docs/wpm/plugin-configuration/facebook#find-the-pixel-id?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-pixel-id',
41
  'wcm' => '/'],
42
  'bing_uet_tag_id' => [
43
- 'default' => '/docs/wpm/plugin-configuration/microsoft-advertising#setting-up-the-uet-tag?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=microsoft-advertising-uet-tag-id',
44
  'wcm' => '/'],
45
  'twitter_pixel_id' => [
46
- 'default' => '/docs/wpm/plugin-configuration/twitter',
47
  'wcm' => '/'],
48
  'pinterest_pixel_id' => [
49
- 'default' => '/docs/wpm/plugin-configuration/pinterest',
50
  'wcm' => '/'],
51
  'snapchat_pixel_id' => [
52
- 'default' => '/docs/wpm/plugin-configuration/snapchat',
53
  'wcm' => '/'],
54
  'tiktok_pixel_id' => [
55
- 'default' => '/docs/wpm/plugin-configuration/tiktok',
56
  'wcm' => '/'],
57
  'hotjar_site_id' => [
58
- 'default' => '/docs/wpm/plugin-configuration/hotjar#hotjar-site-id?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=hotjar-site-id',
59
  'wcm' => '/'],
60
  'google_gtag_deactivation' => [
61
- 'default' => '/docs/wpm/faq/#google-tag-assistant-reports-multiple-installations-of-global-site-tag-gtagjs-detected-what-shall-i-do&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=gtag-js',
62
  'wcm' => '/'],
63
  'google_consent_mode' => [
64
- 'default' => '/docs/wpm/consent-management/google-consent-mode?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode',
65
  'wcm' => '/'],
66
  'google_consent_regions' => [
67
- 'default' => '/docs/wpm/consent-management/google-consent-mode#regions?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode-regions',
68
  'wcm' => '/'],
69
  'google_analytics_eec' => [
70
- 'default' => '/docs/wpm/plugin-configuration/google-analytics#enhanced-e-commerce-funnel-setup',
71
  'wcm' => '/'],
72
  'google_analytics_4_api_secret' => [
73
- 'default' => '/docs/wpm/plugin-configuration/google-analytics#ga4-api-secret?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-4-api-secret',
74
  'wcm' => '/'],
75
  'google_ads_enhanced_conversions' => [
76
- 'default' => '/docs/wpm/plugin-configuration/google-ads#enhanced-conversions?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-enhanced-conversions',
77
  'wcm' => '/'],
78
  'google_ads_phone_conversion_number' => [
79
- 'default' => '/docs/wpm/plugin-configuration/google-ads#phone-conversion-number?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-phone-conversion-number',
80
  'wcm' => '/'],
81
  'google_ads_phone_conversion_label' => [
82
- 'default' => '/docs/wpm/plugin-configuration/google-ads#phone-conversion-number?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-phone-conversion-number',
83
  'wcm' => '/'],
84
  'explicit_consent_mode' => [
85
- 'default' => '/docs/wpm/consent-management/overview/#explicit-consent-mode',
86
  'wcm' => '/'],
87
  'facebook_capi_token' => [
88
- 'default' => '/docs/wpm/plugin-configuration/facebook#facebook-conversion-api-capi?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-token',
89
  'wcm' => '/'],
90
  'facebook_capi_user_transparency_process_anonymous_hits' => [
91
- 'default' => '/docs/wpm/plugin-configuration/facebook#user-transparency-settings?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-transparency-settings',
92
  'wcm' => '/'],
93
  'facebook_capi_user_transparency_send_additional_client_identifiers' => [
94
- 'default' => '/docs/wpm/plugin-configuration/facebook#user-transparency-settings?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-transparency-settings',
95
  'wcm' => '/'],
96
  'facebook_microdata' => [
97
- 'default' => '/docs/wpm/plugin-configuration/facebook#microdata-tags-for-catalogues?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-microdata',
98
  'wcm' => '/'],
99
  'maximum_compatibility_mode' => [
100
- 'default' => '/docs/wpm/plugin-configuration/general-settings/#maximum-compatibility-mode?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=maximum-compatibility-mode',
101
  'wcm' => '/'],
102
  'google_ads_dynamic_remarketing' => [
103
- 'default' => '/docs/wpm/plugin-configuration/dynamic-remarketing?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=dynamic-remarketing',
104
  'wcm' => '/'],
105
  'variations_output' => [
106
- 'default' => '/docs/wpm/plugin-configuration/dynamic-remarketing?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=dynamic-remarketing',
107
  'wcm' => '/'],
108
  'aw_merchant_id' => [
109
- 'default' => '/docs/wpm/plugin-configuration/google-ads/#conversion-cart-data?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=conversion-cart-data',
110
  'wcm' => '/'],
111
  'custom_thank_you' => [
112
- 'default' => '/docs/wpm/troubleshooting/#wc-custom-thank-you',
113
  'wcm' => '/'],
114
  'the_dismiss_button_doesnt_work_why' => [
115
- 'default' => '/docs/wpm/faq/#the-dismiss-button-doesnt-work-why?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=wpp-pixel-manager-docs&utm_content=dismiss-button-info',
116
  'wcm' => '/'],
117
  'wp-rocket-javascript-concatenation' => [
118
- 'default' => '/docs/wpm/troubleshooting?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=wp-rocket-javascript-concatenation-error',
119
  'wcm' => '/'],
120
  'litespeed-cache-inline-javascript-after-dom-ready' => [
121
- 'default' => '/docs/wpm/troubleshooting?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=litespeed-inline-js-dom-ready-error',
122
  'wcm' => '/'],
123
  'payment-gateways' => [
124
- 'default' => '/docs/wpm/setup/requirements#payment-gateways?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=paypal-standard-warning',
125
  'wcm' => '/'],
126
  'test_order' => [
127
- 'default' => '/docs/wpm/testing#test-order',
128
  'wcm' => '/'],
129
  ];
130
 
10
  protected $documentation_host;
11
 
12
  public function __construct() {
13
+ $this->documentation_host = 'docs.sweetcode.com';
14
  }
15
 
16
  public function get_link( $key = 'default' ) {
17
  $documentation_links = [
18
  'default' => [
19
+ 'default' => '/wgact/',
20
  'wcm' => '/'],
21
  'script_blockers' => [
22
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=script-blocker-error#/script-blockers',
23
  'wcm' => '/'],
24
  'google_analytics_universal_property' => [
25
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-property-id#/pixels/google-analytics',
26
  'wcm' => '/'],
27
  'google_analytics_4_id' => [
28
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-4-id#/pixels/google-analytics',
29
  'wcm' => '/'],
30
  'google_ads_conversion_id' => [
31
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-configure-the-plugin#/pixels/google-ads?id=configure-the-plugin',
32
  'wcm' => '/'],
33
  'google_ads_conversion_label' => [
34
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-configure-the_plugin#/pixels/google-ads?id=configure-the-plugin',
35
  'wcm' => '/'],
36
  'google_optimize_container_id' => [
37
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-optimize#/pixels/google-optimize',
38
  'wcm' => '/'],
39
  'facebook_pixel_id' => [
40
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-pixel-id#/pixels/facebook',
41
  'wcm' => '/'],
42
  'bing_uet_tag_id' => [
43
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=microsoft-advertising-uet-tag-id#/pixels/microsoft-advertising?id=setting-up-the-uet-tag',
44
  'wcm' => '/'],
45
  'twitter_pixel_id' => [
46
+ 'default' => '/wgact/#/twitter',
47
  'wcm' => '/'],
48
  'pinterest_pixel_id' => [
49
+ 'default' => '/wgact/#/pinterest',
50
  'wcm' => '/'],
51
  'snapchat_pixel_id' => [
52
+ 'default' => '/wgact/#/snapchat',
53
  'wcm' => '/'],
54
  'tiktok_pixel_id' => [
55
+ 'default' => '/wgact/#/tiktok',
56
  'wcm' => '/'],
57
  'hotjar_site_id' => [
58
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=hotjar-site-id#/pixels/hotjar',
59
  'wcm' => '/'],
60
  'google_gtag_deactivation' => [
61
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=gtag-js#/faq?id=google-tag-assistant-reports-multiple-installations-of-global-site-tag-gtagjs-detected-what-shall-i-do',
62
  'wcm' => '/'],
63
  'google_consent_mode' => [
64
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode#/consent-mgmt/google-consent-mode',
65
  'wcm' => '/'],
66
  'google_consent_regions' => [
67
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-consent-mode-regions#/consent-mgmt/google-consent-mode?id=regions',
68
  'wcm' => '/'],
69
  'google_analytics_eec' => [
70
+ 'default' => '/wgact/#/pixels/google-analytics?id=enhanced-e-commerce-funnel-setup',
71
  'wcm' => '/'],
72
  'google_analytics_4_api_secret' => [
73
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-analytics-4-api-secret#/pixels/google-analytics?id=ga4-api-secret',
74
  'wcm' => '/'],
75
  'google_ads_enhanced_conversions' => [
76
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-enhanced-conversions#/pixels/google-ads?id=enhanced-conversions',
77
  'wcm' => '/'],
78
  'google_ads_phone_conversion_number' => [
79
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-phone-conversion-number#/pixels/google-ads?id=phone-conversion-number',
80
  'wcm' => '/'],
81
  'google_ads_phone_conversion_label' => [
82
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=google-ads-phone-conversion-number#/pixels/google-ads?id=phone-conversion-number',
83
  'wcm' => '/'],
84
  'explicit_consent_mode' => [
85
+ 'default' => '/wgact/#/consent-mgmt/overview?id=explicit-consent-mode',
86
  'wcm' => '/'],
87
  'facebook_capi_token' => [
88
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-token#/pixels/facebook?id=facebook-conversion-api-capi',
89
  'wcm' => '/'],
90
  'facebook_capi_user_transparency_process_anonymous_hits' => [
91
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-transparency-settings#/pixels/facebook?id=user-transparency-settings',
92
  'wcm' => '/'],
93
  'facebook_capi_user_transparency_send_additional_client_identifiers' => [
94
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-capi-transparency-settings#/pixels/facebook?id=user-transparency-settings',
95
  'wcm' => '/'],
96
  'facebook_microdata' => [
97
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=facebook-microdata#/pixels/facebook?id=microdata-tags-for-catalogues',
98
  'wcm' => '/'],
99
  'maximum_compatibility_mode' => [
100
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=maximum-compatibility-mode#/general?id=maximum-compatibility-mode',
101
  'wcm' => '/'],
102
  'google_ads_dynamic_remarketing' => [
103
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=dynamic-remarketing#/dynamic-remarketing',
104
  'wcm' => '/'],
105
  'variations_output' => [
106
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=dynamic-remarketing#/dynamic-remarketing',
107
  'wcm' => '/'],
108
  'aw_merchant_id' => [
109
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=conversion-cart-data#/pixels/google-ads?id=conversion-cart-data',
110
  'wcm' => '/'],
111
  'custom_thank_you' => [
112
+ 'default' => '/wgact/#/troubleshooting?id=wc-custom-thank-you',
113
  'wcm' => '/'],
114
  'the_dismiss_button_doesnt_work_why' => [
115
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=wpp-pixel-manager-docs&utm_content=dismiss-button-info#/faq?id=the-dismiss-button-doesnt-work-why',
116
  'wcm' => '/'],
117
  'wp-rocket-javascript-concatenation' => [
118
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=wp-rocket-javascript-concatenation-error#/troubleshooting?id=wp-rocket-javascript-concatenation',
119
  'wcm' => '/'],
120
  'litespeed-cache-inline-javascript-after-dom-ready' => [
121
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=litespeed-inline-js-dom-ready-error#/troubleshooting?id=litespeed-cache-inline-javascript-after-dom-ready',
122
  'wcm' => '/'],
123
  'payment-gateways' => [
124
+ 'default' => '/wgact/?utm_source=woocommerce-plugin&utm_medium=documentation-link&utm_campaign=woocommerce-pixel-manager-docs&utm_content=paypal-standard-warning#/requirements?id=payment-gateways',
125
  'wcm' => '/'],
126
  'test_order' => [
127
+ 'default' => '/wgact/#/test-order',
128
  'wcm' => '/'],
129
  ];
130
 
classes/admin/class-environment-check.php CHANGED
@@ -11,13 +11,10 @@ class Environment_Check {
11
  public $notifications;
12
  private $documentation;
13
  private $order_redirect = null;
14
- private $options;
15
 
16
- public function __construct( $options ) {
17
  if (is_admin()) {
18
 
19
- $this->options = $options;
20
-
21
  $this->notifications = new Notifications();
22
  $this->documentation = new Documentation();
23
 
@@ -164,33 +161,25 @@ class Environment_Check {
164
 
165
  public function flush_flying_press_cache() {
166
  try {
167
- if (class_exists('\FlyingPress\Purge') && method_exists('\FlyingPress\Purge', 'purge_cached_pages')) {
168
- \FlyingPress\Purge::purge_cached_pages();
169
- }
170
 
171
- // /**
172
- // * Update config and flush cache
173
- // */
174
- // if (class_exists('\FlyingPress\Config') && class_exists('\FlyingPress\Purge')) {
175
- //
176
- // // This is the way to update the Flying Press settings.
177
- // // No other 'normal' way is possible.
178
- //
179
- // if (!is_array(\FlyingPress\Config::$config['js_defer_excludes'])) {
180
- // \FlyingPress\Config::$config['js_defer_excludes'] = [];
181
- // }
182
- //
183
- // \FlyingPress\Config::$config['js_defer_excludes'] = array_unique(array_merge(\FlyingPress\Config::$config['js_defer_excludes'], $this->get_wpm_script_identifiers()));
184
- //
185
- // if (
186
- // method_exists('\FlyingPress\Config', 'update_config') &&
187
- // method_exists('\FlyingPress\Purge', 'purge_cached_pages')
188
- // ) {
189
- // \FlyingPress\Config::update_config(\FlyingPress\Config::$config);
190
- // \FlyingPress\Purge::purge_cached_pages();
191
- // }
192
- // }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  } catch (\Exception $e) {
195
  error_log($e);
196
  }
@@ -340,7 +329,7 @@ class Environment_Check {
340
 
341
  public function ajax_environment_check_handler() {
342
 
343
- $_post = filter_input_array(INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
344
 
345
  if (isset($_post['set'])) {
346
 
@@ -594,7 +583,7 @@ class Environment_Check {
594
 
595
  public function is_hosting_cloudways() {
596
 
597
- $_server = filter_input_array(INPUT_SERVER, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
598
 
599
  return array_key_exists('cw_allowed_ip', $_server) || preg_match('~/home/.*?cloudways.*~', __FILE__);
600
  }
@@ -691,13 +680,115 @@ class Environment_Check {
691
  return 0;
692
  }
693
 
694
- // public function disable_wp_rocket_js_optimizations( $option ) {
695
- // $option['minify_concatenate_js'] = 0;
696
- //// $option['defer_all_js'] = 0;
697
- //// $option['delay_js'] = 0;
698
- // return $option;
699
- // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
 
702
  public function wp_optimize_minify_default_exclusions( $default_exclusions ) {
703
  // $default_exclusions[] = 'something/else.js';
@@ -769,7 +860,6 @@ class Environment_Check {
769
  }
770
 
771
  public function sg_optimizer_js_minify_exclude( $exclude_list ) {
772
-
773
  $exclude_list[] = 'wpm-front-end-scripts';
774
  $exclude_list[] = 'wpm-front-end-scripts-premium-only';
775
  $exclude_list[] = 'wpm';
@@ -793,7 +883,6 @@ class Environment_Check {
793
  }
794
 
795
  public function sgo_javascript_combine_exclude_move_after( $exclude_list ) {
796
-
797
  if (is_array($exclude_list)) {
798
  $exclude_list = array_unique(array_merge($exclude_list, $this->get_wpm_script_identifiers()));
799
  }
@@ -866,202 +955,17 @@ class Environment_Check {
866
  }
867
  }
868
 
869
- public function disable_third_party_js_optimization() {
870
-
871
- /**
872
- * SiteGround Optimizer
873
- */
874
-
875
- if ($this->is_sg_optimizer_active()) {
876
-
877
- /**
878
- * The function wpmFunctionExists needs to be excluded from combination from SGO.
879
- * Otherwise, it won't work on pages which include WPM shortcodes.
880
- * */
881
-
882
- add_filter('sgo_javascript_combine_excluded_inline_content', function ( $excluded_scripts ) {
883
- $excluded_scripts[] = 'wpmFunctionExists';
884
- return $excluded_scripts;
885
- });
886
-
887
- /**
888
- * SGO's defer feature doesn't queue jQuery correctly on some pages,
889
- * leading to errors "jQuery not defined" errors on several pages
890
- * and thus breaking tracking in those cases.
891
- *
892
- * Therefore, we need to exclude jquery-core from deferring.
893
- * */
894
-
895
- add_filter('sgo_js_async_exclude', function ( $excludes ) {
896
- $excludes[] = 'jquery-core';
897
- return $excludes;
898
- });
899
- }
900
-
901
- /**
902
- * Litespeed
903
- */
904
-
905
  if ($this->is_litespeed_active()) {
906
- add_filter('litespeed_optimize_js_excludes', function ( $excludes ) {
907
- if (is_array($excludes)) {
908
- $excludes[] = 'wpmFunctionExists';
909
- }
910
-
911
- return $excludes;
912
- });
913
  }
914
- }
915
-
916
- public function enable_compatibility_mode() {
917
-
918
- $this->compatibility_mode_yoast_seo();
919
-
920
- $this->compatibility_mode_prevent_third_party_js_optimization();
921
- }
922
-
923
- protected function compatibility_mode_prevent_third_party_js_optimization() {
924
-
925
- if ($this->is_wp_rocket_active()) {
926
- $this->disable_wp_rocket_js_optimization();
927
- }
928
-
929
- if ($this->is_flying_press_active()) {
930
- $this->disable_flying_press_js_optimization();
931
- }
932
-
933
- if ($this->is_optimocha_active()) {
934
- $this->disable_optimocha_js_optimization();
935
- }
936
-
937
- if ($this->is_wp_optimize_active()) {
938
- $this->disable_wp_optimize_js_optimization();
939
- }
940
-
941
- if ($this->is_async_javascript_active()) {
942
- $this->disable_async_javascript_js_optimization();
943
- }
944
-
945
- if ($this->is_sg_optimizer_active()) {
946
- $this->disable_sg_optimizer_js_optimization();
947
- }
948
-
949
- if ($this->is_litespeed_active()) {
950
- $this->disable_litespeed_js_optimization();
951
- }
952
-
953
- if ($this->is_autoptimize_active()) {
954
- $this->disable_autoptimze_js_optimization();
955
- }
956
- }
957
-
958
- protected function disable_sg_optimizer_js_optimization() {
959
-
960
- add_filter('sgo_javascript_combine_excluded_inline_content', [$this, 'sg_optimizer_js_exclude_combine_inline_content']);
961
- add_filter('sgo_javascript_combine_exclude', [$this, 'sgo_javascript_combine_exclude_move_after']);
962
- add_filter('sgo_javascript_combine_exclude_move_after', [$this, 'sgo_javascript_combine_exclude_move_after']);
963
- add_filter('sgo_js_minify_exclude', [$this, 'sg_optimizer_js_minify_exclude']);
964
- add_filter('sgo_js_async_exclude', [$this, 'sgo_javascript_combine_exclude_move_after']);
965
- }
966
 
967
- protected function disable_litespeed_js_optimization() {
968
- add_filter('litespeed_optimize_js_excludes', [$this, 'litespeed_optimize_js_excludes']);
969
- add_filter('litespeed_optm_js_defer_exc', [$this, 'litespeed_cache_js_defer_exc']);
970
- add_filter('litespeed_optm_cssjs', [$this, 'litespeed_optm_cssjs']);
971
- add_filter('option_litespeed.conf.optm-js_inline_defer', [$this, 'disable_litespeed_js_inline_after_dom']);
972
  }
973
 
974
- protected function disable_autoptimze_js_optimization() {
975
- add_filter('autoptimize_filter_js_consider_minified', [$this, 'autoptimize_filter_js_consider_minified']);
976
- add_filter('autoptimize_filter_js_dontmove', [$this, 'autoptimize_filter_js_dontmove']);
977
- }
978
-
979
- protected function disable_wp_optimize_js_optimization() {
980
- // add_filter('wpo_minify_inline_js', '__return_false');
981
- add_filter('wp-optimize-minify-default-exclusions', [$this, 'wp_optimize_minify_default_exclusions']);
982
- }
983
-
984
- protected function disable_async_javascript_js_optimization() {
985
- add_filter('option_aj_plugin_exclusions', function ( $options ) {
986
-
987
- if (!is_array($options)) {
988
- $options = [];
989
- }
990
-
991
- return array_unique(array_merge($options, [
992
- 'woocommerce-google-adwords-conversion-tracking-tag',
993
- 'woopt-pixel-manager-pro',
994
- 'woocommerce-pixel-manager',
995
- 'woocommerce-pixel-manager-pro',
996
- ]));
997
- });
998
- }
999
-
1000
- protected function disable_optimocha_js_optimization() {
1001
- add_filter('option_sbp_options', function ( $options ) {
1002
-
1003
- if (isset($options['js_exclude'])) {
1004
- $options['js_exclude'] = $options['js_exclude'] . PHP_EOL . implode(PHP_EOL, $this->get_wpm_script_identifiers());
1005
- $js_include = explode(PHP_EOL, $options['js_include']);
1006
- $js_include = array_filter($js_include, function ( $string ) {
1007
- foreach ($this->get_wpm_script_identifiers() as $value) {
1008
- if (strpos($string, $value) !== false) {
1009
- return false;
1010
- }
1011
- }
1012
-
1013
- return true;
1014
- });
1015
- $options['js_include'] = implode(PHP_EOL, $js_include);
1016
- }
1017
-
1018
- return $options;
1019
- });
1020
- }
1021
-
1022
- protected function disable_flying_press_js_optimization() {
1023
- add_filter('pre_update_option_FLYING_PRESS_CONFIG', function ( $options ) {
1024
-
1025
- if (isset($options['js_defer_excludes'])) {
1026
- $options['js_defer_excludes'] = array_unique(array_merge($options['js_defer_excludes'], $this->get_wpm_script_identifiers()));
1027
- }
1028
-
1029
- return $options;
1030
- });
1031
-
1032
- add_filter('option_FLYING_PRESS_CONFIG', function ( $options ) {
1033
-
1034
- if (isset($options['js_defer_excludes'])) {
1035
- $options['js_defer_excludes'] = array_unique(array_merge($options['js_defer_excludes'], $this->get_wpm_script_identifiers()));
1036
- }
1037
- return $options;
1038
- });
1039
-
1040
- // Make sure to never delay JS until interaction
1041
- // if ($this->is_flying_press_active()) {
1042
- // add_filter('option_FLYING_PRESS_CONFIG', function ( $options ) {
1043
- // if (isset($options['js_interaction'])) {
1044
- // $options['js_interaction'] = false;
1045
- // }
1046
- // return $options;
1047
- // });
1048
- // }
1049
- }
1050
-
1051
- protected function disable_wp_rocket_js_optimization() {
1052
- // for testing you need to clear the WP Rocket cache, only then the filters run
1053
- $this->exclude_inline_scripts_from_wp_rocket_using_options();
1054
- add_filter('rocket_delay_js_exclusions', [$this, 'add_wp_rocket_exclusions']);
1055
- add_filter('rocket_defer_inline_exclusions', [$this, 'add_wp_rocket_exclusions']);
1056
- add_filter('rocket_exclude_defer_js', [$this, 'add_wp_rocket_exclusions']);
1057
- add_filter('rocket_exclude_js', [$this, 'add_wp_rocket_exclusions']);
1058
- add_filter('rocket_minify_excluded_external_js', [$this, 'add_wp_rocket_exclusions']);
1059
- add_filter('rocket_excluded_inline_js_content', [$this, 'add_wp_rocket_exclusions']);
1060
- }
1061
-
1062
- public function compatibility_mode_yoast_seo() {
1063
-
1064
- if ($this->is_yoast_seo_active() && isset($this->options['facebook']['microdata']) && $this->options['facebook']['microdata']) {
1065
  add_filter('option_wpseo_social', [$this, 'disable_yoast_seo_facebook_social']);
1066
  }
1067
  }
@@ -1070,7 +974,6 @@ class Environment_Check {
1070
  return [
1071
  'optimize.js',
1072
  'googleoptimize.com/optimize.js',
1073
- 'jquery',
1074
  'jQuery',
1075
  'jQuery.min.js',
1076
  'jquery.js',
@@ -1156,8 +1059,7 @@ class Environment_Check {
1156
 
1157
  // https://stackoverflow.com/questions/8429342/php-get-headers-set-temporary-stream-context
1158
  protected function get_headers_with_stream_context( $url, $context, $assoc = 0 ) {
1159
-
1160
- $fp = @fopen($url, 'r', null, $context);
1161
 
1162
  if (!is_bool($fp)) {
1163
 
11
  public $notifications;
12
  private $documentation;
13
  private $order_redirect = null;
 
14
 
15
+ public function __construct() {
16
  if (is_admin()) {
17
 
 
 
18
  $this->notifications = new Notifications();
19
  $this->documentation = new Documentation();
20
 
161
 
162
  public function flush_flying_press_cache() {
163
  try {
164
+ if (class_exists('\FlyingPress\Config') && class_exists('\FlyingPress\Purge')) {
 
 
165
 
166
+ // This is the way to update the Flying Press settings.
167
+ // No other 'normal' way is possible.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
+ if (!is_array(\FlyingPress\Config::$config['js_defer_excludes'])) {
170
+ \FlyingPress\Config::$config['js_defer_excludes'] = [];
171
+ }
172
+
173
+ \FlyingPress\Config::$config['js_defer_excludes'] = array_unique(array_merge(\FlyingPress\Config::$config['js_defer_excludes'], $this->get_wpm_script_identifiers()));
174
+
175
+ if (
176
+ method_exists('\FlyingPress\Config', 'update_config') &&
177
+ method_exists('\FlyingPress\Purge', 'purge_cached_pages')
178
+ ) {
179
+ \FlyingPress\Config::update_config(\FlyingPress\Config::$config);
180
+ \FlyingPress\Purge::purge_cached_pages();
181
+ }
182
+ }
183
  } catch (\Exception $e) {
184
  error_log($e);
185
  }
329
 
330
  public function ajax_environment_check_handler() {
331
 
332
+ $_post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
333
 
334
  if (isset($_post['set'])) {
335
 
583
 
584
  public function is_hosting_cloudways() {
585
 
586
+ $_server = filter_input_array(INPUT_SERVER, FILTER_SANITIZE_STRING);
587
 
588
  return array_key_exists('cw_allowed_ip', $_server) || preg_match('~/home/.*?cloudways.*~', __FILE__);
589
  }
680
  return 0;
681
  }
682
 
683
+ public function disable_wp_rocket_js_optimizations( $option ) {
684
+ $option['minify_concatenate_js'] = 0;
685
+ // $option['defer_all_js'] = 0;
686
+ // $option['delay_js'] = 0;
687
+ return $option;
688
+ }
689
+
690
+ public function permanent_compatibility_mode() {
691
+ if ($this->is_wp_rocket_active()) {
692
+ $this->exclude_inline_scripts_from_wp_rocket_using_options();
693
+ }
694
+
695
+ // for testing you need to clear the WP Rocket cache, only then the filters run
696
+ if ($this->is_wp_rocket_active()) {
697
+ add_filter('rocket_delay_js_exclusions', [$this, 'add_wp_rocket_exclusions']);
698
+ add_filter('rocket_defer_inline_exclusions', [$this, 'add_wp_rocket_exclusions']);
699
+ add_filter('rocket_exclude_defer_js', [$this, 'add_wp_rocket_exclusions']);
700
+ add_filter('rocket_exclude_js', [$this, 'add_wp_rocket_exclusions']);
701
+ add_filter('rocket_minify_excluded_external_js', [$this, 'add_wp_rocket_exclusions']);
702
+ add_filter('rocket_excluded_inline_js_content', [$this, 'add_wp_rocket_exclusions']);
703
+ }
704
+
705
+ if ($this->is_sg_optimizer_active()) {
706
+ add_filter('sgo_javascript_combine_excluded_inline_content', [$this, 'sg_optimizer_js_exclude_combine_inline_content']);
707
+ add_filter('sgo_js_minify_exclude', [$this, 'sg_optimizer_js_minify_exclude']);
708
+ add_filter('sgo_javascript_combine_exclude_move_after', [$this, 'sgo_javascript_combine_exclude_move_after']);
709
+ }
710
+
711
+ if ($this->is_litespeed_active()) {
712
+ add_filter('litespeed_optm_js_defer_exc', [$this, 'litespeed_cache_js_defer_exc']);
713
+ add_filter('litespeed_optimize_js_excludes', [$this, 'litespeed_optimize_js_excludes']);
714
+ add_filter('litespeed_optm_cssjs', [$this, 'litespeed_optm_cssjs']);
715
+ // add_filter('option_litespeed.conf.optm-js_inline_defer', [$this, 'disable_litespeed_js_inline_after_dom']);
716
+
717
+ // litespeed_optm_cssjs
718
+ // litespeed_optm_html_head
719
+ }
720
+
721
+ if ($this->is_autoptimize_active()) {
722
+ add_filter('autoptimize_filter_js_consider_minified', [$this, 'autoptimize_filter_js_consider_minified']);
723
+ add_filter('autoptimize_filter_js_dontmove', [$this, 'autoptimize_filter_js_dontmove']);
724
+ }
725
+
726
+ if ($this->is_wp_optimize_active()) {
727
+ // add_filter('wpo_minify_inline_js', '__return_false');
728
+ add_filter('wp-optimize-minify-default-exclusions', [$this, 'wp_optimize_minify_default_exclusions']);
729
+ }
730
+
731
+ if ($this->is_optimocha_active()) {
732
+ add_filter('option_sbp_options', function ( $options ) {
733
+
734
+ $options['js_exclude'] = $options['js_exclude'] . PHP_EOL . implode(PHP_EOL, $this->get_wpm_script_identifiers());
735
+
736
+ $js_include = explode(PHP_EOL, $options['js_include']);
737
+
738
+ $js_include = array_filter($js_include, function ( $string ) {
739
+ foreach ($this->get_wpm_script_identifiers() as $value) {
740
+ if (strpos($string, $value) !== false) {
741
+ return false;
742
+ }
743
+ }
744
 
745
+ return true;
746
+ });
747
+
748
+ $options['js_include'] = implode(PHP_EOL, $js_include);
749
+
750
+ return $options;
751
+ });
752
+ }
753
+
754
+ if ($this->is_async_javascript_active()) {
755
+
756
+ // add_filter('option_aj_exclusions', function ($options) {
757
+ // $options = explode(',', $options);
758
+ // $options = array_unique(array_merge($options, $this->get_wpm_script_identifiers()));
759
+ // return implode(',', $options);
760
+ // });
761
+
762
+ add_filter('option_aj_plugin_exclusions', function ( $options ) {
763
+
764
+ if (!is_array($options)) {
765
+ $options = [];
766
+ }
767
+
768
+ return array_unique(array_merge($options, [
769
+ 'woocommerce-google-adwords-conversion-tracking-tag',
770
+ 'woopt-pixel-manager-pro',
771
+ 'woocommerce-pixel-manager',
772
+ 'woocommerce-pixel-manager-pro',
773
+ ]));
774
+ });
775
+ }
776
+
777
+ if ($this->is_flying_press_active()) {
778
+
779
+ add_filter('pre_update_option_FLYING_PRESS_CONFIG', function ( $options ) {
780
+
781
+ $options['js_defer_excludes'] = array_unique(array_merge($options['js_defer_excludes'], $this->get_wpm_script_identifiers()));
782
+ return $options;
783
+ });
784
+
785
+ add_filter('option_FLYING_PRESS_CONFIG', function ( $options ) {
786
+
787
+ $options['js_defer_excludes'] = array_unique(array_merge($options['js_defer_excludes'], $this->get_wpm_script_identifiers()));
788
+ return $options;
789
+ });
790
+ }
791
+ }
792
 
793
  public function wp_optimize_minify_default_exclusions( $default_exclusions ) {
794
  // $default_exclusions[] = 'something/else.js';
860
  }
861
 
862
  public function sg_optimizer_js_minify_exclude( $exclude_list ) {
 
863
  $exclude_list[] = 'wpm-front-end-scripts';
864
  $exclude_list[] = 'wpm-front-end-scripts-premium-only';
865
  $exclude_list[] = 'wpm';
883
  }
884
 
885
  public function sgo_javascript_combine_exclude_move_after( $exclude_list ) {
 
886
  if (is_array($exclude_list)) {
887
  $exclude_list = array_unique(array_merge($exclude_list, $this->get_wpm_script_identifiers()));
888
  }
955
  }
956
  }
957
 
958
+ public function enable_maximum_compatibility_mode() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
959
  if ($this->is_litespeed_active()) {
960
+ add_filter('option_litespeed.conf.optm-js_inline_defer', [$this, 'disable_litespeed_js_inline_after_dom']);
 
 
 
 
 
 
961
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
 
963
+ // disabling WP Rocket js optimizations not necessary here, since we add permanent script specific exclusions
964
+ // if ($this->is_wp_rocket_active()) add_filter('option_wp_rocket_settings', [$this, 'disable_wp_rocket_js_optimizations']);
 
 
 
965
  }
966
 
967
+ public function enable_maximum_compatibility_mode_yoast_seo() {
968
+ if ($this->is_yoast_seo_active()) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
969
  add_filter('option_wpseo_social', [$this, 'disable_yoast_seo_facebook_social']);
970
  }
971
  }
974
  return [
975
  'optimize.js',
976
  'googleoptimize.com/optimize.js',
 
977
  'jQuery',
978
  'jQuery.min.js',
979
  'jquery.js',
1059
 
1060
  // https://stackoverflow.com/questions/8429342/php-get-headers-set-temporary-stream-context
1061
  protected function get_headers_with_stream_context( $url, $context, $assoc = 0 ) {
1062
+ $fp = fopen($url, 'r', null, $context);
 
1063
 
1064
  if (!is_bool($fp)) {
1065
 
classes/admin/class-notifications.php CHANGED
@@ -125,7 +125,7 @@ class Notifications {
125
  <div id="wpm-paypal-standard-error-dismissal-button" class="button" style="white-space:normal;">
126
  <?php esc_html_e('Click here to dismiss this warning forever', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
127
  </div>
128
- <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0; margin-right: 5px;align-self: flex-end;">
129
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
130
  target="_blank">
131
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
@@ -174,7 +174,7 @@ class Notifications {
174
  data-plugin-slug="<?php echo esc_js($slug); ?>">
175
  <?php esc_html_e('Click here to dismiss this warning forever', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
176
  </div>
177
- <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0; margin-right: 5px;align-self: flex-end;">
178
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
179
  target="_blank">
180
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
125
  <div id="wpm-paypal-standard-error-dismissal-button" class="button" style="white-space:normal;">
126
  <?php esc_html_e('Click here to dismiss this warning forever', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
127
  </div>
128
+ <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0px; margin-right: 5px;align-self: flex-end;">
129
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
130
  target="_blank">
131
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
174
  data-plugin-slug="<?php echo esc_js($slug); ?>">
175
  <?php esc_html_e('Click here to dismiss this warning forever', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
176
  </div>
177
+ <div style="white-space:normal; bottom:0; right: 0; margin-bottom: 0px; margin-right: 5px;align-self: flex-end;">
178
  <a href="<?php echo esc_url(( new Documentation() )->get_link('the_dismiss_button_doesnt_work_why')); ?>"
179
  target="_blank">
180
  <?php esc_html_e('If the dismiss button is not working, here\'s why >>', 'woocommerce-google-adwords-conversion-tracking-tag'); ?>
classes/class-default-options.php CHANGED
@@ -77,18 +77,14 @@ class Default_Options {
77
  'site_id' => ''
78
  ],
79
  'shop' => [
80
- 'order_total_logic' => 0,
81
- 'cookie_consent_mgmt' => [
82
- 'cookiebot' => [ // This Cookiebot setting is deprecated. Not in use anymore.
83
- 'active' => 0
84
  ],
85
  'explicit_consent' => 0,
86
  ],
87
- 'order_deduplication' => 1,
88
- 'disable_tracking_for' => [
89
- 'administrator',
90
- 'shop_manager',
91
- ],
92
  ],
93
  'general' => [
94
  'variations_output' => 1,
@@ -99,49 +95,17 @@ class Default_Options {
99
  ];
100
  }
101
 
102
- public function update_with_defaults( $target_array, $default_array ) {
103
-
104
- // error_log(print_r($target_array, true));
105
-
106
- // Walk through every key in the default array
107
- foreach ($default_array as $default_key => $default_value) {
108
-
109
- // If the target key doesn't exist yet
110
- // copy all default values,
111
- // including the subtree if one exists,
112
- // into the target array.
113
- if (!isset($target_array[$default_key])) {
114
- $target_array[$default_key] = $default_value;
115
-
116
- // We only want to keep going down the tree
117
- // if the array contains more settings in an associative array,
118
- // otherwise we keep the settings of what's in the target array.
119
- } elseif ($this->is_associative_array($default_value)) {
120
-
121
- $target_array[$default_key] = $this->update_with_defaults($target_array[$default_key], $default_value);
122
  }
123
  }
124
 
125
- // error_log(print_r($target_array, true));
126
- return $target_array;
127
- }
128
-
129
- protected function does_contain_nested_arrays( $array ) {
130
-
131
- foreach ($array as $key) {
132
- if (is_array($key)) {
133
- return true;
134
- }
135
- }
136
-
137
- return false;
138
- }
139
-
140
- protected function is_associative_array( $array ) {
141
- if (is_array($array)) {
142
- return ( array_values($array) !== $array );
143
- } else {
144
- return false;
145
- }
146
  }
147
  }
77
  'site_id' => ''
78
  ],
79
  'shop' => [
80
+ 'order_total_logic' => 0,
81
+ 'cookie_consent_mgmt' => [
82
+ 'cookiebot' => [
83
+ 'active' => 0
84
  ],
85
  'explicit_consent' => 0,
86
  ],
87
+ 'order_deduplication' => 1
 
 
 
 
88
  ],
89
  'general' => [
90
  'variations_output' => 1,
95
  ];
96
  }
97
 
98
+ public function update_with_defaults( $array_input, $array_default ) {
99
+ foreach ($array_default as $key => $value) {
100
+ if (array_key_exists($key, $array_input)) {
101
+ if (is_array($value)) {
102
+ $array_input[$key] = $this->update_with_defaults($array_input[$key], $value);
103
+ }
104
+ } else {
105
+ $array_input[$key] = $value;
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  }
108
 
109
+ return $array_input;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  }
classes/pixels/class-cookie-consent-management.php CHANGED
@@ -88,7 +88,7 @@ class Cookie_Consent_Management {
88
  // return the cookie contents, if the cookie is set
89
  public function get_cookie( $cookie_name ) {
90
 
91
- $_cookie = filter_input_array(INPUT_COOKIE, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
92
 
93
  return $_cookie[$cookie_name] ? $_cookie[$cookie_name] : null;
94
  }
@@ -121,7 +121,7 @@ class Cookie_Consent_Management {
121
  // https://wordpress.org/plugins/gdpr-cookie-compliance/
122
  public function is_moove_cookie_prevention_active() {
123
 
124
- $_cookie = filter_input_array(INPUT_COOKIE, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
125
 
126
  if (isset($_cookie['moove_gdpr_popup'])) {
127
 
88
  // return the cookie contents, if the cookie is set
89
  public function get_cookie( $cookie_name ) {
90
 
91
+ $_cookie = filter_input_array(INPUT_COOKIE, FILTER_SANITIZE_STRING);
92
 
93
  return $_cookie[$cookie_name] ? $_cookie[$cookie_name] : null;
94
  }
121
  // https://wordpress.org/plugins/gdpr-cookie-compliance/
122
  public function is_moove_cookie_prevention_active() {
123
 
124
+ $_cookie = filter_input_array(INPUT_COOKIE, FILTER_SANITIZE_STRING);
125
 
126
  if (isset($_cookie['moove_gdpr_popup'])) {
127
 
classes/pixels/class-pixel-manager.php CHANGED
@@ -2,46 +2,56 @@
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
 
 
 
 
5
  use WCPM\Classes\Pixels\Facebook\Facebook_Pixel_Manager ;
6
  use WCPM\Classes\Pixels\Facebook\Facebook_Pixel_Manager_Microdata ;
7
- use WCPM\Classes\Pixels\Google\Google ;
8
  use WCPM\Classes\Pixels\Google\Google_Analytics_Refund ;
9
  use WCPM\Classes\Pixels\Google\Google_Pixel_Manager ;
 
 
 
 
 
 
10
 
11
  if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  // Exit if accessed directly
14
  }
15
 
16
- class Pixel_Manager extends Script_Manager
17
  {
18
  use Trait_Product ;
 
19
  use Trait_Shop ;
20
  protected $options ;
21
  protected $options_obj ;
22
  protected $cart ;
23
  protected $facebook_active ;
24
  protected $google_active ;
25
- protected $dyn_r_ids ;
26
  protected $transaction_deduper_timeout = 1000 ;
 
 
27
  protected $position = 1 ;
28
- protected $google ;
29
  public function __construct( $options )
30
  {
31
- /**
32
  * Initialize options
33
  */
 
34
  $this->options = $options;
35
  $this->options_obj = json_decode( wp_json_encode( $this->options ) );
 
36
  $this->options_obj->shop->currency = get_woocommerce_currency();
37
- /**
38
  * Set a few states
39
  */
40
  $this->facebook_active = !empty($this->options_obj->facebook->pixel_id);
41
- // $this->google_active = $this->google_active();
42
- $this->google = new Google( $this->options );
43
- $this->google_active = $this->google->google_active();
44
- /**
45
  * Inject pixel snippets in head
46
  */
47
  // add_action('wp_head', function () {
@@ -49,9 +59,12 @@ class Pixel_Manager extends Script_Manager
49
  // });
50
  add_action( 'wp_head', function () {
51
  $this->inject_wpm_opening();
52
- $this->inject_data_layer();
 
 
 
53
  } );
54
- /**
55
  * Initialize all pixels
56
  */
57
  if ( $this->google_active ) {
@@ -60,6 +73,9 @@ class Pixel_Manager extends Script_Manager
60
  if ( $this->facebook_active ) {
61
  new Facebook_Pixel_Manager( $this->options );
62
  }
 
 
 
63
  add_action( 'wp_head', function () {
64
  $this->inject_wpm_closing();
65
  // if( isset(WC()->session)) {
@@ -67,28 +83,17 @@ class Pixel_Manager extends Script_Manager
67
  // error_log(print_r(WC()->session,true));
68
  // }
69
  } );
70
- /**
71
  * Front-end script section
72
  */
73
- if ( $this->track_user() ) {
74
- add_action( 'wp_enqueue_scripts', [ $this, 'wpm_front_end_scripts' ] );
75
- }
76
  add_action( 'wp_ajax_wpm_get_cart_items', [ $this, 'ajax_wpm_get_cart_items' ] );
77
  add_action( 'wp_ajax_nopriv_wpm_get_cart_items', [ $this, 'ajax_wpm_get_cart_items' ] );
78
  add_action( 'wp_ajax_wpm_get_product_ids', [ $this, 'ajax_wpm_get_product_ids' ] );
79
  add_action( 'wp_ajax_nopriv_wpm_get_product_ids', [ $this, 'ajax_wpm_get_product_ids' ] );
80
  add_action( 'wp_ajax_wpm_purchase_pixels_fired', [ $this, 'ajax_purchase_pixels_fired_handler' ] );
81
  add_action( 'wp_ajax_nopriv_wpm_purchase_pixels_fired', [ $this, 'ajax_purchase_pixels_fired_handler' ] );
82
- // Experimental filter ! Can be removed without further notification
83
- if ( apply_filters( 'wpm_experimental_defer_scripts', false ) ) {
84
- add_filter(
85
- 'script_loader_tag',
86
- [ $this, 'experimental_defer_scripts' ],
87
- 10,
88
- 2
89
- );
90
- }
91
- /**
92
  * Inject pixel snippets after <body> tag
93
  */
94
  if ( did_action( 'wp_body_open' ) ) {
@@ -96,11 +101,11 @@ class Pixel_Manager extends Script_Manager
96
  $this->inject_body_pixels();
97
  } );
98
  }
99
- /**
100
  * Inject pixel snippets into wp_footer
101
  */
102
  add_action( 'wp_footer', [ $this, 'wpm_wp_footer' ] );
103
- /**
104
  * Process short codes
105
  */
106
  new Shortcodes( $this->options );
@@ -133,16 +138,6 @@ class Pixel_Manager extends Script_Manager
133
  add_action( 'woocommerce_mini_cart_contents', [ $this, 'woocommerce_mini_cart_contents' ] );
134
  }
135
 
136
- // Thanks to: https://gist.github.com/mishterk/6b7a4d6e5a91086a5a9b05ace304b5ce#file-mark-wordpress-scripts-as-async-or-defer-php
137
- public function experimental_defer_scripts( $tag, $handle )
138
- {
139
- if ( 'wpm' !== $handle ) {
140
- return $tag;
141
- }
142
- return str_replace( ' src', ' defer src', $tag );
143
- // defer the script
144
- }
145
-
146
  public function woocommerce_mini_cart_contents()
147
  {
148
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
@@ -158,7 +153,7 @@ class Pixel_Manager extends Script_Manager
158
  ];
159
  ?>
160
  <script>
161
- window.wpmDataLayer.cartItemKeys = window.wpmDataLayer.cartItemKeys || {}
162
  window.wpmDataLayer.cartItemKeys['<?php
163
  echo esc_js( $cart_item_key ) ;
164
  ?>'] = <?php
@@ -169,6 +164,25 @@ class Pixel_Manager extends Script_Manager
169
  <?php
170
  }
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  // on product page
173
  public function woocommerce_inject_product_data_on_product_page()
174
  {
@@ -238,15 +252,36 @@ class Pixel_Manager extends Script_Manager
238
  }
239
 
240
  // https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-specific-JavaScripts-
241
- private function inject_data_layer()
242
  {
 
 
 
 
 
 
 
 
 
 
 
 
243
  ?>
244
 
245
- <script>
 
 
 
 
 
 
 
 
 
246
 
247
- window.wpmDataLayer = window.wpmDataLayer || {}
248
  window.wpmDataLayer = <?php
249
- echo wp_json_encode( $this->get_data_for_data_layer() ) ;
250
  ?>;
251
 
252
  </script>
@@ -254,199 +289,6 @@ class Pixel_Manager extends Script_Manager
254
  <?php
255
  }
256
 
257
- protected function get_data_for_data_layer()
258
- {
259
- $data = [
260
- 'cart' => (object) [],
261
- 'cart_item_keys' => (object) [],
262
- 'orderDeduplication' => $this->options['shop']['order_deduplication'] && !$this->is_nodedupe_parameter_set(),
263
- 'position' => 1,
264
- 'viewItemListTrigger' => $this->view_item_list_trigger_settings(),
265
- 'version' => [
266
- 'number' => WPM_CURRENT_VERSION,
267
- 'pro' => wpm_fs()->is__premium_only(),
268
- ],
269
- ];
270
- $data['pixels'] = [
271
- 'bing' => [
272
- 'uet_tag_id' => $this->options_obj->bing->uet_tag_id,
273
- 'dynamic_remarketing' => [
274
- 'id_type' => $this->get_dyn_r_id_type( 'bing' ),
275
- ],
276
- ],
277
- 'facebook' => [
278
- 'pixel_id' => $this->options_obj->facebook->pixel_id,
279
- 'dynamic_remarketing' => [
280
- 'id_type' => $this->get_dyn_r_id_type( 'facebook' ),
281
- ],
282
- 'capi' => (bool) $this->options_obj->facebook->capi->token,
283
- ],
284
- 'google' => [
285
- 'ads' => [
286
- 'conversionIds' => (object) $this->google->get_google_ads_conversion_ids( is_order_received_page() ),
287
- 'dynamic_remarketing' => [
288
- 'status' => (bool) $this->options_obj->google->ads->dynamic_remarketing,
289
- 'id_type' => $this->get_dyn_r_id_type( 'google' ),
290
- 'send_events_with_parent_ids' => apply_filters( 'wpm_send_events_with_parent_ids', apply_filters_deprecated(
291
- 'wooptpm_send_events_with_parent_ids',
292
- [ true ],
293
- '1.13.0',
294
- 'wpm_send_events_with_parent_ids'
295
- ) ),
296
- ],
297
- 'google_business_vertical' => $this->google->get_google_business_vertical( $this->options['google']['ads']['google_business_vertical'] ),
298
- 'phone_conversion_label' => $this->options_obj->google->ads->phone_conversion_label,
299
- 'phone_conversion_number' => $this->options_obj->google->ads->phone_conversion_number,
300
- ],
301
- 'analytics' => [
302
- 'universal' => [
303
- 'property_id' => $this->options_obj->google->analytics->universal->property_id,
304
- 'parameters' => (object) $this->google->get_ga_ua_parameters( $this->options_obj->google->analytics->universal->property_id ),
305
- 'mp_active' => wpm_fs()->is__premium_only(),
306
- ],
307
- 'ga4' => [
308
- 'measurement_id' => $this->options_obj->google->analytics->ga4->measurement_id,
309
- 'parameters' => (object) $this->google->get_ga4_parameters( $this->options_obj->google->analytics->ga4->measurement_id ),
310
- 'mp_active' => $this->options_obj->google->analytics->ga4->api_secret && wpm_fs()->is__premium_only(),
311
- ],
312
- 'id_type' => $this->google->get_ga_id_type(),
313
- 'eec' => (bool) $this->options_obj->google->analytics->eec,
314
- ],
315
- 'optimize' => [
316
- 'container_id' => $this->options_obj->google->optimize->container_id,
317
- ],
318
- 'linker' => [
319
- 'settings' => $this->google->get_google_linker_settings(),
320
- ],
321
- 'user_id' => (bool) $this->options_obj->google->user_id,
322
- ],
323
- 'hotjar' => [
324
- 'site_id' => $this->options_obj->hotjar->site_id,
325
- ],
326
- 'pinterest' => [
327
- 'pixel_id' => $this->options_obj->pinterest->pixel_id,
328
- 'dynamic_remarketing' => [
329
- 'id_type' => $this->get_dyn_r_id_type( 'pinterest' ),
330
- ],
331
- 'enhanced_match' => apply_filters( 'wpm_pinterest_enhanced_match', apply_filters_deprecated(
332
- 'wooptpm_pinterest_enhanced_match',
333
- [ false ],
334
- '1.13.0',
335
- 'wpm_pinterest_enhanced_match'
336
- ) ),
337
- 'enhanced_match_email' => $this->get_user_email(),
338
- ],
339
- 'snapchat' => [
340
- 'pixel_id' => $this->options_obj->snapchat->pixel_id,
341
- 'dynamic_remarketing' => [
342
- 'id_type' => $this->get_dyn_r_id_type( 'snapchat' ),
343
- ],
344
- ],
345
- 'tiktok' => [
346
- 'pixel_id' => $this->options_obj->tiktok->pixel_id,
347
- 'dynamic_remarketing' => [
348
- 'id_type' => $this->get_dyn_r_id_type( 'tiktok' ),
349
- ],
350
- 'purchase_event_name' => apply_filters( 'wpm_tiktok_purchase_event_name', 'PlaceAnOrder' ),
351
- ],
352
- 'twitter' => [
353
- 'pixel_id' => $this->options_obj->twitter->pixel_id,
354
- 'dynamic_remarketing' => [
355
- 'id_type' => $this->get_dyn_r_id_type( 'twitter' ),
356
- ],
357
- ],
358
- ];
359
- $data = array_merge( $data, $this->get_order_data() );
360
- $data['shop'] = $this->get_shop_data();
361
- $data['general'] = $this->get_general_data();
362
- $data['user'] = $this->get_user_data();
363
- // Return and optionally modify the wpm data layer
364
- return apply_filters( 'wpm_experimental_data_layer', $data );
365
- }
366
-
367
- protected function get_order_data()
368
- {
369
- if ( !is_order_received_page() ) {
370
- return [];
371
- }
372
- $order = $this->get_order_from_order_received_page();
373
- if ( $order && !$this->can_order_confirmation_be_processed( $order ) ) {
374
- return [];
375
- }
376
- $data = [];
377
-
378
- if ( $order ) {
379
- $data['order'] = [
380
- 'id' => (int) $order->get_id(),
381
- 'number' => (string) $order->get_order_number(),
382
- 'affiliation' => (string) get_bloginfo( 'name' ),
383
- 'currency' => (string) $this->get_order_currency( $order ),
384
- 'value_filtered' => (double) $this->wpm_get_order_total( $order ),
385
- 'value_regular' => (double) $order->get_total(),
386
- 'discount' => (double) $order->get_total_discount(),
387
- 'tax' => (double) $order->get_total_tax(),
388
- 'shipping' => (double) $order->get_shipping_total(),
389
- 'coupon' => implode( ',', $order->get_coupon_codes() ),
390
- 'aw_merchant_id' => ( (int) $this->options['google']['ads']['aw_merchant_id'] ? (int) $this->options['google']['ads']['aw_merchant_id'] : '' ),
391
- 'aw_feed_country' => (string) $this->get_visitor_country(),
392
- 'aw_feed_language' => (string) $this->google->get_gmc_language(),
393
- 'new_customer' => !$this->is_existing_customer( $order ),
394
- 'quantity' => (int) count( $this->wpm_get_order_items( $order ) ),
395
- 'items' => $this->get_front_end_order_items( $order ),
396
- ];
397
- $data['products'] = $this->get_order_products( $order );
398
- }
399
-
400
- return $data;
401
- }
402
-
403
- protected function get_user_data()
404
- {
405
- $data = [];
406
-
407
- if ( is_user_logged_in() || is_order_received_page() ) {
408
- $data['id'] = get_current_user_id();
409
- $data['email'] = $this->get_user_email();
410
- $data['email_sha256'] = $this->get_user_email( 'sha256' );
411
- }
412
-
413
- return $data;
414
- }
415
-
416
- protected function get_order_products( $order )
417
- {
418
- $order_products = [];
419
- foreach ( (array) $this->wpm_get_order_items( $order ) as $order_item ) {
420
- $order_item_data = $order_item->get_data();
421
- if ( 0 !== $order_item_data['variation_id'] ) {
422
- // add variation
423
- $order_products[$order_item_data['variation_id']] = $this->get_product_data( $order_item_data['variation_id'] );
424
- }
425
- $order_products[$order_item_data['product_id']] = $this->get_product_data( $order_item_data['product_id'] );
426
- }
427
- return $order_products;
428
- }
429
-
430
- protected function get_product_data( $product_id )
431
- {
432
- $product = wc_get_product( $product_id );
433
-
434
- if ( !is_object( $product ) ) {
435
- $this->log_problematic_product_id( $product_id );
436
- return [];
437
- }
438
-
439
- return [
440
- 'product_id' => $product->get_id(),
441
- 'name' => $product->get_name(),
442
- 'type' => $product->get_type(),
443
- 'dyn_r_ids' => $this->get_dyn_r_ids( $product ),
444
- 'brand' => (string) $this->get_brand_name( $product_id ),
445
- 'category' => (array) $this->get_product_category( $product_id ),
446
- 'variant_name' => ( (string) ($product->get_type() === 'variation') ? $this->get_formatted_variant_text( $product ) : '' ),
447
- ];
448
- }
449
-
450
  public function view_item_list_trigger_settings()
451
  {
452
  $settings = [
@@ -468,20 +310,30 @@ class Pixel_Manager extends Script_Manager
468
 
469
  public function inject_wpm_opening()
470
  {
 
 
 
471
  echo PHP_EOL . '<!-- START WooCommerce Pixel Manager -->' . PHP_EOL ;
472
  }
473
 
474
  public function inject_wpm_closing()
475
  {
 
 
 
476
  if ( is_order_received_page() ) {
477
 
478
  if ( $this->get_order_from_order_received_page() ) {
479
  $order = $this->get_order_from_order_received_page();
 
480
  $this->increase_conversion_count_for_ratings( $order );
481
  }
482
 
483
  }
484
  echo PHP_EOL . '<!-- END WooCommerce Pixel Manager -->' . PHP_EOL ;
 
 
 
485
  }
486
 
487
  private function increase_conversion_count_for_ratings( $order )
@@ -503,6 +355,8 @@ class Pixel_Manager extends Script_Manager
503
  $cart_items = $woocommerce->cart->get_cart();
504
  $data = [];
505
  foreach ( $cart_items as $cart_item => $value ) {
 
 
506
  $product = wc_get_product( $value['data']->get_id() );
507
 
508
  if ( !is_object( $product ) ) {
@@ -524,7 +378,7 @@ class Pixel_Manager extends Script_Manager
524
  'isVariation' => false,
525
  ];
526
 
527
- if ( 'variation' === $product->get_type() ) {
528
  $parent_product = wc_get_product( $product->get_parent_id() );
529
 
530
  if ( $parent_product ) {
@@ -555,12 +409,13 @@ class Pixel_Manager extends Script_Manager
555
  }
556
 
557
  }
 
558
  wp_send_json( $data );
559
  }
560
 
561
  public function ajax_wpm_get_product_ids()
562
  {
563
- $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
564
  $product_ids = $_get['productIds'];
565
 
566
  if ( !$product_ids ) {
@@ -595,7 +450,7 @@ class Pixel_Manager extends Script_Manager
595
  // error_log('Invalid security token sent.');
596
  // wp_die();
597
  // }
598
- $_post = filter_input_array( INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
599
  $order_id = $_post['order_id'];
600
  update_post_meta( $order_id, '_wpm_conversion_pixel_fired', true );
601
  wp_send_json_success();
@@ -606,7 +461,6 @@ class Pixel_Manager extends Script_Manager
606
  public function wpm_front_end_scripts()
607
  {
608
  $wpm_dependencies = [ 'jquery' ];
609
- // enable polyfill.io with filter
610
 
611
  if ( wpm_fs()->is__premium_only() && apply_filters( 'wpm_experimental_inject_polyfill_io', false ) ) {
612
  wp_enqueue_script(
@@ -624,7 +478,7 @@ class Pixel_Manager extends Script_Manager
624
  WPM_PLUGIN_DIR_PATH . 'js/public/wpm-public.p1.min.js',
625
  $wpm_dependencies,
626
  WPM_CURRENT_VERSION,
627
- $this->move_wpm_script_to_footer()
628
  );
629
  wp_localize_script(
630
  'wpm',
@@ -634,12 +488,16 @@ class Pixel_Manager extends Script_Manager
634
  'ajax_url' => admin_url( 'admin-ajax.php' ),
635
  ]
636
  );
637
- }
638
-
639
- protected function move_wpm_script_to_footer()
640
- {
641
- // this filter moves the wpm script to the footer
642
- return apply_filters( 'wpm_experimental_move_wpm_script_to_footer', false );
 
 
 
 
643
  }
644
 
645
  private function get_preset_version()
@@ -657,7 +515,7 @@ class Pixel_Manager extends Script_Manager
657
  // $this->google_pixel_manager->inject_google_optimize_anti_flicker_snippet();
658
  }
659
 
660
- private function get_shop_data()
661
  {
662
  $data = [];
663
 
@@ -718,36 +576,196 @@ class Pixel_Manager extends Script_Manager
718
  }
719
 
720
  $data['currency'] = get_woocommerce_currency();
721
- // $data['mini_cart']['track'] = apply_filters_deprecated('wooptpm_track_mini_cart', [true], '1.13.0', 'wpm_track_mini_cart');
722
- // $data['mini_cart']['track'] = apply_filters('wpm_track_mini_cart', $data['mini_cart']['track']);
723
- $mini_cart_filter_deprecation_message = 'The filter has become obsolete since WPM now tracks cart item data using the browser cache and doesn\'t rely entirely on the server anymore.';
724
- apply_filters_deprecated(
725
  'wooptpm_track_mini_cart',
726
  [ true ],
727
  '1.13.0',
728
- '',
729
- $mini_cart_filter_deprecation_message
730
- );
731
- apply_filters_deprecated(
732
- 'wpm_track_mini_cart',
733
- [ true ],
734
- '1.15.5',
735
- '',
736
- $mini_cart_filter_deprecation_message
737
  );
 
738
  $data['cookie_consent_mgmt'] = [
739
  'explicit_consent' => (bool) $this->options_obj->shop->cookie_consent_mgmt->explicit_consent,
740
  ];
741
- return $data;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
742
  }
743
 
744
- private function get_general_data()
745
  {
746
  $data = [
747
  'variationsOutput' => (bool) $this->options_obj->general->variations_output,
748
- 'userLoggedIn' => is_user_logged_in(),
749
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
  return $data;
751
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
752
 
753
  }
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
5
+ use stdClass ;
6
+ use WC_Order ;
7
+ use WCPM\Classes\Admin\Environment_Check ;
8
+ use WCPM\Classes\Pixels\Bing\Bing_Pixel_Manager ;
9
  use WCPM\Classes\Pixels\Facebook\Facebook_Pixel_Manager ;
10
  use WCPM\Classes\Pixels\Facebook\Facebook_Pixel_Manager_Microdata ;
 
11
  use WCPM\Classes\Pixels\Google\Google_Analytics_Refund ;
12
  use WCPM\Classes\Pixels\Google\Google_Pixel_Manager ;
13
+ use WCPM\Classes\Pixels\Google\Trait_Google ;
14
+ use WCPM\Classes\Pixels\Hotjar\Hotjar_Pixel ;
15
+ use WCPM\Classes\Pixels\Pinterest\Pinterest_Pixel_Manager ;
16
+ use WCPM\Classes\Pixels\Snapchat\Snapchat_Pixel_Manager ;
17
+ use WCPM\Classes\Pixels\TikTok\TikTok_Pixel_Manager ;
18
+ use WCPM\Classes\Pixels\Twitter\Twitter_Pixel_Manager ;
19
 
20
  if ( !defined( 'ABSPATH' ) ) {
21
  exit;
22
  // Exit if accessed directly
23
  }
24
 
25
+ class Pixel_Manager extends Pixel_Manager_Base
26
  {
27
  use Trait_Product ;
28
+ use Trait_Google ;
29
  use Trait_Shop ;
30
  protected $options ;
31
  protected $options_obj ;
32
  protected $cart ;
33
  protected $facebook_active ;
34
  protected $google_active ;
 
35
  protected $transaction_deduper_timeout = 1000 ;
36
+ protected $hotjar_pixel ;
37
+ protected $dyn_r_ids ;
38
  protected $position = 1 ;
 
39
  public function __construct( $options )
40
  {
41
+ /*
42
  * Initialize options
43
  */
44
+ // $this->options = get_option(WPM_DB_OPTIONS_NAME);
45
  $this->options = $options;
46
  $this->options_obj = json_decode( wp_json_encode( $this->options ) );
47
+ $this->options_obj->shop->currency = new stdClass();
48
  $this->options_obj->shop->currency = get_woocommerce_currency();
49
+ /*
50
  * Set a few states
51
  */
52
  $this->facebook_active = !empty($this->options_obj->facebook->pixel_id);
53
+ $this->google_active = $this->google_active();
54
+ /*
 
 
55
  * Inject pixel snippets in head
56
  */
57
  // add_action('wp_head', function () {
59
  // });
60
  add_action( 'wp_head', function () {
61
  $this->inject_wpm_opening();
62
+ $this->inject_data_layer_init();
63
+ $this->inject_data_layer_shop();
64
+ $this->inject_data_layer_general();
65
+ // $this->inject_data_layer_product();
66
  } );
67
+ /*
68
  * Initialize all pixels
69
  */
70
  if ( $this->google_active ) {
73
  if ( $this->facebook_active ) {
74
  new Facebook_Pixel_Manager( $this->options );
75
  }
76
+ if ( $this->options_obj->hotjar->site_id ) {
77
+ $this->hotjar_pixel = new Hotjar_Pixel( $this->options );
78
+ }
79
  add_action( 'wp_head', function () {
80
  $this->inject_wpm_closing();
81
  // if( isset(WC()->session)) {
83
  // error_log(print_r(WC()->session,true));
84
  // }
85
  } );
86
+ /*
87
  * Front-end script section
88
  */
89
+ add_action( 'wp_enqueue_scripts', [ $this, 'wpm_front_end_scripts' ] );
 
 
90
  add_action( 'wp_ajax_wpm_get_cart_items', [ $this, 'ajax_wpm_get_cart_items' ] );
91
  add_action( 'wp_ajax_nopriv_wpm_get_cart_items', [ $this, 'ajax_wpm_get_cart_items' ] );
92
  add_action( 'wp_ajax_wpm_get_product_ids', [ $this, 'ajax_wpm_get_product_ids' ] );
93
  add_action( 'wp_ajax_nopriv_wpm_get_product_ids', [ $this, 'ajax_wpm_get_product_ids' ] );
94
  add_action( 'wp_ajax_wpm_purchase_pixels_fired', [ $this, 'ajax_purchase_pixels_fired_handler' ] );
95
  add_action( 'wp_ajax_nopriv_wpm_purchase_pixels_fired', [ $this, 'ajax_purchase_pixels_fired_handler' ] );
96
+ /*
 
 
 
 
 
 
 
 
 
97
  * Inject pixel snippets after <body> tag
98
  */
99
  if ( did_action( 'wp_body_open' ) ) {
101
  $this->inject_body_pixels();
102
  } );
103
  }
104
+ /*
105
  * Inject pixel snippets into wp_footer
106
  */
107
  add_action( 'wp_footer', [ $this, 'wpm_wp_footer' ] );
108
+ /*
109
  * Process short codes
110
  */
111
  new Shortcodes( $this->options );
138
  add_action( 'woocommerce_mini_cart_contents', [ $this, 'woocommerce_mini_cart_contents' ] );
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
141
  public function woocommerce_mini_cart_contents()
142
  {
143
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
153
  ];
154
  ?>
155
  <script>
156
+ window.wpmDataLayer.cartItemKeys = window.wpmDataLayer.cartItemKeys || {};
157
  window.wpmDataLayer.cartItemKeys['<?php
158
  echo esc_js( $cart_item_key ) ;
159
  ?>'] = <?php
164
  <?php
165
  }
166
 
167
+ private function get_cart_parent_product_for_pinterest( $product_id )
168
+ {
169
+ $product = wc_get_product( $product_id );
170
+
171
+ if ( !is_object( $product ) ) {
172
+ // $this->log_problematic_product_id();
173
+ wc_get_logger()->debug( 'get_product_data_layer_script received an invalid product', [
174
+ 'source' => 'wpm',
175
+ ] );
176
+ return '';
177
+ }
178
+
179
+ $this->dyn_r_ids = $this->get_dyn_r_ids( $product );
180
+ return [
181
+ 'id' => (string) $product->get_id(),
182
+ 'dyn_r_ids' => $this->dyn_r_ids,
183
+ ];
184
+ }
185
+
186
  // on product page
187
  public function woocommerce_inject_product_data_on_product_page()
188
  {
252
  }
253
 
254
  // https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-specific-JavaScripts-
255
+ private function inject_data_layer_init()
256
  {
257
+ $data = [
258
+ 'cart' => [],
259
+ 'cart_item_keys' => [],
260
+ 'pixels' => [],
261
+ 'orderDeduplication' => ( $this->options['shop']['order_deduplication'] && !$this->is_nodedupe_parameter_set() ? true : false ),
262
+ 'position' => 1,
263
+ 'viewItemListTrigger' => $this->view_item_list_trigger_settings(),
264
+ 'version' => [
265
+ 'number' => WPM_CURRENT_VERSION,
266
+ 'pro' => wpm_fs()->is__premium_only(),
267
+ ],
268
+ ];
269
  ?>
270
 
271
+ <script data-cfasync="false">
272
+
273
+ function wpmExists() {
274
+ return new Promise(function (resolve, reject) {
275
+ (function waitForWpm() {
276
+ if (window.wpm) return resolve();
277
+ setTimeout(waitForWpm, 30);
278
+ })();
279
+ });
280
+ }
281
 
282
+ window.wpmDataLayer = window.wpmDataLayer || {};
283
  window.wpmDataLayer = <?php
284
+ echo wp_json_encode( $data, JSON_FORCE_OBJECT ) ;
285
  ?>;
286
 
287
  </script>
289
  <?php
290
  }
291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  public function view_item_list_trigger_settings()
293
  {
294
  $settings = [
310
 
311
  public function inject_wpm_opening()
312
  {
313
+ if ( ( new Environment_Check() )->is_autoptimize_active() ) {
314
+ $this->inject_noptimize_opening_tag();
315
+ }
316
  echo PHP_EOL . '<!-- START WooCommerce Pixel Manager -->' . PHP_EOL ;
317
  }
318
 
319
  public function inject_wpm_closing()
320
  {
321
+ if ( $this->options_obj->hotjar->site_id ) {
322
+ $this->hotjar_pixel->inject_everywhere();
323
+ }
324
  if ( is_order_received_page() ) {
325
 
326
  if ( $this->get_order_from_order_received_page() ) {
327
  $order = $this->get_order_from_order_received_page();
328
+ $this->inject_transaction_deduper_script( $order->get_id() );
329
  $this->increase_conversion_count_for_ratings( $order );
330
  }
331
 
332
  }
333
  echo PHP_EOL . '<!-- END WooCommerce Pixel Manager -->' . PHP_EOL ;
334
+ if ( ( new Environment_Check() )->is_autoptimize_active() ) {
335
+ $this->inject_noptimize_closing_tag();
336
+ }
337
  }
338
 
339
  private function increase_conversion_count_for_ratings( $order )
355
  $cart_items = $woocommerce->cart->get_cart();
356
  $data = [];
357
  foreach ( $cart_items as $cart_item => $value ) {
358
+ // error_log('qty: ' . $value['quantity']);
359
+ // error_log(print_r($value['data'], true));
360
  $product = wc_get_product( $value['data']->get_id() );
361
 
362
  if ( !is_object( $product ) ) {
378
  'isVariation' => false,
379
  ];
380
 
381
+ if ( $product->get_type() == 'variation' ) {
382
  $parent_product = wc_get_product( $product->get_parent_id() );
383
 
384
  if ( $parent_product ) {
409
  }
410
 
411
  }
412
+ // error_log(print_r($data, true));
413
  wp_send_json( $data );
414
  }
415
 
416
  public function ajax_wpm_get_product_ids()
417
  {
418
+ $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
419
  $product_ids = $_get['productIds'];
420
 
421
  if ( !$product_ids ) {
450
  // error_log('Invalid security token sent.');
451
  // wp_die();
452
  // }
453
+ $_post = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
454
  $order_id = $_post['order_id'];
455
  update_post_meta( $order_id, '_wpm_conversion_pixel_fired', true );
456
  wp_send_json_success();
461
  public function wpm_front_end_scripts()
462
  {
463
  $wpm_dependencies = [ 'jquery' ];
 
464
 
465
  if ( wpm_fs()->is__premium_only() && apply_filters( 'wpm_experimental_inject_polyfill_io', false ) ) {
466
  wp_enqueue_script(
478
  WPM_PLUGIN_DIR_PATH . 'js/public/wpm-public.p1.min.js',
479
  $wpm_dependencies,
480
  WPM_CURRENT_VERSION,
481
+ false
482
  );
483
  wp_localize_script(
484
  'wpm',
488
  'ajax_url' => admin_url( 'admin-ajax.php' ),
489
  ]
490
  );
491
+ // if (wpm_fs()->is__premium_only()) {
492
+ //
493
+ // wp_enqueue_script(
494
+ // 'wpm-premium-only',
495
+ // WPM_PLUGIN_DIR_PATH . 'js/public/head/wpm__premium_only' . $this->get_script_suffix(),
496
+ // ['jquery', 'wpm'],
497
+ // WPM_CURRENT_VERSION,
498
+ // false
499
+ // );
500
+ // }
501
  }
502
 
503
  private function get_preset_version()
515
  // $this->google_pixel_manager->inject_google_optimize_anti_flicker_snippet();
516
  }
517
 
518
+ private function inject_data_layer_shop()
519
  {
520
  $data = [];
521
 
576
  }
577
 
578
  $data['currency'] = get_woocommerce_currency();
579
+ $data['mini_cart']['track'] = apply_filters_deprecated(
 
 
 
580
  'wooptpm_track_mini_cart',
581
  [ true ],
582
  '1.13.0',
583
+ 'wpm_track_mini_cart'
 
 
 
 
 
 
 
 
584
  );
585
+ $data['mini_cart']['track'] = apply_filters( 'wpm_track_mini_cart', $data['mini_cart']['track'] );
586
  $data['cookie_consent_mgmt'] = [
587
  'explicit_consent' => (bool) $this->options_obj->shop->cookie_consent_mgmt->explicit_consent,
588
  ];
589
+ ?>
590
+
591
+ <script>
592
+ wpmDataLayer.shop = <?php
593
+ echo wp_json_encode( $data ) ;
594
+ ?>;
595
+ </script>
596
+ <?php
597
+ if ( $this->options_obj->shop->cookie_consent_mgmt->explicit_consent ) {
598
+ ?>
599
+
600
+ <script>
601
+ if (typeof wpm != "undefined") {
602
+ wpm.updateConsentCookieValues(true)
603
+ } else {
604
+ console.error('wpm is not defined. That means you are deferring the script which you shouldn\'t. wpm must be loaded before the inline scripts run. Visitor tracking will continue to work, but explicit consent mode will be ignored.')
605
+ }
606
+ </script>
607
+ <?php
608
+ }
609
  }
610
 
611
+ private function inject_data_layer_general()
612
  {
613
  $data = [
614
  'variationsOutput' => (bool) $this->options_obj->general->variations_output,
 
615
  ];
616
+ ?>
617
+
618
+ <script>
619
+ wpmDataLayer.general = <?php
620
+ echo wp_json_encode( $data ) ;
621
+ ?>;
622
+ </script>
623
+ <?php
624
+ }
625
+
626
+ private function inject_data_layer_product()
627
+ {
628
+ global $wp_query, $woocommerce ;
629
+
630
+ if ( is_shop() || is_product_category() || is_product_tag() || is_search() ) {
631
+ // if (!is_cart() || !is_order_received_page()) {
632
+ $product_ids = [];
633
+ $posts = $wp_query->posts;
634
+ foreach ( $posts as $key => $post ) {
635
+ if ( 'product' == $post->post_type || 'product_variation' == $post->post_type ) {
636
+ array_push( $product_ids, $post->ID );
637
+ }
638
+ }
639
+ ?>
640
+
641
+ <script>
642
+ wpmDataLayer.visible_products = <?php
643
+ echo wp_json_encode( $this->eec_get_visible_products( $product_ids ) ) ;
644
+ ?>;
645
+ </script>
646
+ <?php
647
+ } elseif ( is_cart() ) {
648
+ $visible_product_ids = [];
649
+ $upsell_product_ids = [];
650
+ $items = $woocommerce->cart->get_cart();
651
+ foreach ( $items as $item => $values ) {
652
+ array_push( $visible_product_ids, $values['data']->get_id() );
653
+ $product = wc_get_product( $values['data']->get_id() );
654
+ // only continue if WC retrieves a valid product
655
+
656
+ if ( is_object( $product ) ) {
657
+ $single_product_upsell_ids = $product->get_upsell_ids();
658
+ // error_log(print_r($single_product_upsell_ids,true));
659
+ foreach ( $single_product_upsell_ids as $item => $value ) {
660
+ // error_log('item ' . $item);
661
+ // error_log('value' . $value);
662
+ if ( !in_array( $value, $upsell_product_ids, true ) ) {
663
+ array_push( $upsell_product_ids, $value );
664
+ }
665
+ }
666
+ }
667
+
668
+ }
669
+ // error_log(print_r($upsell_product_ids,true));
670
+ ?>
671
+
672
+ <script>
673
+ wpmDataLayer.visible_products = <?php
674
+ echo wp_json_encode( $this->eec_get_visible_products( $visible_product_ids ) ) ;
675
+ ?>;
676
+ wpmDataLayer.upsell_products = <?php
677
+ echo wp_json_encode( $this->eec_get_visible_products( $upsell_product_ids ) ) ;
678
+ ?>;
679
+ </script>
680
+ <?php
681
+ } elseif ( is_product() ) {
682
+ $visible_product_ids = [];
683
+ $product = wc_get_product();
684
+ array_push( $visible_product_ids, $product->get_id() );
685
+ $related_products = wc_get_related_products( $product->get_id() );
686
+ foreach ( $related_products as $item => $value ) {
687
+ array_push( $visible_product_ids, $value );
688
+ }
689
+ $upsell_product_ids = $product->get_upsell_ids();
690
+ foreach ( $upsell_product_ids as $item => $value ) {
691
+ array_push( $visible_product_ids, $value );
692
+ }
693
+ // error_log(print_r($visible_product_ids, true));
694
+ if ( $product->get_type() === 'grouped' ) {
695
+ $visible_product_ids = array_merge( $visible_product_ids, $product->get_children() );
696
+ }
697
+ ?>
698
+
699
+ <script>
700
+ wpmDataLayer.visible_products = <?php
701
+ echo wp_json_encode( $this->eec_get_visible_products( $visible_product_ids ) ) ;
702
+ ?>;
703
+ </script>
704
+ <?php
705
+ }
706
+
707
+ }
708
+
709
+ private function eec_get_visible_products( $product_ids )
710
+ {
711
+ // error_log(print_r($product_ids, true));
712
+ $data = [];
713
+ $position = 1;
714
+ foreach ( $product_ids as $key => $product_id ) {
715
+ $product = wc_get_product( $product_id );
716
+ // only continue if WC retrieves a valid product
717
+
718
+ if ( is_object( $product ) ) {
719
+ $this->dyn_r_ids = $this->get_dyn_r_ids( $product );
720
+ $data[$product->get_id()] = [
721
+ 'id' => (string) $product->get_id(),
722
+ 'sku' => (string) $product->get_sku(),
723
+ 'name' => (string) $product->get_name(),
724
+ 'price' => (int) $product->get_price(),
725
+ 'brand' => $this->get_brand_name( $product->get_id() ),
726
+ 'category' => (array) $this->get_product_category( $product->get_id() ),
727
+ 'quantity' => (int) 1,
728
+ 'position' => (int) $position,
729
+ 'dyn_r_ids' => $this->dyn_r_ids,
730
+ ];
731
+ $position++;
732
+ } else {
733
+ $this->log_problematic_product_id( $product_id );
734
+ }
735
+
736
+ }
737
  return $data;
738
  }
739
+
740
+ protected function inject_transaction_deduper_script( $order_id )
741
+ {
742
+ // error_log('order id: ' . $order_id);
743
+ ?>
744
+
745
+ <script>
746
+ jQuery(function () {
747
+ setTimeout(function () {
748
+ wpmExists().then(function () {
749
+ wpm.writeOrderIdToStorage('<?php
750
+ echo esc_js( $order_id ) ;
751
+ ?>');
752
+ });
753
+ }, <?php
754
+ echo esc_js( $this->transaction_deduper_timeout ) ;
755
+ ?>);
756
+ });
757
+ </script>
758
+ <?php
759
+ }
760
+
761
+ private function inject_noptimize_opening_tag()
762
+ {
763
+ echo PHP_EOL . '<!--noptimize-->' ;
764
+ }
765
+
766
+ private function inject_noptimize_closing_tag()
767
+ {
768
+ echo '<!--/noptimize-->' . PHP_EOL . PHP_EOL ;
769
+ }
770
 
771
  }
classes/pixels/class-pixel.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace WCPM\Classes\Pixels;
4
 
5
  use stdClass;
 
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
@@ -17,6 +18,7 @@ class Pixel {
17
  protected $conversion_label;
18
  protected $dynamic_remarketing;
19
  protected $google_business_vertical;
 
20
  protected $ip;
21
  protected $order_total_logic;
22
  protected $product_identifier;
@@ -29,17 +31,68 @@ class Pixel {
29
  /*
30
  * Initialize options
31
  */
 
32
  $this->options = $options;
33
  $this->options_obj = json_decode(wp_json_encode($this->options));
34
 
 
35
  $this->options_obj->shop->currency = get_woocommerce_currency();
36
 
37
- $this->order_total_logic = $this->options['shop']['order_total_logic'];
38
- $this->add_cart_data = (bool) $this->options['google']['ads']['aw_merchant_id'];
 
 
 
 
 
 
39
  $this->aw_merchant_id = $this->options['google']['ads']['aw_merchant_id'];
40
  $this->conversion_id = $this->options['google']['ads']['conversion_id'];
41
  $this->conversion_label = $this->options['google']['ads']['conversion_label'];
42
  $this->dynamic_remarketing = $this->options['google']['ads']['dynamic_remarketing'];
43
  $this->product_identifier = $this->options['google']['ads']['product_identifier'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
  }
3
  namespace WCPM\Classes\Pixels;
4
 
5
  use stdClass;
6
+ use WC_Geolocation;
7
 
8
  if (!defined('ABSPATH')) {
9
  exit; // Exit if accessed directly
18
  protected $conversion_label;
19
  protected $dynamic_remarketing;
20
  protected $google_business_vertical;
21
+ protected $gtag_deactivation;
22
  protected $ip;
23
  protected $order_total_logic;
24
  protected $product_identifier;
31
  /*
32
  * Initialize options
33
  */
34
+ // $this->options = get_option(WPM_DB_OPTIONS_NAME);
35
  $this->options = $options;
36
  $this->options_obj = json_decode(wp_json_encode($this->options));
37
 
38
+ $this->options_obj->shop->currency = new stdClass();
39
  $this->options_obj->shop->currency = get_woocommerce_currency();
40
 
41
+ // avoid number output with too many decimals
42
+ if (version_compare(phpversion(), '7.1', '>=')) {
43
+ ini_set('serialize_precision', -1);
44
+ }
45
+
46
+ $this->order_total_logic = $this->options['shop']['order_total_logic'];
47
+ // $this->add_cart_data = $this->options['google']['ads']['add_cart_data'];
48
+ $this->add_cart_data = $this->options['google']['ads']['aw_merchant_id'] ? true : false;
49
  $this->aw_merchant_id = $this->options['google']['ads']['aw_merchant_id'];
50
  $this->conversion_id = $this->options['google']['ads']['conversion_id'];
51
  $this->conversion_label = $this->options['google']['ads']['conversion_label'];
52
  $this->dynamic_remarketing = $this->options['google']['ads']['dynamic_remarketing'];
53
  $this->product_identifier = $this->options['google']['ads']['product_identifier'];
54
+
55
+ if (array_key_exists('gtag', $this->options['google'])) {
56
+ $this->gtag_deactivation = $this->options['google']['gtag']['deactivation'];
57
+ }
58
+ }
59
+
60
+ // get an array with all cart product ids
61
+ public function get_cart_ids( $cart ) {
62
+ // error_log(print_r($cart, true));
63
+ // initiate product identifier array
64
+ $cart_items = [];
65
+
66
+ // go through the array and get all product identifiers
67
+ foreach ((array) $cart as $cart_item) {
68
+
69
+ $product_id = $this->get_variation_or_product_id($cart_item, $this->options_obj->general->variations_output);
70
+ $product = wc_get_product($product_id);
71
+
72
+ $product_id_compiled = $this->get_compiled_product_id($product_id, $product->get_sku(), $this->options, '');
73
+
74
+ array_push($cart_items, $product_id_compiled);
75
+ }
76
+
77
+ return $cart_items;
78
+ }
79
+
80
+ protected function get_visitor_country() {
81
+ if ($this->isLocalhost()) {
82
+ $this->ip = WC_Geolocation::get_external_ip_address();
83
+ } else {
84
+ $this->ip = WC_Geolocation::get_ip_address();
85
+ }
86
+
87
+ $location = WC_Geolocation::geolocate_ip($this->ip);
88
+
89
+ return $location['country'];
90
+ }
91
+
92
+ protected function isLocalhost() {
93
+
94
+ $_server = filter_input_array(INPUT_SERVER, FILTER_SANITIZE_STRING);
95
+
96
+ return in_array($_server['REMOTE_ADDR'], ['127.0.0.1', '::1']);
97
  }
98
  }
classes/pixels/class-script-manager.php DELETED
@@ -1,284 +0,0 @@
1
- <?php
2
-
3
- namespace WCPM\Classes\Pixels;
4
-
5
- use stdClass ;
6
- use WCPM\Classes\Admin\Documentation ;
7
- use WC_Product ;
8
- use WC_Product_Data_Store_CPT ;
9
-
10
- if ( !defined( 'ABSPATH' ) ) {
11
- exit;
12
- // Exit if accessed directly
13
- }
14
-
15
- class Script_Manager
16
- {
17
- use Trait_Product ;
18
- use Trait_Shop ;
19
- protected $transaction_deduper_timeout = 2000 ;
20
- protected $options ;
21
- protected $options_obj ;
22
- public function __construct( $options )
23
- {
24
- /*
25
- * Initialize options
26
- */
27
- // $this->options = get_option(WPM_DB_OPTIONS_NAME);
28
- $this->options = $options;
29
- $this->options_obj = json_decode( wp_json_encode( $this->options ) );
30
- $this->options_obj->shop->currency = new stdClass();
31
- $this->options_obj->shop->currency = get_woocommerce_currency();
32
- /*
33
- * Inject pixel snippets in head
34
- */
35
- add_action( 'wp_head', function () {
36
- $this->inject_head_pixels();
37
- } );
38
- }
39
-
40
- public function inject_head_pixels()
41
- {
42
- global $woocommerce ;
43
- $_post = filter_input_array( INPUT_POST, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
44
- $this->inject_opening_script_tag();
45
- $this->inject_everywhere();
46
-
47
- if ( is_product_category() ) {
48
- $this->inject_product_category();
49
- } elseif ( is_product_tag() ) {
50
- $this->inject_product_tag();
51
- } elseif ( is_search() ) {
52
- $this->inject_search();
53
- } elseif ( is_product() && !isset( $_post['add-to-cart'] ) ) {
54
- $product = wc_get_product();
55
- $product_id = $product->get_id();
56
- $product_attributes = [
57
- 'brand' => $this->get_brand_name( $product_id ),
58
- ];
59
- if ( $product->is_type( 'variable' ) ) {
60
- // find out if attributes have been set in the URL
61
- // if not, continue
62
- // if yes get the variation id and variation SKU
63
-
64
- if ( $this->query_string_contains_all_variation_attributes( $product ) ) {
65
- // get variation product
66
- $product_id = $this->get_variation_from_query_string( $product_id, $product );
67
- // In case a variable product is misconfigured, wc_get_product($product_id) will not
68
- // get a product but a bool. So we need to test it and only run it if
69
- // we actually get a product. Basically we fall back to the parent product.
70
- if ( is_object( wc_get_product( $product_id ) ) ) {
71
- $product = wc_get_product( $product_id );
72
- }
73
- }
74
-
75
- }
76
-
77
- if ( is_object( $product ) ) {
78
- $product_attributes['product_id_compiled'] = $this->get_compiled_product_id(
79
- $product_id,
80
- $product->get_sku(),
81
- $this->options,
82
- ''
83
- );
84
- $product_attributes['dyn_r_ids'] = $this->get_dyn_r_ids( $product );
85
- $this->inject_product( $product, $product_attributes );
86
- } else {
87
- $this->log_problematic_product_id( $product_id );
88
- }
89
-
90
- } elseif ( $this->is_shop_top_page() ) {
91
- $this->inject_shop_top_page();
92
- } elseif ( is_cart() && !empty($woocommerce->cart->get_cart()) ) {
93
- $cart = $woocommerce->cart->get_cart();
94
- $cart_total = WC()->cart->get_cart_contents_total();
95
- $this->inject_cart( $cart, $cart_total );
96
- } elseif ( is_order_received_page() ) {
97
- // $this->is_nodedupe_parameter_set();
98
- // get order from URL and evaluate order total
99
-
100
- if ( $this->get_order_from_order_received_page() ) {
101
- $order = $this->get_order_from_order_received_page();
102
-
103
- if ( is_user_logged_in() ) {
104
- $user = get_current_user_id();
105
- } else {
106
- $user = $order->get_billing_email();
107
- }
108
-
109
- $is_new_customer = !$this->is_existing_customer( $order, $user );
110
- $order_total = $this->wpm_get_order_total( $order );
111
- // dedupe code
112
- if ( $this->can_order_confirmation_be_processed( $order ) ) {
113
- $this->inject_order_received_page_dedupe( $order, $order_total, $is_new_customer );
114
- }
115
- $this->inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer );
116
- }
117
-
118
- }
119
-
120
- $this->inject_closing_script_tag();
121
- }
122
-
123
- protected function can_order_confirmation_be_processed( $order )
124
- {
125
- $conversion_prevention = false;
126
- $conversion_prevention = apply_filters_deprecated(
127
- 'wgact_conversion_prevention',
128
- [ $conversion_prevention, $order ],
129
- '1.10.2',
130
- 'wooptpm_conversion_prevention'
131
- );
132
- $conversion_prevention = apply_filters_deprecated(
133
- 'wooptpm_conversion_prevention',
134
- [ $conversion_prevention, $order ],
135
- '1.13.0',
136
- 'wpm_conversion_prevention'
137
- );
138
- $conversion_prevention = apply_filters( 'wpm_conversion_prevention', $conversion_prevention, $order );
139
- // error_log('conversion_prevention: ' . $conversion_prevention);
140
- // error_log('$this->is_nodedupe_parameter_set(): ' . $this->is_nodedupe_parameter_set());
141
- // error_log('$order->has_status(\'failed\'): ' . $order->has_status('failed'));
142
- // error_log('current_user_can(\'edit_others_pages\'): ' . current_user_can('edit_others_pages'));
143
- // error_log("this->options['shop']['order_deduplication']: " . $this->options['shop']['order_deduplication']);
144
- // error_log('order id: ' . $order->get_id());
145
- // error_log('order number: ' . $order->get_order_number());
146
- // error_log('get_post_meta($order->get_order_number(), \'_wpm_conversion_pixel_fired\', true): ' . get_post_meta($order->get_order_number(), '_wpm_conversion_pixel_fired', true));
147
-
148
- if ( $this->is_nodedupe_parameter_set() || !$order->has_status( 'failed' ) && $this->track_user() && false == $conversion_prevention && (!$this->options['shop']['order_deduplication'] || $this->has_conversion_pixel_already_fired( $order ) != true) ) {
149
- return true;
150
- } else {
151
- return false;
152
- }
153
-
154
- }
155
-
156
- private function has_conversion_pixel_already_fired( $order )
157
- {
158
- return false;
159
- }
160
-
161
- public function inject_everywhere()
162
- {
163
- }
164
-
165
- public function inject_product_category()
166
- {
167
- }
168
-
169
- public function inject_product_tag()
170
- {
171
- }
172
-
173
- public function inject_search()
174
- {
175
- }
176
-
177
- public function inject_product( $product, $product_attributes )
178
- {
179
- }
180
-
181
- public function inject_shop_top_page()
182
- {
183
- }
184
-
185
- public function inject_cart( $cart, $cart_total )
186
- {
187
- }
188
-
189
- public function inject_order_received_page_dedupe( $order, $order_total, $is_new_customer )
190
- {
191
- }
192
-
193
- protected function is_nodedupe_parameter_set()
194
- {
195
- $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
196
-
197
- if ( isset( $_get['nodedupe'] ) ) {
198
- return true;
199
- } else {
200
- return false;
201
- }
202
-
203
- }
204
-
205
- protected function query_string_contains_all_variation_attributes( $product )
206
- {
207
- $_server = filter_input_array( INPUT_SERVER, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
208
-
209
- if ( !empty($_server['QUERY_STRING']) ) {
210
- parse_str( $_server['QUERY_STRING'], $query_string_attributes );
211
- foreach ( array_keys( $product->get_attributes() ) as $variation_attribute => $value ) {
212
- if ( !array_key_exists( 'attribute_' . $value, $query_string_attributes ) ) {
213
- return false;
214
- }
215
- }
216
- return true;
217
- } else {
218
- return false;
219
- }
220
-
221
- }
222
-
223
- protected function get_variation_from_query_string( $product_id, $product )
224
- {
225
- $_server = filter_input_array( INPUT_SERVER, FILTER_SANITIZE_FULL_SPECIAL_CHARS );
226
- parse_str( $_server['QUERY_STRING'], $query_string_attributes );
227
- $search_variation_attributes = [];
228
- foreach ( array_keys( $product->get_attributes() ) as $variation_attribute => $value ) {
229
- $search_variation_attributes['attribute_' . $value] = $query_string_attributes['attribute_' . $value];
230
- }
231
- return $this->find_matching_product_variation_id( $product_id, $search_variation_attributes );
232
- }
233
-
234
- protected function find_matching_product_variation_id( $product_id, $attributes )
235
- {
236
- return ( new WC_Product_Data_Store_CPT() )->find_matching_product_variation( new WC_Product( $product_id ), $attributes );
237
- }
238
-
239
- protected function conversion_pixels_already_fired_html()
240
- {
241
- ?>
242
-
243
- <!-- ----------------------------------------------------------------------------------------------------
244
- The conversion pixels have not been fired. Possible reasons:
245
- - The user role has been disabled for tracking.
246
- - The order payment has failed.
247
- - The pixels have already been fired. To prevent double counting the pixels are only fired once.
248
-
249
- If you want to test the order you have two options:
250
- - Turn off order duplication prevention in the advanced settings
251
- - Add the '&nodedupe' parameter to the order confirmation URL like this:
252
- https://example.test/checkout/order-received/123/?key=wc_order_123abc&nodedupe
253
-
254
- More info on testing: <?php
255
- esc_html_e( ( new Documentation() )->get_link( 'test_order' ) );
256
- ?>
257
-
258
- ----------------------------------------------------------------------------------------------------
259
- -->
260
- <?php
261
- }
262
-
263
- private function is_shop_top_page()
264
- {
265
-
266
- if ( !is_product() && !is_product_category() && !is_order_received_page() && !is_cart() && !is_search() && is_shop() ) {
267
- return true;
268
- } else {
269
- return false;
270
- }
271
-
272
- }
273
-
274
- protected function inject_opening_script_tag()
275
- {
276
- echo ' <script>' ;
277
- }
278
-
279
- protected function inject_closing_script_tag()
280
- {
281
- echo ' </script>' ;
282
- }
283
-
284
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/pixels/class-shortcodes.php CHANGED
@@ -2,31 +2,27 @@
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
5
- use WCPM\Classes\Pixels\Google\Google;
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
9
  }
10
 
11
  class Shortcodes extends Pixel {
 
12
  use Trait_Product;
13
 
14
- private $google;
15
-
16
  public function __construct( $options ) {
17
  parent::__construct($options);
18
 
19
- $this->google = new Google($options);
20
-
21
  add_shortcode('view-item', [$this, 'wpm_view_item']);
22
  add_shortcode('conversion-pixel', [$this, 'wpm_conversion_pixel']);
23
  }
24
 
25
  public function wpm_view_item( $attributes ) {
26
- $shortcode_attributes = shortcode_atts(
27
- [
28
- 'product-id' => null,
29
- ], $attributes);
30
 
31
  if ($shortcode_attributes['product-id']) {
32
 
@@ -42,18 +38,16 @@ class Shortcodes extends Pixel {
42
  ?>
43
 
44
  <script>
45
- jQuery(window).on("wpmLoad", function () {
46
- jQuery(document).trigger("wpmViewItem", wpm.getProductDetailsFormattedForEvent(<?php echo esc_js($shortcode_attributes['product-id']); ?>))
47
- })
48
  </script>
49
  <?php
50
  }
51
  }
52
 
53
  public function wpm_conversion_pixel( $attributes ) {
54
- $this->function_exists_script();
55
-
56
- $pairs = [
57
  'pixel' => 'all',
58
  'gads-conversion-id' => $this->options_obj->google->ads->conversion_id,
59
  'gads-conversion-label' => '',
@@ -67,40 +61,38 @@ class Shortcodes extends Pixel {
67
  'ms-ads-event-value' => 0,
68
  'snap-event' => 'SIGN_UP',
69
  'tiktok-event' => 'SubmitForm',
70
- ];
71
 
72
- $shortcode_attributes = shortcode_atts($pairs, $attributes);
73
-
74
- if ('google-ads' === $shortcode_attributes['pixel']) {
75
- if ($this->google->is_google_ads_active()) {
76
  $this->conversion_html_google_ads($shortcode_attributes);
77
  }
78
- } elseif ('facebook' === $shortcode_attributes['pixel'] || 'meta' === $shortcode_attributes['pixel']) {
79
  if ($this->options_obj->facebook->pixel_id) {
80
  $this->conversion_html_facebook($shortcode_attributes);
81
  }
82
- } elseif ('twitter' === $shortcode_attributes['pixel']) {
83
  if ($this->options_obj->twitter->pixel_id) {
84
  $this->conversion_html_twitter($shortcode_attributes);
85
  }
86
- } elseif ('pinterest' === $shortcode_attributes['pixel']) {
87
  if ($this->options_obj->pinterest->pixel_id) {
88
  $this->conversion_html_pinterest($shortcode_attributes);
89
  }
90
- } elseif ('ms-ads' === $shortcode_attributes['pixel']) {
91
  if ($this->options_obj->bing->uet_tag_id) {
92
  $this->conversion_html_microsoft_ads($shortcode_attributes);
93
  }
94
- } elseif ('snapchat' === $shortcode_attributes['pixel']) {
95
  if ($this->options_obj->snapchat->pixel_id) {
96
  $this->conversion_html_snapchat($shortcode_attributes);
97
  }
98
- } elseif ('tiktok' === $shortcode_attributes['pixel']) {
99
  if ($this->options_obj->tiktok->pixel_id) {
100
  $this->conversion_html_tiktok($shortcode_attributes);
101
  }
102
- } elseif ('all' === $shortcode_attributes['pixel']) {
103
- if ($this->google->is_google_ads_active()) {
104
  $this->conversion_html_google_ads($shortcode_attributes);
105
  }
106
  if ($this->options_obj->facebook->pixel_id) {
@@ -125,69 +117,53 @@ class Shortcodes extends Pixel {
125
  }
126
 
127
  private function conversion_html_snapchat( $shortcode_attributes ) {
128
-
129
  ?>
130
 
131
  <script>
132
- wpmFunctionExists("snaptr").then(function () {
133
- snaptr("track", '<?php echo esc_js($shortcode_attributes['snap-event']); ?>')
134
- },
135
- )
136
  </script>
137
  <?php
138
  }
139
 
140
  private function conversion_html_tiktok( $shortcode_attributes ) {
141
-
142
  ?>
143
 
144
  <script>
145
- wpmFunctionExists("ttq").then(function () {
146
- ttq.track('<?php echo esc_js($shortcode_attributes['tiktok-event']); ?>')
147
- },
148
- )
149
  </script>
150
  <?php
151
  }
152
 
153
  private function conversion_html_google_ads( $shortcode_attributes ) {
154
-
155
  ?>
156
 
157
  <script>
158
- wpmFunctionExists("gtag").then(function () {
159
- if (wpm.googleConfigConditionsMet("ads")) gtag("event", "conversion", {"send_to": 'AW-<?php echo esc_js($shortcode_attributes['gads-conversion-id']); ?>/<?php echo esc_js($shortcode_attributes['gads-conversion-label']); ?>'})
160
- },
161
- )
162
  </script>
163
  <?php
164
  }
165
 
166
  // https://developers.facebook.com/docs/analytics/send_data/events/
167
  private function conversion_html_facebook( $shortcode_attributes ) {
168
-
169
  if ($this->options_obj->facebook->capi->token) {
170
  ?>
171
 
172
  <script>
173
- jQuery(window).on("wpmLoad", function () {
174
 
175
- let eventId = wpm.getRandomEventId()
176
 
177
- wpmFunctionExists("fbq").then(function () {
178
- fbq("track", '<?php echo esc_js($shortcode_attributes['fbc-event']); ?>', {}, {
179
- eventID: eventId,
180
- })
181
- },
182
- )
183
 
184
- jQuery(document).trigger("wpmFbCapiEvent", {
185
  event_name : "<?php echo esc_js($shortcode_attributes['fbc-event']); ?>",
186
  event_id : eventId,
187
  user_data : wpm.getFbUserData(),
188
- event_source_url: window.location.href,
189
- })
190
- })
191
 
192
  </script>
193
  <?php
@@ -195,10 +171,7 @@ class Shortcodes extends Pixel {
195
  ?>
196
 
197
  <script>
198
- wpmFunctionExists("fbq").then(function () {
199
- fbq("track", '<?php echo esc_js($shortcode_attributes['fbc-event']); ?>')
200
- },
201
- )
202
  </script>
203
  <?php
204
  }
@@ -206,14 +179,10 @@ class Shortcodes extends Pixel {
206
 
207
  // https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
208
  private function conversion_html_twitter( $shortcode_attributes ) {
209
-
210
  ?>
211
 
212
  <script>
213
- wpmFunctionExists("twq").then(function () {
214
- twq("track", '<?php echo esc_js($shortcode_attributes['twc-event']); ?>')
215
- },
216
- )
217
  </script>
218
  <?php
219
  }
@@ -221,27 +190,20 @@ class Shortcodes extends Pixel {
221
  // https://help.pinterest.com/en/business/article/track-conversions-with-pinterest-tag
222
  // https://help.pinterest.com/en/business/article/add-event-codes
223
  private function conversion_html_pinterest( $shortcode_attributes ) {
224
-
225
- if ('' === $shortcode_attributes['pinc-lead-type']) {
226
  ?>
227
 
228
  <script>
229
- wpmFunctionExists("pintrk").then(function () {
230
- pintrk("track", '<?php echo esc_js($shortcode_attributes['pinc-event']); ?>')
231
- },
232
- )
233
  </script>
234
  <?php
235
  } else {
236
  ?>
237
 
238
  <script>
239
- wpmFunctionExists("pintrk").then(function () {
240
- pintrk("track", '<?php echo esc_js($shortcode_attributes['pinc-event']); ?>', {
241
- lead_type: '<?php echo esc_js($shortcode_attributes['pinc-lead-type']); ?>',
242
- })
243
- },
244
- )
245
  </script>
246
  <?php
247
  }
@@ -252,33 +214,12 @@ class Shortcodes extends Pixel {
252
  ?>
253
 
254
  <script>
255
- wpmFunctionExists("uetq").then(function () {
256
- window.uetq = window.uetq || []
257
- window.uetq.push("event", '<?php echo esc_js($shortcode_attributes['ms-ads-event']); ?>', {
258
- "event_category": '<?php echo esc_js($shortcode_attributes['ms-ads-event-category']); ?>',
259
- "event_label" : '<?php echo esc_js($shortcode_attributes['ms-ads-event-label']); ?>',
260
- "event_value" : '<?php echo esc_js($shortcode_attributes['ms-ads-event-value']); ?>',
261
- })
262
- },
263
- )
264
- </script>
265
- <?php
266
- }
267
-
268
- protected function function_exists_script() {
269
- ?>
270
-
271
- <script>
272
- if (typeof wpmFunctionExists !== "function") {
273
- window.wpmFunctionExists = function (functionName) {
274
- return new Promise(function (resolve) {
275
- (function waitForVar() {
276
- if (typeof window[functionName] !== "undefined") return resolve()
277
- setTimeout(waitForVar, 1000)
278
- })()
279
- })
280
- }
281
- }
282
  </script>
283
  <?php
284
  }
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
5
+ use WCPM\Classes\Pixels\Google\Trait_Google;
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
9
  }
10
 
11
  class Shortcodes extends Pixel {
12
+ use Trait_Google;
13
  use Trait_Product;
14
 
 
 
15
  public function __construct( $options ) {
16
  parent::__construct($options);
17
 
 
 
18
  add_shortcode('view-item', [$this, 'wpm_view_item']);
19
  add_shortcode('conversion-pixel', [$this, 'wpm_conversion_pixel']);
20
  }
21
 
22
  public function wpm_view_item( $attributes ) {
23
+ $shortcode_attributes = shortcode_atts([
24
+ 'product-id' => null,
25
+ ], $attributes);
 
26
 
27
  if ($shortcode_attributes['product-id']) {
28
 
38
  ?>
39
 
40
  <script>
41
+ jQuery(window).on('load', function () {
42
+ jQuery(document).trigger('wpmViewItem', wpm.getProductDetailsFormattedForEvent(<?php echo esc_js($shortcode_attributes['product-id']); ?>));
43
+ });
44
  </script>
45
  <?php
46
  }
47
  }
48
 
49
  public function wpm_conversion_pixel( $attributes ) {
50
+ $shortcode_attributes = shortcode_atts([
 
 
51
  'pixel' => 'all',
52
  'gads-conversion-id' => $this->options_obj->google->ads->conversion_id,
53
  'gads-conversion-label' => '',
61
  'ms-ads-event-value' => 0,
62
  'snap-event' => 'SIGN_UP',
63
  'tiktok-event' => 'SubmitForm',
64
+ ], $attributes);
65
 
66
+ if ('google-ads' == $shortcode_attributes['pixel']) {
67
+ if ($this->is_google_ads_active()) {
 
 
68
  $this->conversion_html_google_ads($shortcode_attributes);
69
  }
70
+ } elseif ('facebook' == $shortcode_attributes['pixel']) {
71
  if ($this->options_obj->facebook->pixel_id) {
72
  $this->conversion_html_facebook($shortcode_attributes);
73
  }
74
+ } elseif ('twitter' == $shortcode_attributes['pixel']) {
75
  if ($this->options_obj->twitter->pixel_id) {
76
  $this->conversion_html_twitter($shortcode_attributes);
77
  }
78
+ } elseif ('pinterest' == $shortcode_attributes['pixel']) {
79
  if ($this->options_obj->pinterest->pixel_id) {
80
  $this->conversion_html_pinterest($shortcode_attributes);
81
  }
82
+ } elseif ('ms-ads' == $shortcode_attributes['pixel']) {
83
  if ($this->options_obj->bing->uet_tag_id) {
84
  $this->conversion_html_microsoft_ads($shortcode_attributes);
85
  }
86
+ } elseif ('snapchat' == $shortcode_attributes['pixel']) {
87
  if ($this->options_obj->snapchat->pixel_id) {
88
  $this->conversion_html_snapchat($shortcode_attributes);
89
  }
90
+ } elseif ('tiktok' == $shortcode_attributes['pixel']) {
91
  if ($this->options_obj->tiktok->pixel_id) {
92
  $this->conversion_html_tiktok($shortcode_attributes);
93
  }
94
+ } elseif ('all' == $shortcode_attributes['pixel']) {
95
+ if ($this->is_google_ads_active()) {
96
  $this->conversion_html_google_ads($shortcode_attributes);
97
  }
98
  if ($this->options_obj->facebook->pixel_id) {
117
  }
118
 
119
  private function conversion_html_snapchat( $shortcode_attributes ) {
 
120
  ?>
121
 
122
  <script>
123
+ snaptr('track', '<?php echo esc_js($shortcode_attributes['snap-event']); ?>');
 
 
 
124
  </script>
125
  <?php
126
  }
127
 
128
  private function conversion_html_tiktok( $shortcode_attributes ) {
 
129
  ?>
130
 
131
  <script>
132
+ ttq.track('<?php echo esc_js($shortcode_attributes['tiktok-event']); ?>');
 
 
 
133
  </script>
134
  <?php
135
  }
136
 
137
  private function conversion_html_google_ads( $shortcode_attributes ) {
 
138
  ?>
139
 
140
  <script>
141
+ if (googleConfigConditionsMet('ads')) gtag('event', 'conversion', {'send_to': 'AW-<?php echo esc_js($shortcode_attributes['gads-conversion-id']); ?>/<?php echo esc_js($shortcode_attributes['gads-conversion-label']); ?>'});
 
 
 
142
  </script>
143
  <?php
144
  }
145
 
146
  // https://developers.facebook.com/docs/analytics/send_data/events/
147
  private function conversion_html_facebook( $shortcode_attributes ) {
 
148
  if ($this->options_obj->facebook->capi->token) {
149
  ?>
150
 
151
  <script>
152
+ jQuery(window).on('load', function () {
153
 
154
+ let eventId = wpm.getRandomEventId();
155
 
156
+ fbq('track', '<?php echo esc_js($shortcode_attributes['fbc-event']); ?>', {}, {
157
+ eventID: eventId,
158
+ });
 
 
 
159
 
160
+ jQuery(document).trigger('wpmFbCapiEvent', {
161
  event_name : "<?php echo esc_js($shortcode_attributes['fbc-event']); ?>",
162
  event_id : eventId,
163
  user_data : wpm.getFbUserData(),
164
+ event_source_url: window.location.href
165
+ });
166
+ });
167
 
168
  </script>
169
  <?php
171
  ?>
172
 
173
  <script>
174
+ fbq('track', '<?php echo esc_js($shortcode_attributes['fbc-event']); ?>');
 
 
 
175
  </script>
176
  <?php
177
  }
179
 
180
  // https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
181
  private function conversion_html_twitter( $shortcode_attributes ) {
 
182
  ?>
183
 
184
  <script>
185
+ twq('track', '<?php echo esc_js($shortcode_attributes['twc-event']); ?>');
 
 
 
186
  </script>
187
  <?php
188
  }
190
  // https://help.pinterest.com/en/business/article/track-conversions-with-pinterest-tag
191
  // https://help.pinterest.com/en/business/article/add-event-codes
192
  private function conversion_html_pinterest( $shortcode_attributes ) {
193
+ if ('' == $shortcode_attributes['pinc-lead-type']) {
 
194
  ?>
195
 
196
  <script>
197
+ pintrk('track', '<?php echo esc_js($shortcode_attributes['pinc-event']); ?>');
 
 
 
198
  </script>
199
  <?php
200
  } else {
201
  ?>
202
 
203
  <script>
204
+ pintrk('track', '<?php echo esc_js($shortcode_attributes['pinc-event']); ?>', {
205
+ lead_type: '<?php echo esc_js($shortcode_attributes['pinc-lead-type']); ?>'
206
+ });
 
 
 
207
  </script>
208
  <?php
209
  }
214
  ?>
215
 
216
  <script>
217
+ window.uetq = window.uetq || [];
218
+ window.uetq.push('event', '<?php echo esc_js($shortcode_attributes['ms-ads-event']); ?>', {
219
+ 'event_category': '<?php echo esc_js($shortcode_attributes['ms-ads-event-category']); ?>',
220
+ 'event_label' : '<?php echo esc_js($shortcode_attributes['ms-ads-event-label']); ?>',
221
+ 'event_value' : '<?php echo esc_js($shortcode_attributes['ms-ads-event-value']); ?>'
222
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  </script>
224
  <?php
225
  }
classes/pixels/facebook/class-facebook-pixel-manager-microdata.php CHANGED
@@ -2,13 +2,13 @@
2
 
3
  namespace WCPM\Classes\Pixels\Facebook;
4
 
5
- use WCPM\Classes\Pixels\Script_Manager;
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
9
  }
10
 
11
- class Facebook_Pixel_Manager_Microdata extends Script_Manager {
12
  protected $facebook_microdata_pixel;
13
 
14
  public function __construct( $options ) {
2
 
3
  namespace WCPM\Classes\Pixels\Facebook;
4
 
5
+ use WCPM\Classes\Pixels\Pixel_Manager_Base;
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
9
  }
10
 
11
+ class Facebook_Pixel_Manager_Microdata extends Pixel_Manager_Base {
12
  protected $facebook_microdata_pixel;
13
 
14
  public function __construct( $options ) {
classes/pixels/facebook/class-facebook-pixel-manager.php CHANGED
@@ -3,19 +3,24 @@
3
  namespace WCPM\Classes\Pixels\Facebook;
4
 
5
  use WCPM\Classes\Http\Facebook_CAPI ;
 
6
 
7
  if ( !defined( 'ABSPATH' ) ) {
8
  exit;
9
  // Exit if accessed directly
10
  }
11
 
12
- class Facebook_Pixel_Manager
13
  {
 
14
  protected $facebook_capi ;
15
  public function __construct( $options )
16
  {
 
 
 
17
 
18
- if ( wpm_fs()->is__premium_only() && $options['facebook']['capi']['token'] ) {
19
  $this->facebook_capi = new Facebook_CAPI( $options );
20
  // Save the Facebook session identifiers on the order so that we can use them later when the order gets paid or completed
21
  // https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-checkout.html#source-view.403
@@ -32,5 +37,74 @@ class Facebook_Pixel_Manager
32
  }
33
 
34
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  }
3
  namespace WCPM\Classes\Pixels\Facebook;
4
 
5
  use WCPM\Classes\Http\Facebook_CAPI ;
6
+ use WCPM\Classes\Pixels\Pixel_Manager_Base ;
7
 
8
  if ( !defined( 'ABSPATH' ) ) {
9
  exit;
10
  // Exit if accessed directly
11
  }
12
 
13
+ class Facebook_Pixel_Manager extends Pixel_Manager_Base
14
  {
15
+ protected $facebook_browser_pixel ;
16
  protected $facebook_capi ;
17
  public function __construct( $options )
18
  {
19
+ parent::__construct( $options );
20
+ // add_action('wp_enqueue_scripts', [$this, 'wpm_facebook_front_end_scripts']);
21
+ $this->facebook_browser_pixel = new Facebook_Browser_Pixel( $options );
22
 
23
+ if ( wpm_fs()->is__premium_only() && $this->options_obj->facebook->capi->token ) {
24
  $this->facebook_capi = new Facebook_CAPI( $options );
25
  // Save the Facebook session identifiers on the order so that we can use them later when the order gets paid or completed
26
  // https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-checkout.html#source-view.403
37
  }
38
 
39
  }
40
+
41
+ public function wpm_facebook_front_end_scripts()
42
+ {
43
+ wp_enqueue_script(
44
+ 'wpm-facebook',
45
+ WPM_PLUGIN_DIR_PATH . 'js/public/footer/facebook' . $this->get_script_suffix(),
46
+ [ 'jquery', 'wpm' ],
47
+ // ['jquery'],
48
+ WPM_CURRENT_VERSION,
49
+ true
50
+ );
51
+ }
52
+
53
+ public function inject_everywhere()
54
+ {
55
+ $this->facebook_browser_pixel->inject_everywhere();
56
+ }
57
+
58
+ public function inject_search()
59
+ {
60
+ $this->facebook_browser_pixel->inject_search();
61
+ }
62
+
63
+ public function inject_product( $product, $product_attributes )
64
+ {
65
+ $this->facebook_browser_pixel->inject_product( $product, $product_attributes );
66
+ }
67
+
68
+ public function inject_cart( $cart, $cart_total )
69
+ {
70
+ $this->facebook_browser_pixel->inject_cart( $cart, $cart_total );
71
+ }
72
+
73
+ public function inject_order_received_page_dedupe( $order, $order_total, $is_new_customer )
74
+ {
75
+ $this->facebook_browser_pixel->inject_order_received_page( $order, $order_total, $is_new_customer );
76
+ }
77
+
78
+ public function inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer )
79
+ {
80
+ }
81
+
82
+ protected function inject_opening_script_tag()
83
+ {
84
+ echo PHP_EOL ;
85
+ echo ' <!-- START Facebook scripts -->' . PHP_EOL ;
86
+ // echo ' <script>';
87
+ $this->get_formatted_script_tag_new( [
88
+ 'async' => true,
89
+ 'defer' => false,
90
+ 'src' => '',
91
+ 'cookie_category' => 'ads',
92
+ 'pixel_name' => 'facebook-ads',
93
+ 'inject_cfasync' => false,
94
+ ] );
95
+ echo PHP_EOL ;
96
+ }
97
+
98
+ protected function inject_closing_script_tag()
99
+ {
100
+ echo PHP_EOL ;
101
+ echo ' </script>' ;
102
+ echo PHP_EOL ;
103
+ echo ' <!-- END Facebook scripts -->' . PHP_EOL ;
104
+ }
105
+
106
+ protected function inject_closing_script_after_tag()
107
+ {
108
+ }
109
 
110
  }
classes/pixels/google/class-google-ads.php CHANGED
@@ -54,11 +54,36 @@ class Google_Ads extends Google
54
  {
55
  $order_currency = $this->get_order_currency( $order );
56
  // if cart data beta is off and conversion id has been set
 
57
  if ( false == $this->add_cart_data && $this->options_obj->google->ads->conversion_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  if ( $this->is_dynamic_remarketing_active() ) {
59
  $this->get_dyn_remarketing_purchase_script( $order, $order_total );
60
  }
61
  }
 
62
  if ( true == $this->add_cart_data && $this->conversion_id && $this->conversion_label ) {
63
  if ( $this->is_dynamic_remarketing_active() ) {
64
  $this->get_dyn_remarketing_purchase_script( $order, $order_total );
@@ -69,41 +94,22 @@ class Google_Ads extends Google
69
  public function inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer )
70
  {
71
  $order_currency = $this->get_order_currency( $order );
72
- if ( $this->conversion_id && $this->conversion_label ) {
73
-
74
- if ( true == $this->add_cart_data ) {
75
- ?>
76
-
77
- if (googleConfigConditionsMet('ads')) gtag('event', 'conversion', <?php
78
- echo wp_json_encode( $this->get_google_ads_formatted_purchase_json(
79
- $order,
80
- $order_total,
81
- $order_currency,
82
- $is_new_customer
83
- ) ) ;
84
- ?>);
85
 
86
- <?php
87
- } else {
88
- ?>
 
 
 
 
 
89
 
90
- if (googleConfigConditionsMet('ads')) gtag('event', 'conversion', <?php
91
- echo wp_json_encode( $this->get_google_ads_formatted_conversion_object_cart_data_deactivated( $order, $order_total, $order_currency ) ) ;
92
- ?>);
93
- <?php
94
- }
95
-
96
  }
97
- }
98
 
99
- protected function get_google_ads_formatted_conversion_object_cart_data_deactivated( $order, $order_total, $order_currency )
100
- {
101
- return [
102
- 'send_to' => $this->get_google_ads_conversion_ids( true ),
103
- 'transaction_id' => $order->get_order_number(),
104
- 'currency' => $order_currency,
105
- 'value' => $order_total,
106
- ];
107
  }
108
 
109
  private function are_billing_and_shipping_addresses_equal( $order )
@@ -165,16 +171,16 @@ class Google_Ads extends Google
165
  // });
166
  // ";
167
  echo '
168
- wpmExists().then(function(){
169
- if (!wpm.isOrderIdStored("' . esc_js( $order->get_id() ) . '")) {
170
- if (googleConfigConditionsMet("ads")) gtag("event", "purchase", {
171
- send_to: ' . wp_json_encode( $this->get_google_ads_conversion_ids() ) . ',
172
- value : ' . esc_js( $order_total ) . ',
173
- items : ' . wp_json_encode( $this->get_order_items_for_google_ads_purchase_script( $order, true ) ) . '
174
- });
175
- }
176
- });
177
- ' ;
178
  }
179
 
180
  private function get_order_items_for_google_ads_purchase_script( $order, $dyn_r = false )
54
  {
55
  $order_currency = $this->get_order_currency( $order );
56
  // if cart data beta is off and conversion id has been set
57
+
58
  if ( false == $this->add_cart_data && $this->options_obj->google->ads->conversion_id ) {
59
+ // no deduper needed here
60
+ // Google does this server side
61
+
62
+ if ( $this->options_obj->google->ads->conversion_label ) {
63
+ ?>
64
+
65
+ if (googleConfigConditionsMet('ads')) gtag('event', 'conversion', {
66
+ 'send_to' : <?php
67
+ echo wp_json_encode( $this->get_google_ads_conversion_ids( true ) ) ;
68
+ ?>,
69
+ 'value' : <?php
70
+ echo esc_js( $order_total ) ;
71
+ ?>,
72
+ 'currency' : '<?php
73
+ echo esc_js( $order_currency ) ;
74
+ ?>',
75
+ 'transaction_id': '<?php
76
+ echo esc_js( $order->get_order_number() ) ;
77
+ ?>',
78
+ });
79
+ <?php
80
+ }
81
+
82
  if ( $this->is_dynamic_remarketing_active() ) {
83
  $this->get_dyn_remarketing_purchase_script( $order, $order_total );
84
  }
85
  }
86
+
87
  if ( true == $this->add_cart_data && $this->conversion_id && $this->conversion_label ) {
88
  if ( $this->is_dynamic_remarketing_active() ) {
89
  $this->get_dyn_remarketing_purchase_script( $order, $order_total );
94
  public function inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer )
95
  {
96
  $order_currency = $this->get_order_currency( $order );
97
+
98
+ if ( true == $this->add_cart_data && $this->conversion_id && $this->conversion_label ) {
99
+ ?>
 
 
 
 
 
 
 
 
 
 
100
 
101
+ if (googleConfigConditionsMet('ads')) gtag('event', 'purchase', <?php
102
+ echo wp_json_encode( $this->get_google_ads_formatted_purchase_json(
103
+ $order,
104
+ $order_total,
105
+ $order_currency,
106
+ $is_new_customer
107
+ ) ) ;
108
+ ?>);
109
 
110
+ <?php
 
 
 
 
 
111
  }
 
112
 
 
 
 
 
 
 
 
 
113
  }
114
 
115
  private function are_billing_and_shipping_addresses_equal( $order )
171
  // });
172
  // ";
173
  echo '
174
+ wpmExists().then(function(){
175
+ if (!wpm.isOrderIdStored("' . esc_js( $order->get_id() ) . '")) {
176
+ if (googleConfigConditionsMet("ads")) gtag("event", "purchase", {
177
+ send_to: ' . wp_json_encode( $this->get_google_ads_conversion_ids() ) . ',
178
+ value : ' . esc_js( $order_total ) . ',
179
+ items : ' . wp_json_encode( $this->get_order_items_for_google_ads_purchase_script( $order, true ) ) . '
180
+ });
181
+ }
182
+ });
183
+ ' ;
184
  }
185
 
186
  private function get_order_items_for_google_ads_purchase_script( $order, $dyn_r = false )
classes/pixels/google/class-google-analytics-refund.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
 
5
  use WC_Order_Refund ;
6
  use WC_Product ;
7
 
@@ -12,46 +13,10 @@ if ( !defined( 'ABSPATH' ) ) {
12
 
13
  class Google_Analytics_Refund extends Google_Analytics
14
  {
 
15
  public function __construct( $options )
16
  {
17
  parent::__construct( $options );
18
  }
19
-
20
- public function output_refund_to_frontend( $order, $refund, $dataLayer_refund_items = null )
21
- {
22
- $data = [
23
- 'send_to' => $this->options_obj->google->analytics->ga4->measurement_id,
24
- 'affiliation' => get_bloginfo( 'name' ),
25
- 'currency' => (string) $this->get_order_currency( $order ),
26
- 'items' => (array) $dataLayer_refund_items,
27
- 'transaction_id' => (string) $order->get_order_number(),
28
- 'shipping' => (double) $order->get_shipping_total(),
29
- 'tax' => (double) $order->get_total_tax(),
30
- 'value' => (double) $refund->get_amount(),
31
- ];
32
- ?>
33
- <script>
34
-
35
- if (typeof wpmFunctionExists !== 'function') {
36
- window.wpmFunctionExists = function (functionName) {
37
- return new Promise(function (resolve) {
38
- (function waitForVar() {
39
- if (typeof window[functionName] !== 'undefined') return resolve();
40
- setTimeout(waitForVar, 1000);
41
- })();
42
- });
43
- }
44
- }
45
-
46
- wpmFunctionExists('wpm').then(function () {
47
- if (wpm.googleConfigConditionsMet('analytics')) {
48
- gtag('event', 'refund', <?php
49
- echo wp_json_encode( $data ) ;
50
- ?>);
51
- }
52
- })
53
- </script>
54
- <?php
55
- }
56
 
57
  }
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
5
+ use WC_Order ;
6
  use WC_Order_Refund ;
7
  use WC_Product ;
8
 
13
 
14
  class Google_Analytics_Refund extends Google_Analytics
15
  {
16
+ use Trait_Google ;
17
  public function __construct( $options )
18
  {
19
  parent::__construct( $options );
20
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  }
classes/pixels/google/class-google-analytics.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
 
5
  use WCPM\Classes\Pixels\Trait_Shop;
6
 
7
  if (!defined('ABSPATH')) {
@@ -16,4 +17,51 @@ class Google_Analytics extends Google {
16
 
17
  $this->pixel_name = 'google_analytics';
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
5
+ use WCPM\Classes\Admin\Environment_Check;
6
  use WCPM\Classes\Pixels\Trait_Shop;
7
 
8
  if (!defined('ABSPATH')) {
17
 
18
  $this->pixel_name = 'google_analytics';
19
  }
20
+
21
+ protected function get_list_name_by_current_page_type( $list_id ) {
22
+ $list_names = [
23
+ 'add_payment_method_page' => 'Add Payment Method page',
24
+ 'cart' => 'Cart',
25
+ 'checkout' => 'Checkout Page',
26
+ 'checkout_pay_page' => 'Checkout Pay Page',
27
+ 'front_page' => 'Front Page',
28
+ 'order_received_page' => 'Order Received Page',
29
+ 'product' => 'Product',
30
+ 'product_category' => 'Product Category',
31
+ 'product_detail' => 'Product Detail',
32
+ 'product_tag' => 'Product Tag',
33
+ 'product_taxonomy' => 'Product Taxonomy',
34
+ 'search' => 'Search Page',
35
+ 'shop' => 'Shop Page',
36
+ ];
37
+
38
+ return $list_names[$list_id];
39
+ }
40
+
41
+
42
+
43
+
44
+
45
+ // public function inject_product_list_object($list_id)
46
+ // {
47
+ // global $wp_query;
48
+ //
49
+ // $items = [];
50
+ //
51
+ // $position = 1;
52
+ //
53
+ // $posts = $wp_query->posts;
54
+ //
55
+ // foreach ($posts as $key => $post) {
56
+ //
57
+ // if ($post->post_type == 'product' || $post->post_type == 'product_variation') {
58
+ //
59
+ // array_push($items, $this->eec_appweb_get_product_details_array($post->ID, $list_id, $position));
60
+ //
61
+ // $position++;
62
+ // }
63
+ // }
64
+ //
65
+ // $this->output_view_item_list_html($items, $list_id);
66
+ // }
67
  }
classes/pixels/google/class-google-pixel-manager.php CHANGED
@@ -4,55 +4,145 @@ namespace WCPM\Classes\Pixels\Google;
4
 
5
  use WCPM\Classes\Http\Google_MP_GA4 ;
6
  use WCPM\Classes\Http\Google_MP_UA ;
7
- use WCPM\Classes\Pixels\Script_Manager ;
8
 
9
  if ( !defined( 'ABSPATH' ) ) {
10
  exit;
11
  // Exit if accessed directly
12
  }
13
 
14
- class Google_Pixel_Manager extends Script_Manager
15
  {
 
16
  private $google_pixel ;
 
 
 
 
17
  private $google_analytics_ua_http_mp ;
18
  private $google_analytics_4_http_mp ;
 
 
19
  private $cid_key_ga_ua ;
20
  private $cid_key_ga4 ;
21
  public function __construct( $options )
22
  {
23
  parent::__construct( $options );
24
  $this->google_pixel = new Google( $options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
- protected function log_prevented_order_report_for_user( $order )
28
  {
29
-
 
30
  if ( is_user_logged_in() ) {
31
- $user_info = $order->get_user();
32
- wc_get_logger()->debug( 'Prevented order ID ' . $order->get_id() . ' to be reported through the Measurement Protocol for user ' . $user_info->user_login . ' (roles: ' . implode( ', ', $user_info->roles ) . ')', [
33
- 'source' => 'wpm',
34
- ] );
 
 
 
35
  }
36
-
37
  }
38
 
39
- public function inject_order_received_page_dedupe( $order, $order_total, $is_new_customer )
40
  {
41
- if ( $this->google_pixel->is_google_ads_active() && wpm_fs()->is__premium_only() ) {
42
- $this->save_gclid_in_order__premium_only( $order );
43
- }
 
 
 
 
 
 
 
 
44
  }
45
 
46
- public function inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer )
47
  {
48
- if ( $this->google_pixel->is_google_ads_active() && wpm_fs()->is__premium_only() ) {
49
- $this->save_gclid_in_order__premium_only( $order );
50
- }
51
  }
52
 
53
- public function inject_everywhere()
 
 
 
 
54
  {
55
- // $this->google_pixel->inject_everywhere();
56
  }
57
 
58
  public function inject_product_category()
@@ -85,12 +175,48 @@ class Google_Pixel_Manager extends Script_Manager
85
  // all handled on front-end
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  protected function inject_opening_script_tag()
89
  {
 
 
 
90
  }
91
 
92
  protected function inject_closing_script_tag()
93
  {
 
 
 
 
 
94
  }
95
 
96
  }
4
 
5
  use WCPM\Classes\Http\Google_MP_GA4 ;
6
  use WCPM\Classes\Http\Google_MP_UA ;
7
+ use WCPM\Classes\Pixels\Pixel_Manager_Base ;
8
 
9
  if ( !defined( 'ABSPATH' ) ) {
10
  exit;
11
  // Exit if accessed directly
12
  }
13
 
14
+ class Google_Pixel_Manager extends Pixel_Manager_Base
15
  {
16
+ use Trait_Google ;
17
  private $google_pixel ;
18
+ private $google_ads_pixel ;
19
+ private $google_analytics_ua_standard_pixel ;
20
+ private $google_analytics_4_standard_pixel ;
21
+ private $google_analytics_ua_eec_pixel ;
22
  private $google_analytics_ua_http_mp ;
23
  private $google_analytics_4_http_mp ;
24
+ // private $google_analytics_ua_refund_pixel;
25
+ private $google_analytics_4_eec_pixel ;
26
  private $cid_key_ga_ua ;
27
  private $cid_key_ga4 ;
28
  public function __construct( $options )
29
  {
30
  parent::__construct( $options );
31
  $this->google_pixel = new Google( $options );
32
+ if ( $this->is_google_ads_active() ) {
33
+ if ( $this->is_google_ads_active() ) {
34
+ $this->google_ads_pixel = new Google_Ads( $options );
35
+ }
36
+ }
37
+ // add_action('wp_enqueue_scripts', [$this, 'google_front_end_scripts']);
38
+
39
+ if ( !wpm_fs()->is__premium_only() || !$this->options_obj->google->analytics->eec ) {
40
+ if ( $this->is_google_analytics_ua_active() ) {
41
+ $this->google_analytics_ua_standard_pixel = new Google_Analytics_UA_Standard( $options );
42
+ }
43
+ if ( $this->is_google_analytics_4_active() ) {
44
+ $this->google_analytics_4_standard_pixel = new Google_Analytics_4_Standard( $options );
45
+ }
46
+ } else {
47
+ $this->google_analytics_ua_eec_pixel = new Google_Analytics_UA_EEC( $options );
48
+ // $this->google_analytics_ua_refund_pixel = new Google_Analytics_UA_Refund_Pixel();
49
+ $this->google_analytics_4_eec_pixel = new Google_Analytics_4_EEC( $options );
50
+
51
+ if ( $this->is_google_analytics_active() ) {
52
+ // woocommerce_order_status_refunded
53
+ // woocommerce_order_refunded
54
+ // woocommerce_order_partially_refunded
55
+ // https://github.com/woocommerce/woocommerce/blob/b19500728b4b292562afb65eb3a0c0f50d5859de/includes/wc-order-functions.php#L614
56
+ // woocommerce_order_fully_refunded
57
+ // https://github.com/woocommerce/woocommerce/blob/b19500728b4b292562afb65eb3a0c0f50d5859de/includes/wc-order-functions.php#L616
58
+ // how to tell if order is fully refunded
59
+ // https://github.com/woocommerce/woocommerce/blob/b19500728b4b292562afb65eb3a0c0f50d5859de/includes/wc-order-functions.php#L774
60
+ $this->google_analytics_ua_http_mp = new Google_MP_UA( $options );
61
+ $this->google_analytics_4_http_mp = new Google_MP_GA4( $options );
62
+ $this->cid_key_ga_ua = 'google_cid_' . $this->options_obj->google->analytics->universal->property_id;
63
+ $this->cid_key_ga4 = 'google_cid_' . $this->options_obj->google->analytics->ga4->measurement_id;
64
+ // error_log('running mp scripts');
65
+ // add_action('woocommerce_order_refunded', [$this, 'google_analytics_eec_action_woocommerce_order_refunded__premium_only'], 10, 2);
66
+ // Save the Google cid on the order so that we can use it later when the order gets paid or completed
67
+ // https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-checkout.html#source-view.403
68
+ add_action( 'woocommerce_checkout_order_created', [ $this, 'google_analytics_save_cid_on_order__premium_only' ] );
69
+ // Process the purchase through the GA Measurement Protocol when they are paid, when they change to processing, or
70
+ // when they are manually set to completed.
71
+ // https://docs.woocommerce.com/document/managing-orders/
72
+ // Maybe also use woocommerce_pre_payment_complete
73
+ // https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-order.html#source-view.105
74
+ add_action( 'woocommerce_order_status_processing', [ $this, 'google_analytics_mp_report_purchase__premium_only' ] );
75
+ add_action( 'woocommerce_payment_complete', [ $this, 'google_analytics_mp_report_purchase__premium_only' ] );
76
+ add_action( 'woocommerce_order_status_completed', [ $this, 'google_analytics_mp_report_purchase__premium_only' ] );
77
+ // Process total an partial refunds
78
+ add_action(
79
+ 'woocommerce_order_fully_refunded',
80
+ [ $this, 'google_analytics_mp_send_full_refund__premium_only' ],
81
+ 10,
82
+ 2
83
+ );
84
+ add_action(
85
+ 'woocommerce_order_partially_refunded',
86
+ [ $this, 'google_analytics_mp_send_partial_refund__premium_only' ],
87
+ 10,
88
+ 2
89
+ );
90
+ // Process subscription renewals
91
+ // https://docs.woocommerce.com/document/subscriptions/develop/action-reference/
92
+ add_action(
93
+ 'woocommerce_subscription_renewal_payment_complete',
94
+ [ $this, 'google_analytics_mp_report_subscription_purchase_renewal__premium_only' ],
95
+ 10,
96
+ 2
97
+ );
98
+ }
99
+
100
+ }
101
+
102
+ add_action( 'init', [ $this, 'run_on_init' ] );
103
  }
104
 
105
+ public function run_on_init()
106
  {
107
+ // function to only fire gtag login once after login
108
+ // and then wait for the next session
109
  if ( is_user_logged_in() ) {
110
+
111
+ if ( !isset( $_COOKIE['gtag_logged_in'] ) ) {
112
+ add_action( 'wp_footer', [ $this, 'output_gtag_login' ] );
113
+ // the cookie expires after the session
114
+ setcookie( 'gtag_logged_in', 'true' );
115
+ }
116
+
117
  }
 
118
  }
119
 
120
+ public function output_gtag_login()
121
  {
122
+ $data = [
123
+ 'user_id' => get_current_user_id(),
124
+ ];
125
+ ?>
126
+
127
+ <script>
128
+ gtag('event', 'login', <?php
129
+ echo wp_json_encode( $data ) ;
130
+ ?>);
131
+ </script>
132
+ <?php
133
  }
134
 
135
+ public function inject_everywhere()
136
  {
137
+ $this->google_pixel->inject_everywhere();
 
 
138
  }
139
 
140
+ // public function inject_product_category()
141
+ // {
142
+ // $this->google_pixel->inject_product_category();
143
+ // }
144
+ public function google_front_end_scripts()
145
  {
 
146
  }
147
 
148
  public function inject_product_category()
175
  // all handled on front-end
176
  }
177
 
178
+ public function inject_order_received_page_dedupe( $order, $order_total, $is_new_customer )
179
+ {
180
+ if ( $this->is_google_ads_active() ) {
181
+ $this->google_ads_pixel->inject_order_received_page_dedupe( $order, $order_total, $is_new_customer );
182
+ }
183
+
184
+ if ( !wpm_fs()->is__premium_only() || !$this->options_obj->google->analytics->eec ) {
185
+ if ( $this->is_google_analytics_ua_active() ) {
186
+ $this->google_analytics_ua_standard_pixel->inject_order_received_page( $order, $order_total, $is_new_customer );
187
+ }
188
+ if ( $this->is_google_analytics_4_active() ) {
189
+ $this->google_analytics_4_standard_pixel->inject_order_received_page( $order, $order_total, $is_new_customer );
190
+ }
191
+ } else {
192
+ if ( $this->is_google_analytics_4_active() && !$this->options_obj->google->analytics->ga4->api_secret ) {
193
+ $this->google_analytics_4_eec_pixel->inject_order_received_page( $order, $order_total, $is_new_customer );
194
+ }
195
+ }
196
+
197
+ }
198
+
199
+ public function inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer )
200
+ {
201
+ if ( $this->is_google_ads_active() ) {
202
+ $this->google_ads_pixel->inject_order_received_page_no_dedupe( $order, $order_total, $is_new_customer );
203
+ }
204
+ }
205
+
206
  protected function inject_opening_script_tag()
207
  {
208
+ echo PHP_EOL ;
209
+ echo ' <!-- START Google scripts -->' . PHP_EOL ;
210
+ // echo PHP_EOL;
211
  }
212
 
213
  protected function inject_closing_script_tag()
214
  {
215
+ echo PHP_EOL ;
216
+ echo "\t\t" . '//# sourceURL=wpmGoogleInlineScripts.js' . PHP_EOL ;
217
+ echo "\t\t" . '</script>' ;
218
+ echo PHP_EOL . PHP_EOL ;
219
+ echo "\t" . '<!-- END Google scripts -->' . PHP_EOL ;
220
  }
221
 
222
  }
classes/pixels/google/class-google.php CHANGED
@@ -13,167 +13,338 @@ if ( !defined( 'ABSPATH' ) ) {
13
 
14
  class Google extends Pixel
15
  {
 
16
  use Trait_Shop ;
 
17
  public function __construct( $options )
18
  {
19
  parent::__construct( $options );
20
  $this->google_business_vertical = $this->get_google_business_vertical( $this->options['google']['ads']['google_business_vertical'] );
21
- $this->pixel_name = 'google';
22
- }
23
-
24
- public function get_order_item_data( $order_item )
25
- {
26
- $product = $order_item->get_product();
27
-
28
- if ( !is_object( $product ) ) {
29
- wc_get_logger()->debug( 'get_order_item_data received an order item which is not a valid product: ' . $order_item->get_id(), [
30
- 'source' => 'wpm',
31
- ] );
32
- return [];
33
- }
34
-
35
- $dyn_r_ids = $this->get_dyn_r_ids( $product );
36
-
37
- if ( $product->get_type() === 'variation' ) {
38
- $parent_product = wc_get_product( $product->get_parent_id() );
39
- $name = $parent_product->get_name();
40
- } else {
41
- $name = $product->get_name();
42
- }
43
-
44
- return [
45
- 'id' => (string) $dyn_r_ids[$this->get_ga_id_type()],
46
- 'name' => (string) $name,
47
- 'quantity' => (int) $order_item['quantity'],
48
- 'affiliation' => (string) get_bloginfo( 'name' ),
49
- 'brand' => (string) $this->get_brand_name( $product->get_id() ),
50
- 'category' => implode( ',', $this->get_product_category( $product->get_id() ) ),
51
- 'category_array' => $this->get_product_category( $product->get_id() ),
52
- 'variant' => ( (string) ($product->get_type() === 'variation') ? $this->get_formatted_variant_text( $product ) : '' ),
53
- 'price' => (double) $this->wpm_get_order_item_price( $order_item, $product ),
54
- ];
55
- }
56
-
57
- public function get_ga_id_type()
58
- {
59
- $ga_id_type = 'post_id';
60
- $ga_id_type = apply_filters_deprecated(
61
- 'wooptpm_product_id_type_for_google_analytics',
62
- [ $ga_id_type ],
63
  '1.13.0',
64
- 'wpm_product_id_type_for_google_analytics'
65
  );
66
- // Change the output of the product ID type for Google Analytics
67
- return apply_filters( 'wpm_product_id_type_for_google_analytics', $ga_id_type );
68
  }
69
 
70
- public function google_active()
71
  {
72
-
73
- if ( $this->options_obj->google->analytics->universal->property_id ) {
74
- return true;
75
- } elseif ( $this->options_obj->google->analytics->ga4->measurement_id ) {
76
- return true;
77
- } elseif ( $this->options_obj->google->ads->conversion_id ) {
78
- return true;
79
- } else {
80
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
- public function is_google_ads_active()
86
  {
87
-
88
- if ( $this->options['google']['ads']['conversion_id'] ) {
89
- return true;
90
- } else {
91
- return false;
92
  }
93
-
 
 
 
94
  }
95
 
96
- public function is_google_analytics_active()
97
  {
98
-
99
- if ( $this->is_google_analytics_ua_active() || $this->is_google_analytics_4_active() ) {
100
- return true;
101
- } else {
102
- return false;
103
- }
104
-
 
 
105
  }
106
 
107
- public function is_google_analytics_ua_active()
108
  {
109
-
110
- if ( $this->options_obj->google->analytics->universal->property_id ) {
111
- return true;
112
- } else {
113
- return false;
114
- }
115
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
 
118
- protected function is_google_analytics_4_active()
 
119
  {
 
 
 
 
 
 
 
120
 
121
- if ( $this->options_obj->google->analytics->ga4->measurement_id ) {
122
- return true;
123
  } else {
124
- return false;
125
  }
126
 
127
  }
128
 
129
- public function is_google_analytics_4_mp_active()
 
130
  {
 
 
 
 
 
 
 
131
 
132
- if ( $this->options_obj->google->analytics->ga4->measurement_id && $this->options_obj->google->analytics->ga4->api_secret ) {
133
- return true;
134
- } else {
135
- return false;
 
 
 
136
  }
137
 
138
  }
139
 
140
- public function wpm_get_order_item_price( $order_item, $product )
141
  {
142
 
143
- if ( ( new Environment_Check( $this->options ) )->is_woo_discount_rules_active() ) {
144
- $item_value = $order_item->get_meta( '_advanced_woo_discount_item_total_discount' );
145
-
146
- if ( is_array( $item_value ) && array_key_exists( 'discounted_price', $item_value ) && 0 != $item_value['discounted_price'] ) {
147
- return (double) $item_value['discounted_price'];
148
- } elseif ( is_array( $item_value ) && array_key_exists( 'initial_price', $item_value ) && 0 != $item_value['initial_price'] ) {
149
- return (double) $item_value['initial_price'];
150
- } else {
151
- return (double) $product->get_price();
152
  }
153
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  } else {
155
- return (double) $product->get_price();
156
  }
157
 
158
  }
159
 
160
- public function add_categories_to_ga4_product_items( $item_details_array, $categories )
161
  {
162
- $categories = array_unique( $categories );
163
 
164
- if ( count( $categories ) > 0 ) {
165
- $max_categories = 5;
166
- $item_details_array['item_category'] = $categories[0];
167
- $max = ( count( $categories ) > $max_categories ? $max_categories : count( $categories ) );
168
- for ( $i = 1 ; $i < $max ; $i++ ) {
169
- $item_details_array['item_category' . ($i + 1)] = $categories[$i];
 
 
170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
172
-
173
- return $item_details_array;
174
  }
175
 
176
- public function get_google_business_vertical( $id )
177
  {
178
  $verticals = [
179
  0 => 'retail',
@@ -189,218 +360,283 @@ class Google extends Pixel
189
  return $verticals[$id];
190
  }
191
 
192
- public function get_google_ads_conversion_ids( $purchase = false )
193
  {
194
- $this->google_ads_conversion_identifiers[$this->options['google']['ads']['conversion_id']] = $this->options['google']['ads']['conversion_label'];
195
- $this->google_ads_conversion_identifiers = apply_filters_deprecated(
196
- 'wgact_google_ads_conversion_identifiers',
197
- [ $this->google_ads_conversion_identifiers ],
198
- '1.10.2',
199
- 'wooptpm_google_ads_conversion_identifiers'
200
- );
201
- $this->google_ads_conversion_identifiers = apply_filters_deprecated(
202
- 'wooptpm_google_ads_conversion_identifiers',
203
- [ $this->google_ads_conversion_identifiers ],
204
- '1.13.0',
205
- 'wpm_google_ads_conversion_identifiers'
206
- );
207
- $this->google_ads_conversion_identifiers = apply_filters( 'wpm_google_ads_conversion_identifiers', $this->google_ads_conversion_identifiers );
208
- $formatted_conversion_ids = [];
209
-
210
- if ( $purchase ) {
211
- foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
212
- $conversion_id = $this->extract_google_ads_id( $conversion_id );
213
- if ( $conversion_id ) {
214
- $formatted_conversion_ids['AW-' . $conversion_id] = $conversion_label;
215
- }
216
  }
217
- } else {
218
- foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
219
- $conversion_id = $this->extract_google_ads_id( $conversion_id );
220
- if ( $conversion_id ) {
221
- $formatted_conversion_ids['AW-' . $conversion_id] = '';
222
- }
 
 
223
  }
224
- }
225
-
226
- return $formatted_conversion_ids;
227
- }
228
-
229
- protected function extract_google_ads_id( $string )
230
- {
231
- $re = '/\\d{9,11}/';
232
-
233
- if ( $string ) {
234
- preg_match(
235
- $re,
236
- $string,
237
- $matches,
238
- PREG_OFFSET_CAPTURE,
239
- 0
240
- );
241
- if ( is_array( $matches[0] ) ) {
242
- return $matches[0][0];
243
  }
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
-
246
- return '';
 
 
 
 
 
 
 
247
  }
248
 
249
- public function get_google_ads_enhanced_conversion_data( $order )
 
 
 
 
 
 
250
  {
251
- $customer_data = [];
252
- if ( $order->get_billing_email() ) {
253
- $customer_data['email'] = (string) $order->get_billing_email();
254
- }
255
- if ( $order->get_billing_phone() ) {
256
- $customer_data['phone_number'] = $this->get_e164_formatted_phone_number( (string) $order->get_billing_phone(), (string) $order->get_billing_country() );
257
- }
258
 
259
- if ( $this->are_billing_and_shipping_addresses_equal( $order ) ) {
260
- $customer_data['address'] = $this->get_billing_address_details( $order );
 
 
 
 
 
261
  } else {
262
- $customer_data['address'][] = $this->get_billing_address_details( $order );
263
- $customer_data['address'][] = $this->get_shipping_address_details( $order );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  }
265
 
266
- return $customer_data;
267
  }
268
 
269
- protected function get_billing_address_details( $order )
270
  {
271
- $customer_data = [];
272
- if ( $order->get_billing_first_name() ) {
273
- $customer_data['first_name'] = (string) $order->get_billing_first_name();
274
- }
275
- if ( $order->get_billing_last_name() ) {
276
- $customer_data['last_name'] = (string) $order->get_billing_last_name();
277
- }
278
- if ( $order->get_billing_address_1() ) {
279
- $customer_data['street'] = (string) $order->get_billing_address_1();
280
- }
281
- if ( $order->get_billing_city() ) {
282
- $customer_data['city'] = (string) $order->get_billing_city();
283
- }
284
- if ( $order->get_billing_state() ) {
285
- $customer_data['region'] = (string) $order->get_billing_state();
286
- }
287
- if ( $order->get_billing_postcode() ) {
288
- $customer_data['postal_code'] = (string) $order->get_billing_postcode();
289
- }
290
- if ( $order->get_billing_country() ) {
291
- $customer_data['country'] = (string) $order->get_billing_country();
292
- }
293
- return $customer_data;
294
  }
295
 
296
- protected function get_shipping_address_details( $order )
297
  {
298
- $customer_data = [];
299
- if ( $order->get_shipping_first_name() ) {
300
- $customer_data['first_name'] = (string) $order->get_shipping_first_name();
301
- }
302
- if ( $order->get_shipping_last_name() ) {
303
- $customer_data['last_name'] = (string) $order->get_shipping_last_name();
304
- }
305
- if ( $order->get_shipping_address_1() ) {
306
- $customer_data['street'] = (string) $order->get_shipping_address_1();
307
- }
308
- if ( $order->get_shipping_city() ) {
309
- $customer_data['city'] = (string) $order->get_shipping_city();
310
- }
311
- if ( $order->get_shipping_state() ) {
312
- $customer_data['region'] = (string) $order->get_shipping_state();
313
- }
314
- if ( $order->get_shipping_postcode() ) {
315
- $customer_data['postal_code'] = (string) $order->get_shipping_postcode();
316
- }
317
- if ( $order->get_shipping_country() ) {
318
- $customer_data['country'] = (string) $order->get_shipping_country();
319
  }
320
- return $customer_data;
 
321
  }
322
 
323
- private function are_billing_and_shipping_addresses_equal( $order )
324
  {
325
 
326
- if ( $order->get_billing_first_name() === $order->get_shipping_first_name() && $order->get_billing_last_name() === $order->get_shipping_last_name() && $order->get_billing_address_1() === $order->get_shipping_address_1() && $order->get_billing_city() === $order->get_shipping_city() && $order->get_billing_state() === $order->get_shipping_state() && $order->get_billing_postcode() === $order->get_shipping_postcode() && $order->get_billing_country() === $order->get_shipping_country() ) {
327
- return true;
 
 
 
 
328
  } else {
329
- return false;
330
  }
331
 
332
  }
333
 
334
- public function get_gmc_language()
335
  {
336
- return strtoupper( substr( get_locale(), 0, 2 ) );
337
- }
338
-
339
- // https://developers.google.com/gtagjs/devguide/linker
340
- public function get_google_linker_settings()
341
- {
342
- $linker_settings = apply_filters_deprecated(
343
- 'wooptpm_google_cross_domain_linker_settings',
344
- [ null ],
345
  '1.13.0',
346
- 'wpm_google_cross_domain_linker_settings'
347
- );
348
- return apply_filters( 'wpm_google_cross_domain_linker_settings', $linker_settings );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  }
350
 
351
- public function get_ga4_parameters( $id )
352
  {
353
- $ga_4_parameters = [];
354
- if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
355
- $ga_4_parameters = [
356
- 'user_id' => get_current_user_id(),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  }
359
- $ga_4_parameters = apply_filters_deprecated(
360
- 'wooptpm_ga_4_parameters',
361
- [ $ga_4_parameters, $id ],
362
- '1.13.0',
363
- 'wpm_ga_4_parameters'
364
- );
365
- return apply_filters( 'wpm_ga_4_parameters', $ga_4_parameters, $id );
366
- }
367
 
368
- public function get_ga_ua_parameters( $id )
369
- {
370
- $ga_ua_parameters = [
371
- 'anonymize_ip' => true,
372
- 'link_attribution' => (bool) $this->options_obj->google->analytics->link_attribution,
373
- ];
374
- if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
375
- $ga_ua_parameters['user_id'] = get_current_user_id();
376
- }
377
- $ga_ua_parameters = apply_filters_deprecated(
378
- 'woopt_pm_analytics_parameters',
379
- [ $ga_ua_parameters, $id ],
380
- '1.10.10',
381
- 'wooptpm_ga_ua_parameters'
382
- );
383
- $ga_ua_parameters = apply_filters_deprecated(
384
- 'wooptpm_ga_ua_parameters',
385
- [ $ga_ua_parameters, $id ],
386
- '1.13.0',
387
- 'wpm_ga_ua_parameters'
388
- );
389
- return apply_filters( 'wpm_ga_ua_parameters', $ga_ua_parameters, $id );
390
  }
391
 
392
- public function get_all_refund_products( $refund )
393
  {
394
- $data = [];
395
- $item_index = 1;
396
- foreach ( $refund->get_items() as $item_id => $item ) {
397
- // $product = new WC_Product($refund_item->get_product_id());
398
- $order_item_data = $this->google->get_order_item_data( $item );
399
- $data['pr' . $item_index . 'id'] = $order_item_data['id'];
400
- $data['pr' . $item_index . 'qt'] = -1 * $order_item_data['quantity'];
401
- $item_index++;
402
- }
403
- return $data;
404
  }
405
 
406
  }
13
 
14
  class Google extends Pixel
15
  {
16
+ use Trait_Google ;
17
  use Trait_Shop ;
18
+ protected $google_ads_conversion_identifiers ;
19
  public function __construct( $options )
20
  {
21
  parent::__construct( $options );
22
  $this->google_business_vertical = $this->get_google_business_vertical( $this->options['google']['ads']['google_business_vertical'] );
23
+ $this->google_ads_conversion_identifiers[$this->conversion_id] = $this->conversion_label;
24
+ $this->google_ads_conversion_identifiers = apply_filters_deprecated(
25
+ 'wgact_google_ads_conversion_identifiers',
26
+ [ $this->google_ads_conversion_identifiers ],
27
+ '1.10.2',
28
+ 'wooptpm_google_ads_conversion_identifiers'
29
+ );
30
+ $this->google_ads_conversion_identifiers = apply_filters_deprecated(
31
+ 'wooptpm_google_ads_conversion_identifiers',
32
+ [ $this->google_ads_conversion_identifiers ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  '1.13.0',
34
+ 'wpm_google_ads_conversion_identifiers'
35
  );
36
+ $this->google_ads_conversion_identifiers = apply_filters( 'wpm_google_ads_conversion_identifiers', $this->google_ads_conversion_identifiers );
37
+ $this->pixel_name = 'google_ads';
38
  }
39
 
40
+ public function inject_everywhere()
41
  {
42
+ $this->inject_data_layer_pixels();
43
+ if ( $this->options_obj->google->optimize->container_id ) {
44
+ // echo '<script async ';
45
+ // echo 'src="https://www.googleoptimize.com/optimize.js?id=' . $this->options_obj->google->optimize->container_id . '"';
46
+ // echo ' data-wpm-src="https://www.googleoptimize.com/optimize.js?id=' . $this->options_obj->google->optimize->container_id . '"';
47
+ // echo $this->script_type_value('analytics');
48
+ // echo '></script>';
49
+ // echo PHP_EOL;
50
+ // echo $this->get_formatted_script_tag_new([
51
+ // 'async' => true,
52
+ // 'defer' => false,
53
+ // 'src' => "https://www.googleoptimize.com/optimize.js?id=" . $this->options_obj->google->optimize->container_id,
54
+ // 'cookie_category' => 'analytics',
55
+ // 'pixel_name' => 'google-optimize',
56
+ // 'inject_cfasync' => false,
57
+ //
58
+ // ]) . PHP_EOL;
59
+ $this->get_formatted_script_tag_new( [
60
+ 'async' => true,
61
+ 'defer' => false,
62
+ 'src' => 'https://www.googleoptimize.com/optimize.js?id=' . $this->options_obj->google->optimize->container_id,
63
+ 'cookie_category' => 'analytics',
64
+ 'pixel_name' => 'google-optimize',
65
+ 'inject_cfasync' => false,
66
+ ] );
67
  }
68
+ // echo "\t\t" . '<script async src="https://www.googletagmanager.com/gtag/js?id=' . $this->get_gtag_id() . '"' . $this->explicit_consent_mode_type_value($this->get_cookie_category()) . '></script>';
69
+ // echo "\t\t";
70
+ // echo '<script async ';
71
+ // echo 'src="https://www.googletagmanager.com/gtag/js?id=' . $this->get_gtag_id() . '"';
72
+ // echo !$this->options_obj->google->consent_mode->active ? ' data-wpm-src="https://www.googletagmanager.com/gtag/js?id=' . $this->get_gtag_id() . '"' : '';
73
+ // echo !$this->options_obj->google->consent_mode->active ? $this->script_type_value($this->get_cookie_category()) : '';
74
+ // echo '></script>';
75
+ // echo "\t\t" . $this->get_formatted_script_tag_new([
76
+ // 'async' => true,
77
+ // 'defer' => false,
78
+ // 'src' => 'https://www.googletagmanager.com/gtag/js?id=' . $this->get_gtag_id(),
79
+ // 'cookie_category' => $this->get_cookie_category(),
80
+ // 'pixel_name' => 'google',
81
+ // 'inject_cfasync' => false,
82
+ //
83
+ //
84
+ // ]) . PHP_EOL;
85
+ $this->get_formatted_script_tag_new( [
86
+ 'async' => true,
87
+ 'defer' => false,
88
+ 'src' => 'https://www.googletagmanager.com/gtag/js?id=' . $this->get_gtag_id(),
89
+ 'cookie_category' => $this->get_cookie_category(),
90
+ 'pixel_name' => 'google',
91
+ 'inject_cfasync' => false,
92
+ ] );
93
+ $this->get_modified_script_opening_tag();
94
+ $this->get_google_init_js();
95
+ foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
96
+ echo esc_js( ( $this->options_obj->google->ads->conversion_id ? $this->gtag_config( $conversion_id, 'ads' ) : '' ) ) . PHP_EOL ;
97
+ }
98
+ ?>
99
+
100
+ <?php
101
+ echo esc_js( ( $this->options_obj->google->analytics->universal->property_id ? $this->gtag_config( $this->options_obj->google->analytics->universal->property_id, 'ga_ua' ) : '' ) ) . PHP_EOL ;
102
+ ?>
103
+
104
+ <?php
105
+ echo esc_js( ( $this->options_obj->google->analytics->ga4->measurement_id ? $this->gtag_config( $this->options_obj->google->analytics->ga4->measurement_id, 'ga_4' ) : '' ) ) ;
106
+ ?>
107
+
108
+ <?php
109
+ if ( $this->is_google_ads_active() && $this->options_obj->google->ads->phone_conversion_number && $this->options_obj->google->ads->phone_conversion_label ) {
110
+ $this->inject_phone_conversion_number_html__premium_only();
111
+ }
112
+ // if ($this->options_obj->google->consent_mode->active && (new Environment_Check())->is_borlabs_cookie_active()) {
113
+ // echo $this->inject_borlabs_consent_mode_update();
114
+ // }
115
+ // $this->inject_closing_script_tag();
116
  }
117
 
118
+ public function get_cookie_category()
119
  {
120
+ $data = [];
121
+ if ( $this->options_obj->google->analytics->universal->property_id || $this->options_obj->google->analytics->ga4->measurement_id ) {
122
+ $data[] = 'analytics';
 
 
123
  }
124
+ if ( $this->options_obj->google->ads->conversion_id ) {
125
+ $data[] = 'ads';
126
+ }
127
+ return implode( ',', $data );
128
  }
129
 
130
+ private function get_modified_script_opening_tag()
131
  {
132
+ $this->get_formatted_script_tag_new( [
133
+ 'async' => true,
134
+ 'defer' => false,
135
+ 'src' => '',
136
+ 'cookie_category' => 'analytics,ads',
137
+ 'pixel_name' => 'google',
138
+ 'inject_cfasync' => false,
139
+ 'cookiebot-cookieconsent' => $this->options_obj->shop->cookie_consent_mgmt->cookiebot->active || ( new Environment_Check() )->is_some_cmp_active(),
140
+ ] );
141
  }
142
 
143
+ protected function get_google_init_js()
144
  {
145
+ // @formatter:off
146
+ ?>
147
+
148
+ function googleConfigConditionsMet(type){
149
+ if (typeof wpm != 'undefined' && typeof wpm.googleConfigConditionsMet === 'function') {
150
+ return wpm.googleConfigConditionsMet(type)
151
+ } else {
152
+ console.error('wpm is not defined. That means you are deferring the script which you shouldn\'t. wpm must be loaded before the inline scripts run. Visitor tracking will continue to work, but visitor cookie consent will be ignored.')
153
+ return true
154
+ }
155
+ }
156
+
157
+ function getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings){
158
+ if (typeof wpm != 'undefined' && typeof wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings === 'function') {
159
+ return wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)
160
+ } else {
161
+ console.error('wpm is not defined. That means you are deferring the script which you shouldn\'t. wpm must be loaded before the inline scripts run. Visitor tracking will continue to work, but visitor cookie consent will be ignored.')
162
+ return true
163
+ }
164
+ }
165
+
166
+ window.dataLayer = window.dataLayer || [];
167
+
168
+ window.gtag = function gtag() {
169
+ dataLayer.push(arguments);
170
+ }
171
+ <?php
172
+ // $this->consent_mode_gtag_html();
173
+ $this->consent_mode_gtag_html_new();
174
+ // $this->linker_html();
175
+ $this->linker_html_new();
176
+ ?>
177
+
178
+ gtag('js', new Date());
179
+
180
+ <?php
181
+ // @formatter:on
182
  }
183
 
184
+ // https://developers.google.com/gtagjs/devguide/linker
185
+ private function linker_html()
186
  {
187
+ $linker_domains = apply_filters_deprecated(
188
+ 'wooptpm_google_cross_domain_linker_settings',
189
+ [ null ],
190
+ '1.13.0',
191
+ 'wpm_google_cross_domain_linker_settings'
192
+ );
193
+ $linker_domains = apply_filters( 'wpm_google_cross_domain_linker_settings', $linker_domains );
194
 
195
+ if ( $linker_domains ) {
196
+ return "\t\t" . 'gtag("set", "linker", ' . wp_json_encode( $linker_domains ) . ');';
197
  } else {
198
+ return '';
199
  }
200
 
201
  }
202
 
203
+ // https://developers.google.com/gtagjs/devguide/linker
204
+ private function linker_html_new()
205
  {
206
+ $linker_domains = apply_filters_deprecated(
207
+ 'wooptpm_google_cross_domain_linker_settings',
208
+ [ null ],
209
+ '1.13.0',
210
+ 'wpm_google_cross_domain_linker_settings'
211
+ );
212
+ $linker_domains = apply_filters( 'wpm_google_cross_domain_linker_settings', $linker_domains );
213
 
214
+ if ( $linker_domains ) {
215
+ ?>
216
+
217
+ gtag("set", "linker", <?php
218
+ echo wp_json_encode( $linker_domains ) ;
219
+ ?>);
220
+ <?php
221
  }
222
 
223
  }
224
 
225
+ private function consent_mode_gtag_html()
226
  {
227
 
228
+ if ( $this->options_obj->google->consent_mode->active ) {
229
+ $data = [
230
+ 'ad_storage' => 'denied',
231
+ 'analytics_storage' => 'denied',
232
+ 'wait_for_update' => 500,
233
+ ];
234
+ if ( $this->options_obj->google->consent_mode->regions ) {
235
+ $data['region'] = $this->options_obj->google->consent_mode->regions;
 
236
  }
237
+ // needs to be output as text
238
+ $ads_data_redaction = apply_filters_deprecated(
239
+ 'wooptpm_google_ads_data_redaction',
240
+ [ true ],
241
+ '1.13.0',
242
+ 'wpm_google_ads_data_redaction'
243
+ );
244
+ $ads_data_redaction = ( apply_filters( 'wpm_google_ads_data_redaction', $ads_data_redaction ) ? 'true' : 'false' );
245
+ // needs to be output as text
246
+ $url_passthrough = apply_filters_deprecated(
247
+ 'wooptpm_google_url_passthrough',
248
+ [ true ],
249
+ '1.13.0',
250
+ 'wpm_google_url_passthrough'
251
+ );
252
+ $url_passthrough = ( apply_filters( 'wpm_google_url_passthrough', $url_passthrough ) ? 'true' : 'false' );
253
+ // return "
254
+ // let google_consent_settings = " . wp_json_encode($data) . ";
255
+ //
256
+ // google_consent_settings = getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings);
257
+ //
258
+ //// console.log(google_consent_settings);
259
+ //
260
+ // gtag('consent', 'default', google_consent_settings);
261
+ // gtag('set', 'ads_data_redaction', " . $ads_data_redaction . ");
262
+ // gtag('set', 'url_passthrough', " . $url_passthrough . ");" . PHP_EOL;
263
+ return '
264
+ let google_consent_settings = ' . wp_json_encode( $data ) . ';
265
+
266
+ google_consent_settings = getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings);
267
+
268
+ // console.log(google_consent_settings);
269
+
270
+ gtag("consent", "default", google_consent_settings);
271
+ gtag("set", "ads_data_redaction", ' . $ads_data_redaction . ');
272
+ gtag("set", "url_passthrough", ' . $url_passthrough . ');' . PHP_EOL;
273
  } else {
274
+ return '';
275
  }
276
 
277
  }
278
 
279
+ private function consent_mode_gtag_html_new()
280
  {
 
281
 
282
+ if ( $this->options_obj->google->consent_mode->active ) {
283
+ $data = [
284
+ 'ad_storage' => 'denied',
285
+ 'analytics_storage' => 'denied',
286
+ 'wait_for_update' => 500,
287
+ ];
288
+ if ( $this->options_obj->google->consent_mode->regions ) {
289
+ $data['region'] = $this->options_obj->google->consent_mode->regions;
290
  }
291
+ // needs to be output as text
292
+ $ads_data_redaction = apply_filters_deprecated(
293
+ 'wooptpm_google_ads_data_redaction',
294
+ [ true ],
295
+ '1.13.0',
296
+ 'wpm_google_ads_data_redaction'
297
+ );
298
+ $ads_data_redaction = ( apply_filters( 'wpm_google_ads_data_redaction', $ads_data_redaction ) ? 'true' : 'false' );
299
+ // needs to be output as text
300
+ $url_passthrough = apply_filters_deprecated(
301
+ 'wooptpm_google_url_passthrough',
302
+ [ true ],
303
+ '1.13.0',
304
+ 'wpm_google_url_passthrough'
305
+ );
306
+ $url_passthrough = ( apply_filters( 'wpm_google_url_passthrough', $url_passthrough ) ? 'true' : 'false' );
307
+ // return "
308
+ // let google_consent_settings = " . wp_json_encode($data) . ";
309
+ //
310
+ // google_consent_settings = getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings);
311
+ //
312
+ //// console.log(google_consent_settings);
313
+ //
314
+ // gtag('consent', 'default', google_consent_settings);
315
+ // gtag('set', 'ads_data_redaction', " . $ads_data_redaction . ");
316
+ // gtag('set', 'url_passthrough', " . $url_passthrough . ");" . PHP_EOL;
317
+ // return '
318
+ // let google_consent_settings = ' . wp_json_encode($data) . ';
319
+ //
320
+ // google_consent_settings = getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings);
321
+ //
322
+ //// console.log(google_consent_settings);
323
+ //
324
+ // gtag("consent", "default", google_consent_settings);
325
+ // gtag("set", "ads_data_redaction", ' . $ads_data_redaction . ');
326
+ // gtag("set", "url_passthrough", ' . $url_passthrough . ');' . PHP_EOL;
327
+ ?>
328
+
329
+ let google_consent_settings = <?php
330
+ echo wp_json_encode( $data ) ;
331
+ ?>
332
+
333
+ google_consent_settings = getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)
334
+
335
+ gtag("consent", "default", google_consent_settings)
336
+ gtag("set", "ads_data_redaction", <?php
337
+ esc_html_e( $ads_data_redaction );
338
+ ?>)
339
+ gtag("set", "url_passthrough", <?php
340
+ esc_html_e( $url_passthrough );
341
+ ?>)
342
+ <?php
343
  }
344
+
 
345
  }
346
 
347
+ protected function get_google_business_vertical( $id )
348
  {
349
  $verticals = [
350
  0 => 'retail',
360
  return $verticals[$id];
361
  }
362
 
363
+ protected function get_formatted_order_items( $order, $channel = '' )
364
  {
365
+ $order_items = $this->wpm_get_order_items( $order );
366
+ $order_items_array = [];
367
+ $list_position = 1;
368
+ foreach ( (array) $order_items as $order_item ) {
369
+ $product_id = $this->get_variation_or_product_id( $order_item->get_data(), $this->options_obj->general->variations_output );
370
+ $product = wc_get_product( $product_id );
371
+
372
+ if ( !is_object( $product ) ) {
373
+ $this->log_problematic_product_id( $product_id );
374
+ continue;
 
 
 
 
 
 
 
 
 
 
 
 
375
  }
376
+
377
+ $item_details_array = [];
378
+ $dyn_r_ids = $this->get_dyn_r_ids( $product );
379
+
380
+ if ( 'ads' === $channel ) {
381
+ $item_details_array['id'] = (string) $dyn_r_ids[$this->get_dyn_r_id_type()];
382
+ } else {
383
+ $item_details_array['id'] = (string) $dyn_r_ids[$this->get_ga_id_type()];
384
  }
385
+
386
+ $item_details_array['quantity'] = (int) $order_item['quantity'];
387
+ $item_details_array['price'] = (double) $product->get_price();
388
+ if ( $this->is_google_ads_active() ) {
389
+ $item_details_array['google_business_vertical'] = (string) $this->google_business_vertical;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  }
391
+
392
+ if ( $this->is_google_analytics_active() && 'ads' != $channel ) {
393
+ $item_details_array['name'] = (string) $product->get_name();
394
+ // $item_details_array['list_name'] = '';
395
+ $item_details_array['brand'] = (string) $this->get_brand_name( $product_id );
396
+ $item_details_array['category'] = (array) $this->get_product_category( $product_id );
397
+ // $item_details_array['variant'] = '';
398
+ $item_details_array['list_position'] = (int) $list_position++;
399
+ }
400
+
401
+ array_push( $order_items_array, $item_details_array );
402
  }
403
+ // apply filter to $order_items_array
404
+ $order_items_array = apply_filters_deprecated(
405
+ 'wgact_filter',
406
+ [ $order_items_array ],
407
+ '1.10.2',
408
+ '',
409
+ 'This filter has been deprecated without replacement.'
410
+ );
411
+ return $order_items_array;
412
  }
413
 
414
+ protected function get_event_purchase(
415
+ $order,
416
+ $order_total,
417
+ $order_currency,
418
+ $is_new_customer,
419
+ $channel
420
+ )
421
  {
422
+ $gtag_data = [
423
+ 'send_to' => [],
424
+ 'transaction_id' => (string) $order->get_order_number(),
425
+ 'currency' => (string) $order_currency,
426
+ 'discount' => (double) $order->get_total_discount(),
427
+ 'items' => (array) $this->get_formatted_order_items( $order, $channel ),
428
+ ];
429
 
430
+ if ( 'ads' === $channel ) {
431
+ $gtag_data['send_to'] = $this->get_google_ads_conversion_ids( true );
432
+ $gtag_data['value'] = (double) $order_total;
433
+ $gtag_data['aw_merchant_id'] = (int) $this->aw_merchant_id;
434
+ $gtag_data['aw_feed_country'] = (string) $this->get_visitor_country();
435
+ $gtag_data['aw_feed_language'] = (string) $this->get_gmc_language();
436
+ $gtag_data['new_customer'] = (string) $is_new_customer;
437
  } else {
438
+
439
+ if ( 'ga_ua' === $channel ) {
440
+ if ( $this->options_obj->google->analytics->universal->property_id ) {
441
+ array_push( $gtag_data['send_to'], $this->options_obj->google->analytics->universal->property_id );
442
+ }
443
+ // if ($this->options_obj->google->analytics->ga4->measurement_id) array_push($gtag_data['send_to'], $this->options_obj->google->analytics->ga4->measurement_id);
444
+ $gtag_data['affiliation'] = (string) get_bloginfo( 'name' );
445
+ $gtag_data['tax'] = (double) $order->get_total_tax();
446
+ $gtag_data['shipping'] = (double) $order->get_total_shipping();
447
+ $gtag_data['value'] = (double) $order->get_total();
448
+ } else {
449
+
450
+ if ( 'ga_4' === $channel ) {
451
+ // if ($this->options_obj->google->analytics->universal->property_id) array_push($gtag_data['send_to'], $this->options_obj->google->analytics->universal->property_id);
452
+ if ( $this->options_obj->google->analytics->ga4->measurement_id ) {
453
+ array_push( $gtag_data['send_to'], $this->options_obj->google->analytics->ga4->measurement_id );
454
+ }
455
+ $gtag_data['affiliation'] = (string) get_bloginfo( 'name' );
456
+ $gtag_data['tax'] = (double) $order->get_total_tax();
457
+ $gtag_data['shipping'] = (double) $order->get_total_shipping();
458
+ $gtag_data['value'] = (double) $order->get_total();
459
+ }
460
+
461
+ }
462
+
463
  }
464
 
465
+ return wp_json_encode( $gtag_data );
466
  }
467
 
468
+ protected function get_gmc_language()
469
  {
470
+ return strtoupper( substr( get_locale(), 0, 2 ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  }
472
 
473
+ protected function get_google_ads_conversion_ids( $purchase = false )
474
  {
475
+ $formatted_conversion_ids = [];
476
+
477
+ if ( $purchase ) {
478
+ foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
479
+ array_push( $formatted_conversion_ids, 'AW-' . $conversion_id . '/' . $conversion_label );
480
+ }
481
+ } else {
482
+ foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
483
+ array_push( $formatted_conversion_ids, 'AW-' . $conversion_id );
484
+ }
 
 
 
 
 
 
 
 
 
 
 
485
  }
486
+
487
+ return $formatted_conversion_ids;
488
  }
489
 
490
+ private function get_gtag_id()
491
  {
492
 
493
+ if ( $this->options_obj->google->analytics->universal->property_id ) {
494
+ return $this->options_obj->google->analytics->universal->property_id;
495
+ } elseif ( $this->options_obj->google->analytics->ga4->measurement_id ) {
496
+ return $this->options_obj->google->analytics->ga4->measurement_id;
497
+ } elseif ( $this->options_obj->google->ads->conversion_id ) {
498
+ return 'AW-' . $this->options_obj->google->ads->conversion_id;
499
  } else {
500
+ return '';
501
  }
502
 
503
  }
504
 
505
+ private function inject_data_layer_pixels()
506
  {
507
+ $data = [
508
+ 'google' => [
509
+ 'ads' => [
510
+ 'dynamic_remarketing' => [
511
+ 'status' => (bool) $this->options_obj->google->ads->dynamic_remarketing,
512
+ 'id_type' => $this->get_dyn_r_id_type(),
513
+ 'send_events_with_parent_ids' => apply_filters( 'wpm_send_events_with_parent_ids', apply_filters_deprecated(
514
+ 'wooptpm_send_events_with_parent_ids',
515
+ [ true ],
516
  '1.13.0',
517
+ 'wpm_send_events_with_parent_ids'
518
+ ) ),
519
+ ],
520
+ 'conversionIds' => $this->get_google_ads_conversion_ids(),
521
+ 'google_business_vertical' => $this->google_business_vertical,
522
+ ],
523
+ 'analytics' => [
524
+ 'universal' => [
525
+ 'property_id' => $this->options_obj->google->analytics->universal->property_id,
526
+ ],
527
+ 'ga4' => [
528
+ 'measurement_id' => $this->options_obj->google->analytics->ga4->measurement_id,
529
+ ],
530
+ 'id_type' => $this->get_ga_id_type(),
531
+ 'eec' => (bool) $this->options_obj->google->analytics->eec,
532
+ ],
533
+ 'consent_mode' => [
534
+ 'active' => (bool) $this->options_obj->google->consent_mode->active,
535
+ ],
536
+ ],
537
+ ];
538
+ ?>
539
+
540
+ <script>
541
+ wpmDataLayer.pixels = <?php
542
+ echo wp_json_encode( $data ) ;
543
+ ?>;
544
+ </script>
545
+ <?php
546
  }
547
 
548
+ protected function gtag_config( $id, $channel = '' )
549
  {
550
+
551
+ if ( 'ads' === $channel ) {
552
+
553
+ if ( $this->options_obj->google->ads->enhanced_conversions ) {
554
+ // return PHP_EOL . "\t\t\t" . 'if (googleConfigConditionsMet("ads")) gtag("config", "AW-' . $id . '", {"allow_enhanced_conversions":true});' . PHP_EOL;
555
+ ?>
556
+
557
+ if (googleConfigConditionsMet("ads")) gtag("config", "AW-<?php
558
+ echo esc_js( $id ) ;
559
+ ?>", {"allow_enhanced_conversions":true});
560
+ <?php
561
+ } else {
562
+ // return PHP_EOL . "\t\t\t" . 'if (googleConfigConditionsMet("ads")) gtag("config", "AW-' . $id . '");' . PHP_EOL;
563
+ ?>
564
+ if (googleConfigConditionsMet("ads")) gtag("config", "AW-<?php
565
+ echo esc_js( $id ) ;
566
+ ?>");
567
+ <?php
568
+ }
569
+
570
+ } elseif ( 'ga_ua' === $channel ) {
571
+ $ga_ua_parameters = [
572
+ 'anonymize_ip' => 'true',
573
+ 'link_attribution' => ( $this->options_obj->google->analytics->link_attribution ? 'true' : 'false' ),
574
  ];
575
+ if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
576
+ $ga_ua_parameters['user_id'] = get_current_user_id();
577
+ }
578
+ $ga_ua_parameters = apply_filters_deprecated(
579
+ 'woopt_pm_analytics_parameters',
580
+ [ $ga_ua_parameters, $id ],
581
+ '1.10.10',
582
+ 'wooptpm_ga_ua_parameters'
583
+ );
584
+ $ga_ua_parameters = apply_filters_deprecated(
585
+ 'wooptpm_ga_ua_parameters',
586
+ [ $ga_ua_parameters, $id ],
587
+ '1.13.0',
588
+ 'wpm_ga_ua_parameters'
589
+ );
590
+ $ga_ua_parameters = apply_filters( 'wpm_ga_ua_parameters', $ga_ua_parameters, $id );
591
+ // return "\t" . 'if (googleConfigConditionsMet("analytics")) gtag("config", "' . $id . '", ' . wp_json_encode($ga_ua_parameters) . ');';
592
+ ?>
593
+ if (googleConfigConditionsMet("analytics")) gtag("config", "<?php
594
+ echo esc_js( $id ) ;
595
+ ?>", <?php
596
+ echo wp_json_encode( $ga_ua_parameters ) ;
597
+ ?>);
598
+
599
+ <?php
600
+ } elseif ( 'ga_4' === $channel ) {
601
+ $ga_4_parameters = [];
602
+ if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
603
+ $ga_4_parameters = [
604
+ 'user_id' => get_current_user_id(),
605
+ ];
606
+ }
607
+ $ga_4_parameters = apply_filters_deprecated(
608
+ 'wooptpm_ga_4_parameters',
609
+ [ $ga_4_parameters, $id ],
610
+ '1.13.0',
611
+ 'wpm_ga_4_parameters'
612
+ );
613
+ $ga_4_parameters = apply_filters( 'wpm_ga_4_parameters', $ga_4_parameters, $id );
614
+
615
+ if ( empty($ga_4_parameters) ) {
616
+ // return "\t" . 'if (googleConfigConditionsMet("analytics")) gtag("config", "' . $id . '");';
617
+ ?>
618
+ if (googleConfigConditionsMet("analytics")) gtag("config", "<?php
619
+ echo esc_js( $id ) ;
620
+ ?>");
621
+ <?php
622
+ } else {
623
+ // return "\t" . 'if (googleConfigConditionsMet("analytics")) gtag("config", "' . $id . '", ' . wp_json_encode($ga_4_parameters) . ');';
624
+ ?>
625
+ if (googleConfigConditionsMet("analytics")) gtag("config", "<?php
626
+ echo esc_js( $id ) ;
627
+ ?>", <?php
628
+ echo wp_json_encode( $ga_4_parameters ) ;
629
+ ?>);
630
+ <?php
631
+ }
632
+
633
  }
 
 
 
 
 
 
 
 
634
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
  }
636
 
637
+ private function inject_borlabs_consent_mode_update()
638
  {
639
+ return "\n (function updateGoogleConsentMode() {\n if (typeof BorlabsCookie == 'undefined' || typeof gtag == 'undefined') {\n window.setTimeout(updateGoogleConsentMode, 50);\n } else {\n if (window.BorlabsCookie.checkCookieGroupConsent('statistics')) {\n// console.log('update analytics_storage to granted');\n\n gtag('consent', 'update', {\n 'analytics_storage': 'granted'\n });\n }\n \n if (window.BorlabsCookie.checkCookieGroupConsent('marketing')) {\n// console.log('update ad_storage to granted');\n gtag('consent', 'update', {\n 'ad_storage': 'granted'\n });\n }\n }\n })();" . PHP_EOL;
 
 
 
 
 
 
 
 
 
640
  }
641
 
642
  }
classes/pixels/google/trait-google.php CHANGED
@@ -2,384 +2,175 @@
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
5
- use WCPM\Classes\Admin\Environment_Check ;
6
- use WCPM\Classes\Pixels\Trait_Shop ;
7
 
8
- if ( !defined( 'ABSPATH' ) ) {
9
- exit;
10
- // Exit if accessed directly
11
  }
12
 
13
- trait Trait_Google
14
- {
15
- use Trait_Shop ;
16
- protected $google_ads_conversion_identifiers ;
17
- protected function get_ga_id_type()
18
- {
19
- $ga_id_type = 'post_id';
20
- $ga_id_type = apply_filters_deprecated(
21
- 'wooptpm_product_id_type_for_google_analytics',
22
- [ $ga_id_type ],
23
- '1.13.0',
24
- 'wpm_product_id_type_for_google_analytics'
25
- );
26
- // Change the output of the product ID type for Google Analytics
27
- return apply_filters( 'wpm_product_id_type_for_google_analytics', $ga_id_type );
28
- }
29
-
30
- protected function google_active()
31
- {
32
-
33
- if ( $this->options_obj->google->analytics->universal->property_id ) {
34
- return true;
35
- } elseif ( $this->options_obj->google->analytics->ga4->measurement_id ) {
36
- return true;
37
- } elseif ( $this->options_obj->google->ads->conversion_id ) {
38
- return true;
39
- } else {
40
- return false;
41
- }
42
-
43
- }
44
-
45
- protected function is_google_ads_active()
46
- {
47
-
48
- if ( $this->options['google']['ads']['conversion_id'] ) {
49
- return true;
50
- } else {
51
- return false;
52
- }
53
-
54
- }
55
-
56
- protected function is_google_analytics_active()
57
- {
58
-
59
- if ( $this->is_google_analytics_ua_active() || $this->is_google_analytics_4_active() ) {
60
- return true;
61
- } else {
62
- return false;
63
- }
64
-
65
- }
66
-
67
- protected function is_google_analytics_ua_active()
68
- {
69
-
70
- if ( $this->options_obj->google->analytics->universal->property_id ) {
71
- return true;
72
- } else {
73
- return false;
74
- }
75
-
76
- }
77
-
78
- protected function is_google_analytics_4_active()
79
- {
80
-
81
- if ( $this->options_obj->google->analytics->ga4->measurement_id ) {
82
- return true;
83
- } else {
84
- return false;
85
- }
86
-
87
- }
88
-
89
- protected function is_google_analytics_4_mp_active()
90
- {
91
-
92
- if ( $this->options_obj->google->analytics->ga4->measurement_id && $this->options_obj->google->analytics->ga4->api_secret ) {
93
- return true;
94
- } else {
95
- return false;
96
- }
97
-
98
- }
99
-
100
- protected function get_order_item_data( $order_item )
101
- {
102
- $product = $order_item->get_product();
103
-
104
- if ( !is_object( $product ) ) {
105
- wc_get_logger()->debug( 'get_order_item_data received an order item which is not a valid product: ' . $order_item->get_id(), [
106
- 'source' => 'wpm',
107
- ] );
108
- return [];
109
- }
110
-
111
- $dyn_r_ids = $this->get_dyn_r_ids( $product );
112
-
113
- if ( $product->get_type() === 'variation' ) {
114
- $parent_product = wc_get_product( $product->get_parent_id() );
115
- $name = $parent_product->get_name();
116
- } else {
117
- $name = $product->get_name();
118
- }
119
-
120
- return [
121
- 'id' => (string) $dyn_r_ids[$this->get_ga_id_type()],
122
- 'name' => (string) $name,
123
- 'quantity' => (int) $order_item['quantity'],
124
- 'affiliation' => (string) get_bloginfo( 'name' ),
125
- 'brand' => (string) $this->get_brand_name( $product->get_id() ),
126
- 'category' => implode( ',', $this->get_product_category( $product->get_id() ) ),
127
- 'category_array' => $this->get_product_category( $product->get_id() ),
128
- 'variant' => ( (string) ($product->get_type() === 'variation') ? $this->get_formatted_variant_text( $product ) : '' ),
129
- 'price' => (double) $this->wpm_get_order_item_price( $order_item, $product ),
130
- ];
131
- }
132
-
133
- protected function wpm_get_order_item_price( $order_item, $product )
134
- {
135
-
136
- if ( ( new Environment_Check( $this->options ) )->is_woo_discount_rules_active() ) {
137
- $item_value = $order_item->get_meta( '_advanced_woo_discount_item_total_discount' );
138
-
139
- if ( is_array( $item_value ) && array_key_exists( 'discounted_price', $item_value ) && 0 != $item_value['discounted_price'] ) {
140
- return (double) $item_value['discounted_price'];
141
- } elseif ( is_array( $item_value ) && array_key_exists( 'initial_price', $item_value ) && 0 != $item_value['initial_price'] ) {
142
- return (double) $item_value['initial_price'];
143
- } else {
144
- return (double) $product->get_price();
145
- }
146
-
147
- } else {
148
- return (double) $product->get_price();
149
- }
150
-
151
- }
152
-
153
- protected function add_categories_to_ga4_product_items( $item_details_array, $categories )
154
- {
155
- $categories = array_unique( $categories );
156
-
157
- if ( count( $categories ) > 0 ) {
158
- $max_categories = 5;
159
- $item_details_array['item_category'] = $categories[0];
160
- $max = ( count( $categories ) > $max_categories ? $max_categories : count( $categories ) );
161
- for ( $i = 1 ; $i < $max ; $i++ ) {
162
- $item_details_array['item_category' . ($i + 1)] = $categories[$i];
163
- }
164
- }
165
-
166
- return $item_details_array;
167
- }
168
-
169
- protected function get_google_business_vertical( $id )
170
- {
171
- $verticals = [
172
- 0 => 'retail',
173
- 1 => 'education',
174
- 2 => 'flights',
175
- 3 => 'hotel_rental',
176
- 4 => 'jobs',
177
- 5 => 'local',
178
- 6 => 'real_estate',
179
- 7 => 'travel',
180
- 8 => 'custom',
181
- ];
182
- return $verticals[$id];
183
- }
184
-
185
- protected function get_google_ads_conversion_ids( $purchase = false )
186
- {
187
- $this->google_ads_conversion_identifiers[$this->options['google']['ads']['conversion_id']] = $this->options['google']['ads']['conversion_label'];
188
- $this->google_ads_conversion_identifiers = apply_filters_deprecated(
189
- 'wgact_google_ads_conversion_identifiers',
190
- [ $this->google_ads_conversion_identifiers ],
191
- '1.10.2',
192
- 'wooptpm_google_ads_conversion_identifiers'
193
- );
194
- $this->google_ads_conversion_identifiers = apply_filters_deprecated(
195
- 'wooptpm_google_ads_conversion_identifiers',
196
- [ $this->google_ads_conversion_identifiers ],
197
- '1.13.0',
198
- 'wpm_google_ads_conversion_identifiers'
199
- );
200
- $this->google_ads_conversion_identifiers = apply_filters( 'wpm_google_ads_conversion_identifiers', $this->google_ads_conversion_identifiers );
201
- $formatted_conversion_ids = [];
202
-
203
- if ( $purchase ) {
204
- foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
205
- $conversion_id = $this->extract_google_ads_id( $conversion_id );
206
- if ( $conversion_id ) {
207
- $formatted_conversion_ids['AW-' . $conversion_id] = $conversion_label;
208
- }
209
- }
210
- } else {
211
- foreach ( $this->google_ads_conversion_identifiers as $conversion_id => $conversion_label ) {
212
- $conversion_id = $this->extract_google_ads_id( $conversion_id );
213
- if ( $conversion_id ) {
214
- $formatted_conversion_ids['AW-' . $conversion_id] = '';
215
- }
216
- }
217
- }
218
-
219
- return $formatted_conversion_ids;
220
- }
221
-
222
- protected function extract_google_ads_id( $string )
223
- {
224
- $re = '/\\d{9,11}/';
225
-
226
- if ( $string ) {
227
- preg_match(
228
- $re,
229
- $string,
230
- $matches,
231
- PREG_OFFSET_CAPTURE,
232
- 0
233
- );
234
- if ( is_array( $matches[0] ) ) {
235
- return $matches[0][0];
236
- }
237
- }
238
-
239
- return '';
240
- }
241
-
242
- protected function get_google_ads_enhanced_conversion_data( $order )
243
- {
244
- $customer_data = [];
245
- if ( $order->get_billing_email() ) {
246
- $customer_data['email'] = (string) $order->get_billing_email();
247
- }
248
- if ( $order->get_billing_phone() ) {
249
- $customer_data['phone_number'] = $this->get_e164_formatted_phone_number( (string) $order->get_billing_phone(), (string) $order->get_billing_country() );
250
- }
251
-
252
- if ( $this->are_billing_and_shipping_addresses_equal( $order ) ) {
253
- $customer_data['address'] = $this->get_billing_address_details( $order );
254
- } else {
255
- $customer_data['address'][] = $this->get_billing_address_details( $order );
256
- $customer_data['address'][] = $this->get_shipping_address_details( $order );
257
- }
258
-
259
- return $customer_data;
260
- }
261
-
262
- protected function get_billing_address_details( $order )
263
- {
264
- $customer_data = [];
265
- if ( $order->get_billing_first_name() ) {
266
- $customer_data['first_name'] = (string) $order->get_billing_first_name();
267
- }
268
- if ( $order->get_billing_last_name() ) {
269
- $customer_data['last_name'] = (string) $order->get_billing_last_name();
270
- }
271
- if ( $order->get_billing_address_1() ) {
272
- $customer_data['street'] = (string) $order->get_billing_address_1();
273
- }
274
- if ( $order->get_billing_city() ) {
275
- $customer_data['city'] = (string) $order->get_billing_city();
276
- }
277
- if ( $order->get_billing_state() ) {
278
- $customer_data['region'] = (string) $order->get_billing_state();
279
- }
280
- if ( $order->get_billing_postcode() ) {
281
- $customer_data['postal_code'] = (string) $order->get_billing_postcode();
282
- }
283
- if ( $order->get_billing_country() ) {
284
- $customer_data['country'] = (string) $order->get_billing_country();
285
- }
286
- return $customer_data;
287
- }
288
-
289
- protected function get_shipping_address_details( $order )
290
- {
291
- $customer_data = [];
292
- if ( $order->get_shipping_first_name() ) {
293
- $customer_data['first_name'] = (string) $order->get_shipping_first_name();
294
- }
295
- if ( $order->get_shipping_last_name() ) {
296
- $customer_data['last_name'] = (string) $order->get_shipping_last_name();
297
- }
298
- if ( $order->get_shipping_address_1() ) {
299
- $customer_data['street'] = (string) $order->get_shipping_address_1();
300
- }
301
- if ( $order->get_shipping_city() ) {
302
- $customer_data['city'] = (string) $order->get_shipping_city();
303
- }
304
- if ( $order->get_shipping_state() ) {
305
- $customer_data['region'] = (string) $order->get_shipping_state();
306
- }
307
- if ( $order->get_shipping_postcode() ) {
308
- $customer_data['postal_code'] = (string) $order->get_shipping_postcode();
309
- }
310
- if ( $order->get_shipping_country() ) {
311
- $customer_data['country'] = (string) $order->get_shipping_country();
312
- }
313
- return $customer_data;
314
- }
315
-
316
- private function are_billing_and_shipping_addresses_equal( $order )
317
- {
318
-
319
- if ( $order->get_billing_first_name() === $order->get_shipping_first_name() && $order->get_billing_last_name() === $order->get_shipping_last_name() && $order->get_billing_address_1() === $order->get_shipping_address_1() && $order->get_billing_city() === $order->get_shipping_city() && $order->get_billing_state() === $order->get_shipping_state() && $order->get_billing_postcode() === $order->get_shipping_postcode() && $order->get_billing_country() === $order->get_shipping_country() ) {
320
- return true;
321
- } else {
322
- return false;
323
- }
324
-
325
- }
326
-
327
- protected function get_gmc_language()
328
- {
329
- return strtoupper( substr( get_locale(), 0, 2 ) );
330
- }
331
-
332
- // https://developers.google.com/gtagjs/devguide/linker
333
- protected function get_google_linker_settings()
334
- {
335
- $linker_settings = apply_filters_deprecated(
336
- 'wooptpm_google_cross_domain_linker_settings',
337
- [ null ],
338
- '1.13.0',
339
- 'wpm_google_cross_domain_linker_settings'
340
- );
341
- return apply_filters( 'wpm_google_cross_domain_linker_settings', $linker_settings );
342
- }
343
-
344
- protected function get_ga4_parameters( $id )
345
- {
346
- $ga_4_parameters = [];
347
- if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
348
- $ga_4_parameters = [
349
- 'user_id' => get_current_user_id(),
350
- ];
351
- }
352
- $ga_4_parameters = apply_filters_deprecated(
353
- 'wooptpm_ga_4_parameters',
354
- [ $ga_4_parameters, $id ],
355
- '1.13.0',
356
- 'wpm_ga_4_parameters'
357
- );
358
- return apply_filters( 'wpm_ga_4_parameters', $ga_4_parameters, $id );
359
- }
360
-
361
- protected function get_ga_ua_parameters( $id )
362
- {
363
- $ga_ua_parameters = [
364
- 'anonymize_ip' => true,
365
- 'link_attribution' => (bool) $this->options_obj->google->analytics->link_attribution,
366
- ];
367
- if ( $this->options_obj->google->user_id && is_user_logged_in() ) {
368
- $ga_ua_parameters['user_id'] = get_current_user_id();
369
- }
370
- $ga_ua_parameters = apply_filters_deprecated(
371
- 'woopt_pm_analytics_parameters',
372
- [ $ga_ua_parameters, $id ],
373
- '1.10.10',
374
- 'wooptpm_ga_ua_parameters'
375
- );
376
- $ga_ua_parameters = apply_filters_deprecated(
377
- 'wooptpm_ga_ua_parameters',
378
- [ $ga_ua_parameters, $id ],
379
- '1.13.0',
380
- 'wpm_ga_ua_parameters'
381
- );
382
- return apply_filters( 'wpm_ga_ua_parameters', $ga_ua_parameters, $id );
383
- }
384
 
385
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  namespace WCPM\Classes\Pixels\Google;
4
 
5
+ use WCPM\Classes\Admin\Environment_Check;
 
6
 
7
+ if (!defined('ABSPATH')) {
8
+ exit; // Exit if accessed directly
 
9
  }
10
 
11
+ trait Trait_Google {
12
+ protected function get_ga_id_type() {
13
+ $ga_id_type = 'post_id';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ $ga_id_type = apply_filters_deprecated('wooptpm_product_id_type_for_google_analytics', [$ga_id_type], '1.13.0', 'wpm_product_id_type_for_google_analytics');
16
+ $ga_id_type = apply_filters('wpm_product_id_type_for_google_analytics', $ga_id_type);
17
+
18
+ return $ga_id_type;
19
+ }
20
+
21
+ protected function google_active() {
22
+ if ($this->options_obj->google->analytics->universal->property_id) {
23
+ return true;
24
+ } elseif ($this->options_obj->google->analytics->ga4->measurement_id) {
25
+ return true;
26
+ } elseif ($this->options_obj->google->ads->conversion_id) {
27
+ return true;
28
+ } else {
29
+ return false;
30
+ }
31
+ }
32
+
33
+ protected function is_google_ads_active() {
34
+ if ($this->options['google']['ads']['conversion_id']) {
35
+
36
+ return true;
37
+ } else {
38
+ return false;
39
+ }
40
+ }
41
+
42
+ private function is_dynamic_remarketing_active() {
43
+ if ($this->options_obj->google->ads->dynamic_remarketing && $this->options_obj->google->ads->conversion_id) {
44
+ return true;
45
+ } else {
46
+ return false;
47
+ }
48
+ }
49
+
50
+ // protected function is_google_ads_active()
51
+ // {
52
+ // if ($this->options_obj->google->ads->conversion_id && $this->options_obj->google->ads->conversion_label) {
53
+ // return true;
54
+ // } else {
55
+ // return false;
56
+ // }
57
+ // }
58
+
59
+ protected function is_google_analytics_active() {
60
+ if ($this->is_google_analytics_ua_active() || $this->is_google_analytics_4_active()) {
61
+ return true;
62
+ } else {
63
+ return false;
64
+ }
65
+ }
66
+
67
+ protected function is_google_analytics_ua_active() {
68
+ if ($this->options_obj->google->analytics->universal->property_id) {
69
+ return true;
70
+ } else {
71
+ return false;
72
+ }
73
+ }
74
+
75
+ protected function is_google_analytics_4_active() {
76
+ if ($this->options_obj->google->analytics->ga4->measurement_id) {
77
+ return true;
78
+ } else {
79
+ return false;
80
+ }
81
+ }
82
+
83
+ protected function is_google_analytics_4_mp_active() {
84
+ if ($this->options_obj->google->analytics->ga4->measurement_id && $this->options_obj->google->analytics->ga4->api_secret) {
85
+ return true;
86
+ } else {
87
+ return false;
88
+ }
89
+ }
90
+
91
+ protected function get_order_currency( $order ) {
92
+ // use the right function to get the currency depending on the WooCommerce version
93
+ return $this->woocommerce_3_and_above() ? $order->get_currency() : $order->get_order_currency();
94
+ }
95
+
96
+ protected function woocommerce_3_and_above() {
97
+ global $woocommerce;
98
+ if (version_compare($woocommerce->version, 3.0, '>=')) {
99
+ return true;
100
+ } else {
101
+ return false;
102
+ }
103
+ }
104
+
105
+ protected function get_order_item_data( $order_item ) {
106
+ $product = $order_item->get_product();
107
+
108
+ if (!is_object($product)) {
109
+
110
+ // $this->log_problematic_product_id();
111
+ wc_get_logger()->debug('get_order_item_data received an order item which is not a valid product: ' . $order_item->get_id(), ['source' => 'wpm']);
112
+ return [];
113
+ }
114
+
115
+ $dyn_r_ids = $this->get_dyn_r_ids($product);
116
+
117
+ if ($product->get_type() === 'variation') {
118
+ $parent_product = wc_get_product($product->get_parent_id());
119
+ $name = $parent_product->get_name();
120
+ } else {
121
+ $name = $product->get_name();
122
+ }
123
+
124
+ return [
125
+ 'id' => (string) $dyn_r_ids[$this->get_ga_id_type()],
126
+ 'name' => (string) $name,
127
+ 'quantity' => (int) $order_item['quantity'],
128
+ 'affiliation' => (string) get_bloginfo('name'),
129
+ // 'coupon' => '',
130
+ // 'discount' => 0,
131
+ 'brand' => (string) $this->get_brand_name($product->get_id()),
132
+ // https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#pr_ca
133
+ 'category' => implode(',', $this->get_product_category($product->get_id())),
134
+ 'category_array' => $this->get_product_category($product->get_id()),
135
+ 'variant' => (string) ( $product->get_type() === 'variation' ) ? $this->get_formatted_variant_text($product) : '',
136
+ // 'tax' => 0,
137
+ 'price' => (float) $this->wpm_get_order_item_price($order_item, $product),
138
+ // 'list_name' => ,
139
+ // 'currency' => '',
140
+ ];
141
+ }
142
+
143
+ protected function wpm_get_order_item_price( $order_item, $product ) {
144
+ if (( new Environment_Check() )->is_woo_discount_rules_active()) {
145
+ $item_value = $order_item->get_meta('_advanced_woo_discount_item_total_discount');
146
+ if (is_array($item_value) && array_key_exists('discounted_price', $item_value) && 0 != $item_value['discounted_price']) {
147
+ return (float) $item_value['discounted_price'];
148
+ } elseif (is_array($item_value) && array_key_exists('initial_price', $item_value) && 0 != $item_value['initial_price']) {
149
+ return (float) $item_value['initial_price'];
150
+ } else {
151
+ return (float) $product->get_price();
152
+ }
153
+ } else {
154
+ return (float) $product->get_price();
155
+ }
156
+ }
157
+
158
+ protected function add_categories_to_ga4_product_items( $item_details_array, $categories ) {
159
+ $categories = array_unique($categories);
160
+
161
+ if (count($categories) > 0) {
162
+
163
+ $max_categories = 5;
164
+
165
+ $item_details_array['item_category'] = $categories[0];
166
+
167
+ $max = count($categories) > $max_categories ? $max_categories : count($categories);
168
+
169
+ for ($i = 1; $i < $max; $i++) {
170
+ $item_details_array['item_category' . ( $i + 1 )] = $categories[$i];
171
+ }
172
+ }
173
+
174
+ return $item_details_array;
175
+ }
176
+ }
classes/pixels/trait-product.php CHANGED
@@ -3,14 +3,12 @@
3
  namespace WCPM\Classes\Pixels;
4
 
5
  use WCPM\Classes\Admin\Environment_Check;
6
- use WCPM\Classes\Pixels\Google\Google;
7
 
8
  if (!defined('ABSPATH')) {
9
  exit; // Exit if accessed directly
10
  }
11
 
12
  trait Trait_Product {
13
-
14
  protected function get_formatted_variant_text( $product ) {
15
  $variant_text_array = [];
16
 
@@ -27,8 +25,7 @@ trait Trait_Product {
27
  }
28
 
29
  protected function get_variation_or_product_id( $item, $variations_output = true ) {
30
-
31
- if (0 <> $item['variation_id'] && true === $variations_output) {
32
  return $item['variation_id'];
33
  } else {
34
  return $item['product_id'];
@@ -38,13 +35,19 @@ trait Trait_Product {
38
  // https://stackoverflow.com/a/56278308/4688612
39
  // https://stackoverflow.com/a/39034036/4688612
40
  public function get_brand_name( $product_id ) {
 
 
 
 
41
 
42
  $brand_taxonomy = 'pa_brand';
43
 
44
- if (( new Environment_Check($this->options) )->is_yith_wc_brands_active()) {
45
  $brand_taxonomy = 'yith_product_brand';
46
- } elseif (( new Environment_Check($this->options) )->is_woocommerce_brands_active()) {
47
- $brand_taxonomy = 'product_brand';
 
 
48
  }
49
 
50
  $brand_taxonomy = apply_filters_deprecated('wooptpm_custom_brand_taxonomy', [$brand_taxonomy], '1.13.0', 'wpm_custom_brand_taxonomy');
@@ -52,6 +55,10 @@ trait Trait_Product {
52
  // Use custom brand_taxonomy
53
  $brand_taxonomy = apply_filters('wpm_custom_brand_taxonomy', $brand_taxonomy);
54
 
 
 
 
 
55
  if ($this->get_brand_by_taxonomy($product_id, $brand_taxonomy)) {
56
  return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy);
57
  } elseif ($this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy)) {
@@ -62,7 +69,6 @@ trait Trait_Product {
62
  }
63
 
64
  public function get_brand_by_taxonomy( $product_id, $taxonomy ) {
65
-
66
  if (taxonomy_exists($taxonomy)) {
67
  $brand_names = wp_get_post_terms($product_id, $taxonomy, ['fields' => 'names']);
68
  return reset($brand_names);
@@ -73,19 +79,13 @@ trait Trait_Product {
73
 
74
  // get an array with all product categories
75
  public function get_product_category( $product_id ) {
76
-
77
- if ($this->is_variable_product_by_id($product_id)) {
78
- $product = wc_get_product($product_id);
79
- $product_id = $product->get_parent_id();
80
- }
81
-
82
  $prod_cats = get_the_terms($product_id, 'product_cat');
83
  $prod_cats_output = [];
84
 
85
  // only continue with the loop if one or more product categories have been set for the product
86
  if (!empty($prod_cats)) {
87
  foreach ((array) $prod_cats as $key) {
88
- $prod_cats_output[] = $key->name;
89
  }
90
 
91
  // apply filter to the $prod_cats_output array
@@ -95,15 +95,7 @@ trait Trait_Product {
95
  return $prod_cats_output;
96
  }
97
 
98
- protected function is_variable_product_by_id( $product_id ) {
99
-
100
- $product = wc_get_product($product_id);
101
-
102
- return $product->get_type() === 'variable';
103
- }
104
-
105
  protected function get_compiled_product_id( $product_id, $product_sku, $options, $channel = '' ) {
106
-
107
  // depending on setting use product IDs or SKUs
108
  if (0 == $this->options['google']['ads']['product_identifier'] || 'ga_ua' === $channel || 'ga_4' === $channel) {
109
  return (string) $product_id;
@@ -121,7 +113,6 @@ trait Trait_Product {
121
  }
122
 
123
  protected function get_dyn_r_ids( $product ) {
124
-
125
  $dyn_r_ids = [
126
  'post_id' => (string) $product->get_id(),
127
  'sku' => (string) $product->get_sku() ? $product->get_sku() : $product->get_id(),
@@ -135,7 +126,6 @@ trait Trait_Product {
135
  }
136
 
137
  protected function log_problematic_product_id( $product_id = 0 ) {
138
-
139
  wc_get_logger()->debug(
140
  'WooCommerce detects the page ID ' . $product_id . ' as product, but when invoked by wc_get_product( ' . $product_id . ' ) it returns no product object',
141
  ['source' => 'wpm']
@@ -143,7 +133,6 @@ trait Trait_Product {
143
  }
144
 
145
  protected function get_order_item_ids( $order ) {
146
-
147
  $order_items = $this->wpm_get_order_items($order);
148
  $order_items_array = [];
149
 
@@ -158,6 +147,7 @@ trait Trait_Product {
158
 
159
  $dyn_r_ids = $this->get_dyn_r_ids($product);
160
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
 
161
  array_push($order_items_array, $product_id_compiled);
162
  } else {
163
 
@@ -169,7 +159,6 @@ trait Trait_Product {
169
  }
170
 
171
  protected function get_order_items_formatted_for_purchase_event( $order ) {
172
-
173
  $order_items = $this->wpm_get_order_items($order);
174
  $order_items_formatted = [];
175
 
@@ -185,6 +174,7 @@ trait Trait_Product {
185
 
186
  $dyn_r_ids = $this->get_dyn_r_ids($product);
187
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
 
188
 
189
  $product_details['id'] = $product_id_compiled;
190
  $product_details['name'] = $product->get_name();
@@ -193,6 +183,8 @@ trait Trait_Product {
193
  $product_details['brand'] = $this->get_brand_name($product_id);
194
  $product_details['category'] = implode(',', $this->get_product_category($product_id));
195
 
 
 
196
  if ($product->is_type('variation')) {
197
  $product_details['variant'] = $this->get_formatted_variant_text($product);
198
 
@@ -205,6 +197,7 @@ trait Trait_Product {
205
  }
206
 
207
  $order_items_formatted[] = $product_details;
 
208
  } else {
209
 
210
  $this->log_problematic_product_id($product_id);
@@ -214,11 +207,9 @@ trait Trait_Product {
214
  return $order_items_formatted;
215
  }
216
 
217
- protected function get_dyn_r_id_type( $pixel_name = null ) {
218
 
219
- if ($pixel_name) {
220
- $this->pixel_name = $pixel_name;
221
- }
222
 
223
  if (0 == $this->options_obj->google->ads->product_identifier) {
224
  $this->dyn_r_id_type = 'post_id';
@@ -230,7 +221,7 @@ trait Trait_Product {
230
  $this->dyn_r_id_type = 'gla';
231
  }
232
 
233
- // If you want to change the dyn_r_id type programmatically
234
  $this->dyn_r_id_type = apply_filters_deprecated('wooptpm_product_id_type_for_' . $this->pixel_name, [$this->dyn_r_id_type], '1.13.0', 'wpm_product_id_type_for_');
235
  $this->dyn_r_id_type = apply_filters('wpm_product_id_type_for_' . $this->pixel_name, $this->dyn_r_id_type);
236
 
@@ -238,47 +229,10 @@ trait Trait_Product {
238
  }
239
 
240
  protected function wpm_get_order_items( $order ) {
241
-
242
  $order_items = apply_filters_deprecated('wooptpm_order_items', [$order->get_items(), $order], '1.13.0', 'wpm_order_items');
243
-
244
- // Give option to filter order items
245
- // then return
246
  return apply_filters('wpm_order_items', $order_items, $order);
247
  }
248
 
249
- protected function get_front_end_order_items( $order ) {
250
-
251
- $order_items = $this->wpm_get_order_items($order);
252
- $order_items_formatted = [];
253
-
254
- foreach ((array) $order_items as $order_item) {
255
-
256
- $order_item_data = $order_item->get_data();
257
-
258
- $product = $order_item->get_product();
259
-
260
- if (!is_object($product)) {
261
-
262
- wc_get_logger()->debug('get_order_item_data received an order item which is not a valid product: ' . $order_item->get_id(), ['source' => 'wpm']);
263
- return [];
264
- }
265
-
266
- $order_items_formatted[$order_item_data['product_id']] = [
267
- 'id' => $order_item_data['product_id'],
268
- 'variation_id' => $order_item_data['variation_id'],
269
- 'name' => $order_item_data['name'],
270
- 'quantity' => $order_item_data['quantity'],
271
- 'price' => ( new Google($this->options) )->wpm_get_order_item_price($order_item, $product),
272
- 'subtotal' => (float) number_format($order_item_data['subtotal'], 2, '.', ''),
273
- 'subtotal_tax' => (float) number_format($order_item_data['subtotal_tax'], 2, '.', ''),
274
- 'total' => (float) number_format($order_item_data['total'], 2, '.', ''),
275
- 'total_tax' => (float) number_format($order_item_data['total_tax'], 2, '.', ''),
276
- ];
277
- }
278
-
279
- return $order_items_formatted;
280
- }
281
-
282
  public function buffer_get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
283
 
284
  ob_start();
@@ -289,23 +243,50 @@ trait Trait_Product {
289
  }
290
 
291
  public function get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
292
-
293
  if (!is_object($product)) {
 
 
294
  wc_get_logger()->debug('get_product_data_layer_script received an invalid product', ['source' => 'wpm']);
 
295
  return '';
296
  }
297
 
298
  $data = $this->get_product_details_for_datalayer($product);
299
 
300
- // If placed in <head> it must be a <meta> tag else, it can be an <input> tag
301
- // Added name and content to meta in order to pass W3 validation test at https://validator.w3.org/nu/
 
302
  $tag = $meta_tag ? "meta name='wpm-dataLayer-meta' content='" . $product->get_id() . "'" : "input type='hidden'";
303
 
 
 
 
 
 
 
304
  $this->get_product_data_layer_script_html_part_1($tag, $product, $data, $set_position, $meta_tag);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  }
306
 
307
  protected function get_product_data_layer_script_html_part_1( $tag, $product, $data, $set_position, $meta_tag ) {
308
-
309
  if ($meta_tag) {
310
  ?>
311
  <meta name="pm-dataLayer-meta" content="<?php esc_html_e($product->get_id()); ?>" class="wpmProductId"
@@ -318,27 +299,29 @@ trait Trait_Product {
318
  }
319
 
320
  ?>
321
- <script>
322
- (window.wpmDataLayer = window.wpmDataLayer || {}).products = window.wpmDataLayer.products || {}
323
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>] = <?php echo wp_json_encode($data); ?>;
324
- <?php $set_position ? $this->get_product_data_layer_script_html_part_2($product) : ''; ?>
325
  </script>
326
  <?php
 
327
  }
328
 
329
  protected function get_product_data_layer_script_html_part_2( $product ) {
330
  ?>
331
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>]['position'] = window.wpmDataLayer.position++
332
  <?php
 
333
  }
334
 
335
- public function get_product_details_for_datalayer( $product ) {
336
 
 
337
  global $woocommerce_wpml;
338
 
339
  $dyn_r_ids = $this->get_dyn_r_ids($product);
340
 
341
- if (( new Environment_Check($this->options) )->is_wpml_woocommerce_multi_currency_active()) {
342
  $price = $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency($product->get_id(), get_woocommerce_currency());
343
  } else {
344
  $price = $product->get_price();
@@ -353,11 +336,11 @@ trait Trait_Product {
353
  'category' => $this->get_product_category($product->get_id()),
354
  'quantity' => 1,
355
  'dyn_r_ids' => $dyn_r_ids,
356
- 'isVariable' => $product->get_type() === 'variable',
357
  'isVariation' => false,
358
  ];
359
 
360
- if ($product->get_type() === 'variation') {
361
 
362
  $parent_product = wc_get_product($product->get_parent_id());
363
  if ($parent_product) {
3
  namespace WCPM\Classes\Pixels;
4
 
5
  use WCPM\Classes\Admin\Environment_Check;
 
6
 
7
  if (!defined('ABSPATH')) {
8
  exit; // Exit if accessed directly
9
  }
10
 
11
  trait Trait_Product {
 
12
  protected function get_formatted_variant_text( $product ) {
13
  $variant_text_array = [];
14
 
25
  }
26
 
27
  protected function get_variation_or_product_id( $item, $variations_output = true ) {
28
+ if (0 <> $item['variation_id'] && true == $variations_output) {
 
29
  return $item['variation_id'];
30
  } else {
31
  return $item['product_id'];
35
  // https://stackoverflow.com/a/56278308/4688612
36
  // https://stackoverflow.com/a/39034036/4688612
37
  public function get_brand_name( $product_id ) {
38
+ // return $this->get_brand_by_taxonomy($product_id, 'product_brand') ?: // for Woocommerce Brands plugin
39
+ // $this->get_brand_by_taxonomy($product_id, 'yith_product_brand') ?: // for YITH WooCommerce Brands plugin
40
+ // $this->get_brand_by_taxonomy($product_id, 'pa_brand') ?: // for a custom product attribute
41
+ // '';
42
 
43
  $brand_taxonomy = 'pa_brand';
44
 
45
+ if (( new Environment_Check() )->is_yith_wc_brands_active()) {
46
  $brand_taxonomy = 'yith_product_brand';
47
+ } else {
48
+ if (( new Environment_Check() )->is_woocommerce_brands_active()) {
49
+ $brand_taxonomy = 'product_brand';
50
+ }
51
  }
52
 
53
  $brand_taxonomy = apply_filters_deprecated('wooptpm_custom_brand_taxonomy', [$brand_taxonomy], '1.13.0', 'wpm_custom_brand_taxonomy');
55
  // Use custom brand_taxonomy
56
  $brand_taxonomy = apply_filters('wpm_custom_brand_taxonomy', $brand_taxonomy);
57
 
58
+ // return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy) ?:
59
+ // $this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy) ?:
60
+ // '';
61
+
62
  if ($this->get_brand_by_taxonomy($product_id, $brand_taxonomy)) {
63
  return $this->get_brand_by_taxonomy($product_id, $brand_taxonomy);
64
  } elseif ($this->get_brand_by_taxonomy($product_id, 'pa_' . $brand_taxonomy)) {
69
  }
70
 
71
  public function get_brand_by_taxonomy( $product_id, $taxonomy ) {
 
72
  if (taxonomy_exists($taxonomy)) {
73
  $brand_names = wp_get_post_terms($product_id, $taxonomy, ['fields' => 'names']);
74
  return reset($brand_names);
79
 
80
  // get an array with all product categories
81
  public function get_product_category( $product_id ) {
 
 
 
 
 
 
82
  $prod_cats = get_the_terms($product_id, 'product_cat');
83
  $prod_cats_output = [];
84
 
85
  // only continue with the loop if one or more product categories have been set for the product
86
  if (!empty($prod_cats)) {
87
  foreach ((array) $prod_cats as $key) {
88
+ array_push($prod_cats_output, $key->name);
89
  }
90
 
91
  // apply filter to the $prod_cats_output array
95
  return $prod_cats_output;
96
  }
97
 
 
 
 
 
 
 
 
98
  protected function get_compiled_product_id( $product_id, $product_sku, $options, $channel = '' ) {
 
99
  // depending on setting use product IDs or SKUs
100
  if (0 == $this->options['google']['ads']['product_identifier'] || 'ga_ua' === $channel || 'ga_4' === $channel) {
101
  return (string) $product_id;
113
  }
114
 
115
  protected function get_dyn_r_ids( $product ) {
 
116
  $dyn_r_ids = [
117
  'post_id' => (string) $product->get_id(),
118
  'sku' => (string) $product->get_sku() ? $product->get_sku() : $product->get_id(),
126
  }
127
 
128
  protected function log_problematic_product_id( $product_id = 0 ) {
 
129
  wc_get_logger()->debug(
130
  'WooCommerce detects the page ID ' . $product_id . ' as product, but when invoked by wc_get_product( ' . $product_id . ' ) it returns no product object',
131
  ['source' => 'wpm']
133
  }
134
 
135
  protected function get_order_item_ids( $order ) {
 
136
  $order_items = $this->wpm_get_order_items($order);
137
  $order_items_array = [];
138
 
147
 
148
  $dyn_r_ids = $this->get_dyn_r_ids($product);
149
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
150
+ // $product_id_compiled = $this->get_compiled_product_id($product_id, $product->get_sku(), $this->options, '');
151
  array_push($order_items_array, $product_id_compiled);
152
  } else {
153
 
159
  }
160
 
161
  protected function get_order_items_formatted_for_purchase_event( $order ) {
 
162
  $order_items = $this->wpm_get_order_items($order);
163
  $order_items_formatted = [];
164
 
174
 
175
  $dyn_r_ids = $this->get_dyn_r_ids($product);
176
  $product_id_compiled = $dyn_r_ids[$this->get_dyn_r_id_type()];
177
+ // $product_id_compiled = $this->get_compiled_product_id($product_id, $product->get_sku(), $this->options, '');
178
 
179
  $product_details['id'] = $product_id_compiled;
180
  $product_details['name'] = $product->get_name();
183
  $product_details['brand'] = $this->get_brand_name($product_id);
184
  $product_details['category'] = implode(',', $this->get_product_category($product_id));
185
 
186
+ // error_log('type: ' . $product->get_type());
187
+
188
  if ($product->is_type('variation')) {
189
  $product_details['variant'] = $this->get_formatted_variant_text($product);
190
 
197
  }
198
 
199
  $order_items_formatted[] = $product_details;
200
+ // array_push($order_items_formatted, $product_details);
201
  } else {
202
 
203
  $this->log_problematic_product_id($product_id);
207
  return $order_items_formatted;
208
  }
209
 
 
210
 
211
+ protected function get_dyn_r_id_type() {
212
+ // $dyn_r_id_type = '';
 
213
 
214
  if (0 == $this->options_obj->google->ads->product_identifier) {
215
  $this->dyn_r_id_type = 'post_id';
221
  $this->dyn_r_id_type = 'gla';
222
  }
223
 
224
+ // if you want to change the dyn_r_id type for Google programmatically
225
  $this->dyn_r_id_type = apply_filters_deprecated('wooptpm_product_id_type_for_' . $this->pixel_name, [$this->dyn_r_id_type], '1.13.0', 'wpm_product_id_type_for_');
226
  $this->dyn_r_id_type = apply_filters('wpm_product_id_type_for_' . $this->pixel_name, $this->dyn_r_id_type);
227
 
229
  }
230
 
231
  protected function wpm_get_order_items( $order ) {
 
232
  $order_items = apply_filters_deprecated('wooptpm_order_items', [$order->get_items(), $order], '1.13.0', 'wpm_order_items');
 
 
 
233
  return apply_filters('wpm_order_items', $order_items, $order);
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  public function buffer_get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
237
 
238
  ob_start();
243
  }
244
 
245
  public function get_product_data_layer_script( $product, $set_position = true, $meta_tag = false ) {
 
246
  if (!is_object($product)) {
247
+
248
+ // $this->log_problematic_product_id();
249
  wc_get_logger()->debug('get_product_data_layer_script received an invalid product', ['source' => 'wpm']);
250
+
251
  return '';
252
  }
253
 
254
  $data = $this->get_product_details_for_datalayer($product);
255
 
256
+ // if placed in <head> it must be a <meta> tag else, it can be an <input> tag
257
+ // $tag = $meta_tag ? "meta" : "input";
258
+ // added name and content to meta in order to pass W3 validation test at https://validator.w3.org/nu/
259
  $tag = $meta_tag ? "meta name='wpm-dataLayer-meta' content='" . $product->get_id() . "'" : "input type='hidden'";
260
 
261
+ // $html = "
262
+ // <$tag class='wpmProductId' data-id='" . $product->get_id() . "'>
263
+ // <script type=\"text/javascript\" data-cfasync=\"false\">
264
+ // window.wpmDataLayer.products = window.wpmDataLayer.products || {};
265
+ // window.wpmDataLayer.products[" . $product->get_id() . "] = " . wp_json_encode($data) . ";";
266
+
267
  $this->get_product_data_layer_script_html_part_1($tag, $product, $data, $set_position, $meta_tag);
268
+
269
+ // $html = '
270
+ // <' . $tag . ' class="wpmProductId" data-id="' . $product->get_id() . '">
271
+ // <script type="text/javascript" data-cfasync="false">
272
+ // window.wpmDataLayer.products = window.wpmDataLayer.products || {};
273
+ // window.wpmDataLayer.products[' . $product->get_id() . '] = ' . wp_json_encode($data) . ';';
274
+
275
+ // if (true === $set_position) {
276
+ //
277
+ //// $html .= "
278
+ //// window.wpmDataLayer.products[{$product->get_id()}]['position'] = window.wpmDataLayer.position++;";
279
+ ////
280
+ // $this->get_product_data_layer_script_html_part_2($product);
281
+ // }
282
+
283
+ // $html .= '</script>';
284
+ // echo '</script>';
285
+
286
+ // return $html;
287
  }
288
 
289
  protected function get_product_data_layer_script_html_part_1( $tag, $product, $data, $set_position, $meta_tag ) {
 
290
  if ($meta_tag) {
291
  ?>
292
  <meta name="pm-dataLayer-meta" content="<?php esc_html_e($product->get_id()); ?>" class="wpmProductId"
299
  }
300
 
301
  ?>
302
+ <script type="text/javascript" data-cfasync="false">
303
+ window.wpmDataLayer.products = window.wpmDataLayer.products || {};
304
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>] = <?php echo wp_json_encode($data); ?>;
305
+ <?php true === $set_position ? '' : $this->get_product_data_layer_script_html_part_2($product); ?>
306
  </script>
307
  <?php
308
+
309
  }
310
 
311
  protected function get_product_data_layer_script_html_part_2( $product ) {
312
  ?>
313
  window.wpmDataLayer.products[<?php esc_html_e($product->get_id()); ?>]['position'] = window.wpmDataLayer.position++
314
  <?php
315
+
316
  }
317
 
 
318
 
319
+ public function get_product_details_for_datalayer( $product ) {
320
  global $woocommerce_wpml;
321
 
322
  $dyn_r_ids = $this->get_dyn_r_ids($product);
323
 
324
+ if (( new Environment_Check() )->is_wpml_woocommerce_multi_currency_active()) {
325
  $price = $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency($product->get_id(), get_woocommerce_currency());
326
  } else {
327
  $price = $product->get_price();
336
  'category' => $this->get_product_category($product->get_id()),
337
  'quantity' => 1,
338
  'dyn_r_ids' => $dyn_r_ids,
339
+ 'isVariable' => $product->get_type() == 'variable',
340
  'isVariation' => false,
341
  ];
342
 
343
+ if ($product->get_type() == 'variation') {
344
 
345
  $parent_product = wc_get_product($product->get_parent_id());
346
  if ($parent_product) {
classes/pixels/trait-shop.php CHANGED
@@ -2,288 +2,237 @@
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
5
- use libphonenumber\NumberParseException;
6
- use libphonenumber\PhoneNumberFormat;
7
- use libphonenumber\PhoneNumberUtil;
8
- use WC_Geolocation;
9
 
10
- if (!defined('ABSPATH')) {
11
- exit; // Exit if accessed directly
12
- }
13
-
14
- trait Trait_Shop {
15
-
16
- protected function get_list_name_suffix() {
17
- $list_suffix = '';
18
-
19
- if (is_product_category()) {
20
-
21
- $category = get_queried_object();
22
- $list_suffix = ' | ' . $category->name;
23
- $list_suffix = $this->add_parent_category_name($category, $list_suffix);
24
- } else {
25
- if (is_product_tag()) {
26
- $tag = get_queried_object();
27
- $list_suffix = ' | ' . $tag->name;
28
- }
29
- }
30
-
31
- return $list_suffix;
32
- }
33
-
34
- protected function add_parent_category_name( $category, $list_suffix ) {
35
- if ($category->parent > 0) {
36
-
37
- $parent_category = get_term_by('id', $category->parent, 'product_cat');
38
- $list_suffix = ' | ' . $parent_category->name . $list_suffix;
39
- $list_suffix = $this->add_parent_category_name($parent_category, $list_suffix);
40
- }
41
-
42
- return $list_suffix;
43
- }
44
-
45
- protected function get_list_id_suffix() {
46
- $list_suffix = '';
47
-
48
- if (is_product_category()) {
49
- $category = get_queried_object();
50
- $list_suffix = '.' . $category->slug;
51
- $list_suffix = $this->add_parent_category_id($category, $list_suffix);
52
- } else {
53
- if (is_product_tag()) {
54
- $tag = get_queried_object();
55
- $list_suffix = '.' . $tag->slug;
56
- }
57
- }
58
-
59
- return $list_suffix;
60
- }
61
-
62
- protected function add_parent_category_id( $category, $list_suffix ) {
63
- if ($category->parent > 0) {
64
-
65
- $parent_category = get_term_by('id', $category->parent, 'product_cat');
66
- $list_suffix = '.' . $parent_category->slug . $list_suffix;
67
- $list_suffix = $this->add_parent_category_id($parent_category, $list_suffix);
68
- }
69
-
70
- return $list_suffix;
71
- }
72
-
73
- // https://stackoverflow.com/a/49616130/4688612
74
- protected function get_order_from_order_received_page() {
75
- if ($this->get_order_from_query_vars()) {
76
- return $this->get_order_from_query_vars();
77
- } else {
78
- if ($this->get_order_with_url_order_key()) {
79
- return $this->get_order_with_url_order_key();
80
- } else {
81
- return false;
82
- }
83
- }
84
- }
85
-
86
- protected function wpm_get_order_total( $order ) {
87
-
88
- $order_total = 0 == $this->options_obj->shop->order_total_logic ? $order->get_subtotal() - $order->get_total_discount() : $order->get_total();
89
-
90
- // filter to adjust the order value
91
- $order_total = apply_filters_deprecated('wgact_conversion_value_filter', [$order_total, $order], '1.10.2', 'wooptpm_conversion_value_filter');
92
- $order_total = apply_filters_deprecated('wooptpm_conversion_value_filter', [$order_total, $order], '1.13.0', 'wpm_conversion_value_filter');
93
- $order_total = apply_filters('wpm_conversion_value_filter', $order_total, $order);
94
-
95
- return number_format((float) $order_total, 2, '.', '');
96
-
97
- }
98
-
99
- protected function get_order_from_query_vars() {
100
- global $wp;
101
-
102
- $order_id = absint($wp->query_vars['order-received']);
103
-
104
- if ($order_id && 0 != $order_id && wc_get_order($order_id)) {
105
-
106
- return wc_get_order($order_id);
107
- } else {
108
-
109
- wc_get_logger()->debug(
110
- 'WooCommerce couldn\'t retrieve the order ID from $wp->query_vars[\'order-received\']',
111
- ['source' => 'wpm']
112
- );
113
-
114
- wc_get_logger()->debug(
115
- print_r($wp->query_vars, true),
116
- ['source' => 'wpm']
117
- );
118
-
119
- return false;
120
- }
121
- }
122
-
123
- protected function get_order_with_url_order_key() {
124
-
125
- $_get = filter_input_array(INPUT_GET, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
126
-
127
- if (isset($_get['key'])) {
128
- $order_key = $_get['key'];
129
- return wc_get_order(wc_get_order_id_by_order_key($order_key));
130
- } else {
131
-
132
- wc_get_logger()->debug(
133
- 'WooCommerce couldn\'t retrieve the order ID from order key in the URL',
134
- ['source' => 'wpm']
135
- );
136
-
137
- $order_key = $_get['key'] ? $_get['key'] : '';
138
- wc_get_logger()->debug(
139
- 'URL order key: ' . $order_key,
140
- ['source' => 'wpm']
141
- );
142
-
143
- return false;
144
- }
145
- }
146
-
147
- protected function get_order_currency( $order ) {
148
- // use the right function to get the currency depending on the WooCommerce version
149
- return $this->woocommerce_3_and_above() ? $order->get_currency() : $order->get_order_currency();
150
- }
151
-
152
- protected function woocommerce_3_and_above() {
153
- global $woocommerce;
154
- if (version_compare($woocommerce->version, 3.0, '>=')) {
155
- return true;
156
- } else {
157
- return false;
158
- }
159
- }
160
-
161
- // https://stackoverflow.com/a/46216073/4688612
162
- // https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query#description
163
- protected function is_existing_customer( $order, $value = 0 ) {
164
-
165
- if (is_numeric($value)) { // Based on user ID (registered users)
166
- $meta_key = '_customer_user';
167
- $meta_value = 0 == $value ? get_current_user_id() : (int) $value;
168
- } else { // Based on billing email (Guest users)
169
- $meta_key = '_billing_email';
170
- $meta_value = sanitize_email($value);
171
- }
172
-
173
- $orders = wc_get_orders([
174
- 'return' => 'ids',
175
- 'meta_key' => $meta_key,
176
- 'meta_value' => $meta_value,
177
- // 'orderby' => 'date',
178
- // 'order' => 'DESC',
179
- 'post_status' => wc_get_is_paid_statuses(),
180
- 'limit' => 1,
181
- ]);
182
-
183
- // Return a boolean value based on orders count
184
- return count($orders) > 0;
185
- }
186
-
187
- protected function get_user_ip() {
188
-
189
- if ($this->is_localhost()) {
190
- $ip = WC_Geolocation::get_external_ip_address();
191
- } else {
192
- $ip = WC_Geolocation::get_ip_address();
193
- }
194
-
195
- // only set the IP if it is a public address
196
- $ip = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
197
-
198
- // Remove the IPv6 to IPv4 mapping in case the IP contains one
199
- // and return the IP plain public IPv4 or IPv6 IP
200
- // https://en.wikipedia.org/wiki/IPv6_address
201
- return str_replace('::ffff:', '', $ip);
202
- }
203
-
204
- protected function get_visitor_country() {
205
-
206
- $location = WC_Geolocation::geolocate_ip($this->get_user_ip());
207
-
208
- return $location['country'];
209
- }
210
-
211
- protected function is_localhost() {
212
-
213
- $_server = filter_input_array(INPUT_SERVER, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
214
-
215
- // If the IP is local, return true, else false
216
- // https://stackoverflow.com/a/13818647/4688612
217
- return !filter_var(
218
- $_server['REMOTE_ADDR'],
219
- FILTER_VALIDATE_IP,
220
- FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
221
- );
222
- }
223
-
224
- protected function get_user_email( $algo = null ) {
225
-
226
- if (is_user_logged_in()) {
227
- $current_user = wp_get_current_user();
228
- $email = $current_user->user_email;
229
- } elseif (is_order_received_page()) {
230
- $order = $this->get_order_from_order_received_page();
231
-
232
- if ($order) {
233
- $email = $order->get_billing_email();
234
- } else {
235
- $email = '';
236
- }
237
- } else {
238
- $email = '';
239
- }
240
-
241
- // encrypt email
242
- if ($email && $algo && in_array($algo, hash_algos(), true)) {
243
- $email = hash($algo, $email);
244
- }
245
-
246
- return $email;
247
- }
248
-
249
- private function get_e164_formatted_phone_number( $number, $country ) {
250
- try {
251
- $phone_util = PhoneNumberUtil::getInstance();
252
- $number_parsed = $phone_util->parse($number, $country);
253
- return $phone_util->format($number_parsed, PhoneNumberFormat::E164);
254
- } catch (NumberParseException $e) {
255
- error_log($e);
256
- return $number;
257
- }
258
- }
259
-
260
- protected function track_user( $user_id = null ) {
261
-
262
- $user = null;
263
-
264
- if (0 === $user_id) { // If anonymous visitor then track
265
- return true;
266
- } elseif ($user_id && 0 <= $user_id) { // If user ID is known, get the user
267
- $user = get_user_by('id', $user_id);
268
- } elseif (null === $user_id && is_user_logged_in()) { // If user id is not given, but the user is logged in, get the user
269
- $user = wp_get_current_user();
270
- }
271
-
272
- // Find out if the user has a role that is restricted from tracking
273
- if ($user) {
274
-
275
- foreach ($user->roles as $role) {
276
- if (in_array($role, $this->options_obj->shop->disable_tracking_for, true)) {
277
- return false;
278
- }
279
- }
280
- }
281
-
282
- return true;
283
- }
284
-
285
- protected function do_not_track_user( $user_id = null ) {
286
- return !$this->track_user($user_id);
287
- }
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  namespace WCPM\Classes\Pixels;
4
 
 
 
 
 
5
 
6
+ if ( !defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ // Exit if accessed directly
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
+ trait Trait_Shop
12
+ {
13
+ protected function get_formatted_script_tag_new( $components )
14
+ {
15
+ $allowed_protocols = [
16
+ 'http' => [],
17
+ 'https' => [],
18
+ ];
19
+ echo PHP_EOL ;
20
+
21
+ if ( $components['src'] ) {
22
+ echo "\t" . '<script ' . wp_kses( $this->print_script_components( $components ), [], $allowed_protocols ) . '></script>' ;
23
+ } else {
24
+ echo "\t" . '<script ' . wp_kses( $this->print_script_components( $components ), [], $allowed_protocols ) . '>' ;
25
+ }
26
+
27
+ echo PHP_EOL ;
28
+ }
29
+
30
+ protected function print_script_components( $components )
31
+ {
32
+ $attributes[] = $this->get_script_async_defer( $components );
33
+ $attributes[] = $this->get_script_src( $components['src'] );
34
+ $attributes[] = $this->get_script_type_value( $components['cookie_category'] );
35
+ $attributes[] = $this->get_script_cookie_category( $components['cookie_category'] );
36
+ $attributes[] = $this->get_script_data_wpm_pixel_name( $components['pixel_name'] );
37
+ $attributes[] = $this->get_script_cfasync( $components['inject_cfasync'] );
38
+ $attributes[] = $this->get_script_cookiebot_cookieconsent( $components );
39
+ return implode( ' ', array_filter( $attributes ) );
40
+ }
41
+
42
+ protected function get_script_cookiebot_cookieconsent( $components )
43
+ {
44
+ if ( array_key_exists( 'cookiebot-cookieconsent', $components ) && $components['cookiebot-cookieconsent'] ) {
45
+ return 'data-cookieconsent="ignore"';
46
+ }
47
+ }
48
+
49
+ protected function get_script_cfasync( $cfasync )
50
+ {
51
+ if ( $cfasync ) {
52
+ return 'data-cfasync="false"';
53
+ }
54
+ }
55
+
56
+ protected function get_script_data_wpm_pixel_name( $pixel_name )
57
+ {
58
+ return 'data-wpm-pixel-name="' . $pixel_name . '"';
59
+ }
60
+
61
+ protected function get_script_src( $src )
62
+ {
63
+
64
+ if ( $src ) {
65
+ if ( !$this->options_obj->shop->cookie_consent_mgmt->explicit_consent ) {
66
+ return $this->print_script_src_orig( $src );
67
+ }
68
+ return $this->print_script_src_data_wpm( $src );
69
+ }
70
+
71
+ }
72
+
73
+ protected function print_script_src_orig( $src )
74
+ {
75
+ return 'src="' . $src . '"';
76
+ }
77
+
78
+ protected function print_script_src_data_wpm( $src )
79
+ {
80
+ return 'data-wpm-src="' . $src . '"';
81
+ }
82
+
83
+ private function get_script_async_defer( $components )
84
+ {
85
+ if ( $components['src'] ) {
86
+ // A script tag can't have both async and defer attributes,
87
+ // therefore fall back to a default if both are set.
88
+ // Otherwise, use the one that is set.
89
+
90
+ if ( $components['async'] && $components['defer'] ) {
91
+ return 'async';
92
+ } else {
93
+
94
+ if ( $components['async'] ) {
95
+ return 'async';
96
+ } else {
97
+ if ( $components['defer'] ) {
98
+ return 'defer';
99
+ }
100
+ }
101
+
102
+ }
103
+
104
+ }
105
+ }
106
+
107
+ public function get_script_type_value( $cookie_category )
108
+ {
109
+ return 'type="text/javascript"';
110
+ }
111
+
112
+ protected function get_script_cookie_category( $cookie_category )
113
+ {
114
+ return 'data-wpm-cookie-category="' . $cookie_category . '"';
115
+ }
116
+
117
+ protected function get_list_name_suffix()
118
+ {
119
+ $list_suffix = '';
120
+
121
+ if ( is_product_category() ) {
122
+ $category = get_queried_object();
123
+ $list_suffix = ' | ' . $category->name;
124
+ $list_suffix = $this->add_parent_category_name( $category, $list_suffix );
125
+ } else {
126
+
127
+ if ( is_product_tag() ) {
128
+ $tag = get_queried_object();
129
+ $list_suffix = ' | ' . $tag->name;
130
+ }
131
+
132
+ }
133
+
134
+ return $list_suffix;
135
+ }
136
+
137
+ protected function add_parent_category_name( $category, $list_suffix )
138
+ {
139
+
140
+ if ( $category->parent > 0 ) {
141
+ $parent_category = get_term_by( 'id', $category->parent, 'product_cat' );
142
+ $list_suffix = ' | ' . $parent_category->name . $list_suffix;
143
+ $list_suffix = $this->add_parent_category_name( $parent_category, $list_suffix );
144
+ }
145
+
146
+ return $list_suffix;
147
+ }
148
+
149
+ protected function get_list_id_suffix()
150
+ {
151
+ $list_suffix = '';
152
+
153
+ if ( is_product_category() ) {
154
+ $category = get_queried_object();
155
+ $list_suffix = '.' . $category->slug;
156
+ $list_suffix = $this->add_parent_category_id( $category, $list_suffix );
157
+ } else {
158
+
159
+ if ( is_product_tag() ) {
160
+ $tag = get_queried_object();
161
+ $list_suffix = '.' . $tag->slug;
162
+ }
163
+
164
+ }
165
+
166
+ return $list_suffix;
167
+ }
168
+
169
+ protected function add_parent_category_id( $category, $list_suffix )
170
+ {
171
+
172
+ if ( $category->parent > 0 ) {
173
+ $parent_category = get_term_by( 'id', $category->parent, 'product_cat' );
174
+ $list_suffix = '.' . $parent_category->slug . $list_suffix;
175
+ $list_suffix = $this->add_parent_category_id( $parent_category, $list_suffix );
176
+ }
177
+
178
+ return $list_suffix;
179
+ }
180
+
181
+ // https://stackoverflow.com/a/49616130/4688612
182
+ protected function get_order_from_order_received_page()
183
+ {
184
+
185
+ if ( $this->get_order_from_query_vars() ) {
186
+ return $this->get_order_from_query_vars();
187
+ } else {
188
+
189
+ if ( $this->get_order_with_url_order_key() ) {
190
+ return $this->get_order_with_url_order_key();
191
+ } else {
192
+ return false;
193
+ }
194
+
195
+ }
196
+
197
+ }
198
+
199
+ protected function get_order_from_query_vars()
200
+ {
201
+ global $wp ;
202
+ $order_id = absint( $wp->query_vars['order-received'] );
203
+
204
+ if ( $order_id && 0 != $order_id && wc_get_order( $order_id ) ) {
205
+ return wc_get_order( $order_id );
206
+ } else {
207
+ wc_get_logger()->debug( 'WooCommerce couldn\'t retrieve the order ID from $wp->query_vars[\'order-received\']', [
208
+ 'source' => 'wpm',
209
+ ] );
210
+ wc_get_logger()->debug( print_r( $wp->query_vars, true ), [
211
+ 'source' => 'wpm',
212
+ ] );
213
+ return false;
214
+ }
215
+
216
+ }
217
+
218
+ protected function get_order_with_url_order_key()
219
+ {
220
+ $_get = filter_input_array( INPUT_GET, FILTER_SANITIZE_STRING );
221
+
222
+ if ( isset( $_get['key'] ) ) {
223
+ $order_key = $_get['key'];
224
+ return wc_get_order( wc_get_order_id_by_order_key( $order_key ) );
225
+ } else {
226
+ wc_get_logger()->debug( 'WooCommerce couldn\'t retrieve the order ID from order key in the URL', [
227
+ 'source' => 'wpm',
228
+ ] );
229
+ $order_key = ( $_get['key'] ? $_get['key'] : '' );
230
+ wc_get_logger()->debug( 'URL order key: ' . $order_key, [
231
+ 'source' => 'wpm',
232
+ ] );
233
+ return false;
234
+ }
235
+
236
+ }
237
+
238
+ }
css/admin.css CHANGED
@@ -47,7 +47,7 @@
47
  .developer-banner {
48
  background: #f3f5f6;
49
  color: #0071a1;
50
- padding: 0 10px;
51
  margin-bottom: 20px;
52
  border-radius: 3px;
53
  border-style: solid;
@@ -174,4 +174,4 @@ input:checked + .slider:before {
174
  text-decoration: none;
175
  margin-left: 5px;
176
  margin-right: 5px;
177
- }
47
  .developer-banner {
48
  background: #f3f5f6;
49
  color: #0071a1;
50
+ padding: 0px 10px;
51
  margin-bottom: 20px;
52
  border-radius: 3px;
53
  border-style: solid;
174
  text-decoration: none;
175
  margin-left: 5px;
176
  margin-right: 5px;
177
+ }
js/admin/ask-for-rating.js DELETED
@@ -1,37 +0,0 @@
1
- jQuery(function () {
2
-
3
- jQuery('.wpm-rating-success-notice').show();
4
-
5
- // go and rate it or already done
6
- jQuery(document).on('click', '#wpm-rate-it', function (e) {
7
- process_click(e, 'rating_done');
8
-
9
- let win = window.open('https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform', '_blank');
10
- win.focus();
11
- });
12
-
13
- jQuery(document).on('click', '#wpm-already-did', function (e) {
14
- process_click(e, 'rating_done');
15
- });
16
-
17
- // maybe rate later
18
- jQuery(document).on('click', '#wpm-maybe-later', function (e) {
19
- process_click(e, 'later');
20
- });
21
-
22
- function process_click(e, set) {
23
-
24
- e.preventDefault();
25
-
26
- let data = {
27
- 'action': 'wpm_dismissed_notice_handler',
28
- 'set' : set
29
- };
30
-
31
- jQuery.post(ajaxurl, data, function (response) {
32
- // console.log('Got this from the server: ' + response);
33
- // console.log('update rating done');
34
- });
35
- jQuery('.wpm-rating-success-notice').remove();
36
- }
37
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/environment-check.js DELETED
@@ -1,84 +0,0 @@
1
- jQuery(function () {
2
-
3
- // disable incompatible plugin warning
4
- jQuery(document).on('click', '.incompatible-plugin-error-dismissal-button', function (e) {
5
- e.preventDefault();
6
-
7
- let data = {
8
- 'action' : 'environment_check_handler',
9
- 'disable_warning': jQuery(this).data('plugin-slug'),
10
- };
11
-
12
- wpm_send_ajax_data(data);
13
- });
14
-
15
-
16
- // disable WP Rocket JavaScript concatenation
17
- jQuery(document).on('click', '#wpm-wp-rocket-js-concatenation-disable', function (e) {
18
- e.preventDefault();
19
-
20
- let data = {
21
- 'action': 'environment_check_handler',
22
- 'set' : 'disable_wp_rocket_javascript_concatenation'
23
- };
24
-
25
- wpm_send_ajax_data(data);
26
- });
27
-
28
- // dismiss WP Rocket JavaScript concatenation error
29
- jQuery(document).on('click', '#wpm-dismiss-wp-rocket-js-concatenation-error', function (e) {
30
- e.preventDefault();
31
-
32
- let data = {
33
- 'action': 'environment_check_handler',
34
- 'set' : 'dismiss_wp_rocket_javascript_concatenation_error'
35
- };
36
-
37
- wpm_send_ajax_data(data);
38
- });
39
-
40
- // disable WP Rocket JavaScript concatenation
41
- jQuery(document).on('click', '#wpm-litespeed-inline-js-dom-ready-disable', function (e) {
42
- e.preventDefault();
43
-
44
- let data = {
45
- 'action': 'environment_check_handler',
46
- 'set' : 'disable_litespeed_inline_js_dom_ready'
47
- };
48
-
49
- wpm_send_ajax_data(data);
50
- });
51
-
52
- // dismiss WP Rocket JavaScript concatenation error
53
- jQuery(document).on('click', '#wpm-dismiss-litespeed-inline-js-dom-ready-error', function (e) {
54
- e.preventDefault();
55
-
56
- let data = {
57
- 'action': 'environment_check_handler',
58
- 'set' : 'dismiss_litespeed_inline_js_dom_ready'
59
- };
60
-
61
- wpm_send_ajax_data(data);
62
- });
63
-
64
- // dismiss PayPal standard payment gateway warning
65
- jQuery(document).on('click', '#wpm-paypal-standard-error-dismissal-button', function (e) {
66
- e.preventDefault();
67
-
68
- let data = {
69
- 'action': 'environment_check_handler',
70
- 'set' : 'dismiss_paypal_standard_warning'
71
- };
72
-
73
- wpm_send_ajax_data(data);
74
- });
75
-
76
- });
77
-
78
- function wpm_send_ajax_data(data) {
79
- jQuery.post(ajaxurl, data, function (response) {
80
- // console.log('Got this from the server: ' + response);
81
- // console.log('update rating done');
82
- location.reload();
83
- });
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/freemius-keep-deactivate-button-enabled.js DELETED
@@ -1,22 +0,0 @@
1
- (function () {
2
- try {
3
-
4
- let observer = new MutationObserver(function (mutations) {
5
- mutations.forEach(function (mutation) {
6
- if (mutation.attributeName === "class") {
7
- let attributeValue = jQuery(mutation.target).prop(mutation.attributeName);
8
- if (attributeValue.includes('disabled')) {
9
- jQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');
10
- }
11
- }
12
- });
13
- });
14
-
15
- observer.observe(jQuery('.fs-modal').find('.button-deactivate')[0], {
16
- attributes: true
17
- });
18
-
19
- } catch (error) {
20
- console.error(error);
21
- }
22
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/helpers.js DELETED
@@ -1,12 +0,0 @@
1
- jQuery(function () {
2
-
3
- // copy debug info textarea
4
- jQuery("#debug-info-button").click(function () {
5
- jQuery("#debug-info-textarea").select();
6
- document.execCommand('copy');
7
- });
8
-
9
- jQuery("#wpm_pro_version_demo").on('click', function () {
10
- jQuery("#submit").click();
11
- });
12
- });
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/main-freemius.js DELETED
@@ -1 +0,0 @@
1
- import freemius_keep_deactivate_button_enabled from "./freemius-keep-deactivate-button-enabled.js"
 
js/admin/main.js DELETED
@@ -1,8 +0,0 @@
1
- import ask_for_rating from "./ask-for-rating.js"
2
- import environment_check from "./environment-check.js"
3
- import helpers from "./helpers.js"
4
- import script_blocker_warning from "./script-blocker-warning.js"
5
- import tabs from "./tabs.js"
6
-
7
-
8
- // console.log('WooCommerce Pixel Manager admin script')
 
 
 
 
 
 
 
 
js/admin/script-blocker-warning.js DELETED
@@ -1,13 +0,0 @@
1
- function wpm_hide_script_blocker_warning() {
2
- jQuery('#script-blocker-notice').hide();
3
- }
4
-
5
- // try to hide as soon as this script is loaded
6
- // might be too early in some cases, as the HTML is not rendered yet
7
- wpm_hide_script_blocker_warning();
8
-
9
- // if all other earlier attempts to hide did fail
10
- // run the function after entire DOM has been loaded
11
- jQuery(function () {
12
- wpm_hide_script_blocker_warning();
13
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/tabs.js DELETED
@@ -1,172 +0,0 @@
1
- jQuery(function () {
2
-
3
- let sections = [];
4
- let subsections = {};
5
-
6
- // hide unnecessary elements
7
- jQuery('.section').closest('tr').hide();
8
-
9
- // collect information on sections
10
- jQuery('.section').each(function () {
11
- sections.push({
12
- 'slug' : jQuery(this).data('sectionSlug'),
13
- 'title': jQuery(this).data('sectionTitle'),
14
- });
15
- });
16
-
17
- // collect information on subsections
18
- jQuery('.subsection').each(function () {
19
-
20
- subsections[jQuery(this).data('sectionSlug')] = subsections[jQuery(this).data('sectionSlug')] || [];
21
-
22
- subsections[jQuery(this).data('sectionSlug')].push({
23
- 'title': jQuery(this).data('subsectionTitle'),
24
- 'slug' : jQuery(this).data('subsectionSlug')
25
- });
26
- });
27
-
28
- // create tabs for sections
29
- sections.forEach(
30
- function (section) {
31
- jQuery(".nav-tab-wrapper").append("<a href=\"#\" class=\"nav-tab\" data-section-slug=\"" + section['slug'] + "\">" + section['title'] + "</a>");
32
- });
33
-
34
- // create tabs for each subsections
35
- jQuery(".nav-tab-wrapper").after(createSubtabUlHtml(subsections));
36
-
37
- // create on-click events on section tabs that toggle the views
38
- jQuery(".nav-tab-wrapper a").on('click', function (e) {
39
- e.preventDefault();
40
-
41
- // show clicked tab as active
42
- jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");
43
-
44
- // toggle the sections visible / invisible based on clicked tab
45
-
46
- let sectionSlug = jQuery(this).data('section-slug')
47
- toggleSections(sectionSlug, sections);
48
-
49
- // if subsection exists, click on first subsection
50
- if (sectionSlug in subsections) {
51
- jQuery("ul[data-section-slug=" + sectionSlug + "]").children(':first').trigger('click')
52
- }
53
- });
54
-
55
- // create on-click events on subsection tabs that toggle the views
56
- jQuery(".subnav-li").on('click', function (e) {
57
- e.preventDefault();
58
-
59
- // jQuery(this).hide();
60
- jQuery(this)
61
- .addClass('subnav-li-active').removeClass('subnav-li-inactive')
62
- .siblings()
63
- .addClass('subnav-li-inactive').removeClass('subnav-li-active');
64
-
65
- toggleSubsection(jQuery(this).parent().data('section-slug'), jQuery(this).data('subsection-slug'));
66
- });
67
-
68
- // if someone access a plugin tab by deep link, open the right tab
69
- // or fallback to default (first tab)
70
-
71
- // if deeplink is being opened open the according section and subsection
72
- if (getSectionParams()) {
73
-
74
- let sectionParams = getSectionParams();
75
-
76
- jQuery("a[data-section-slug=" + sectionParams['section'] + "]").trigger('click');
77
-
78
- if (sectionParams['subsection'] !== false) {
79
- jQuery("ul[data-section-slug=" + sectionParams['section'] + "]").children("[data-subsection-slug=" + sectionParams['subsection'] + "]").trigger('click')
80
- }
81
- } else {
82
- jQuery("a[data-section-slug=" + sections[0]['slug'] + "]").trigger('click');
83
- }
84
- });
85
-
86
- // creates the html with all subsection elements
87
- function createSubtabUlHtml(subsections) {
88
-
89
- let subsectionsKeys = Object.keys(subsections);
90
-
91
- let html = '';
92
-
93
- subsectionsKeys.forEach(function (subsectionKey) {
94
- html += '<ul class="subnav-tabs" data-section-slug="' + subsectionKey + '">';
95
-
96
- let subtabs = subsections[subsectionKey];
97
-
98
- subtabs.forEach(function (subtab) {
99
- html += '<li class="subnav-li subnav-li-inactive" data-subsection-slug="' + subtab['slug'] + '">' + subtab['title'] + '</li>'
100
- });
101
-
102
- html += '</ul>';
103
- });
104
-
105
- return html;
106
- }
107
-
108
- // if section (and subsection) URL parameters are set,
109
- // return them, otherwise return false
110
- function getSectionParams() {
111
- const queryString = window.location.search;
112
- const urlParams = new URLSearchParams(queryString);
113
-
114
- if (urlParams.get('section')) {
115
- return {
116
- 'section' : urlParams.get('section'),
117
- 'subsection': urlParams.get('subsection')
118
- };
119
- } else {
120
- return false;
121
- }
122
- }
123
-
124
- // toggles the sections
125
- function toggleSections(sectionSlug, sections) {
126
-
127
- jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide();
128
- jQuery(".subnav-tabs").hide();
129
- jQuery(".subnav-tabs[data-section-slug=" + sectionSlug + "]").show();
130
-
131
- let sectionPos = sections.findIndex((arrayElement) => arrayElement['slug'] === sectionSlug);
132
-
133
- jQuery("div[data-section-slug=" + sectionSlug + "]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show();
134
-
135
- // set the URL with the active tab parameter
136
- setUrl(sections[sectionPos]['slug']);
137
- }
138
-
139
- function toggleSubsection(sectionSlug, subsectionSlug) {
140
-
141
- jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide();
142
- jQuery("[data-section-slug=" + sectionSlug + "][data-subsection-slug=" + subsectionSlug + "]").closest("tr").siblings().andSelf().hide();
143
-
144
- jQuery("[data-section-slug=" + sectionSlug + "][data-subsection-slug=" + subsectionSlug + "]").closest("table").show();
145
- jQuery("[data-section-slug=" + sectionSlug + "][data-subsection-slug=" + subsectionSlug + "]").closest("tr").nextUntil(jQuery("[data-section-slug=" + sectionSlug + "][data-subsection-slug]").closest('tr')).show();
146
-
147
- // set the URL with the active tab parameter
148
- setUrl(sectionSlug, subsectionSlug);
149
- }
150
-
151
- // sets the new URL parameters
152
- function setUrl(sectionSlug, subsectionSlug = "") {
153
-
154
- const queryString = window.location.search;
155
- const urlParams = new URLSearchParams(queryString);
156
-
157
- urlParams.delete('section');
158
- urlParams.delete('subsection');
159
-
160
- let newParams = "section=" + sectionSlug;
161
- newParams += subsectionSlug ? "&subsection=" + subsectionSlug : "";
162
-
163
- history.pushState('', 'wpm' + sectionSlug, document.location.pathname + "?page=wpm&" + newParams);
164
-
165
- // make WP remember which was the selected tab on a save and return to the same tab after saving
166
- jQuery('input[name ="_wp_http_referer"]').val(getAdminPath() + "?page=wpm&" + newParams + "&settings-updated=true");
167
- }
168
-
169
- function getAdminPath() {
170
- let url = new URL(jQuery('#wp-admin-canonical').attr('href'));
171
- return url.pathname;
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/wpm-admin-freemius.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={92:()=>{!function(){try{new MutationObserver((function(e){e.forEach((function(e){"class"===e.attributeName&&jQuery(e.target).prop(e.attributeName).includes("disabled")&&jQuery(".fs-modal").find(".button-deactivate").removeClass("disabled")}))})).observe(jQuery(".fs-modal").find(".button-deactivate")[0],{attributes:!0})}catch(e){console.error(e)}}()}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(92)})()})();
2
  //# sourceMappingURL=wpm-admin-freemius.p1.min.js.map
1
+ (()=>{var e={44:()=>{!function(){try{new MutationObserver((function(e){e.forEach((function(e){"class"===e.attributeName&&jQuery(e.target).prop(e.attributeName).includes("disabled")&&jQuery(".fs-modal").find(".button-deactivate").removeClass("disabled")}))})).observe(jQuery(".fs-modal").find(".button-deactivate")[0],{attributes:!0})}catch(e){console.error(e)}}()}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(44)})()})();
2
  //# sourceMappingURL=wpm-admin-freemius.p1.min.js.map
js/admin/wpm-admin-freemius.p1.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wpm-admin-freemius.p1.min.js","mappings":"sBAAA,WACC,IAEgB,IAAIA,kBAAiB,SAAUC,GAC7CA,EAAUC,SAAQ,SAAUC,GACI,UAA3BA,EAASC,eACSC,OAAOF,EAASG,QAAQC,KAAKJ,EAASC,eACxCI,SAAS,aAC3BH,OAAO,aAAaI,KAAK,sBAAsBC,YAAY,kBAMtDC,QAAQN,OAAO,aAAaI,KAAK,sBAAsB,GAAI,CACnEG,YAAY,IAGZ,MAAOC,GACRC,QAAQD,MAAMA,IAnBhB,KCCIE,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACK,EAAK5B,IAAUwB,OAAOK,UAAUC,eAAeC,KAAKH,EAAK5B,G","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/admin/freemius-keep-deactivate-button-enabled.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/webpack/runtime/compat get default export","webpack://WooCommerce-Pixel-Manager/webpack/runtime/define property getters","webpack://WooCommerce-Pixel-Manager/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["(function () {\n\ttry {\n\n\t\tlet observer = new MutationObserver(function (mutations) {\n\t\t\tmutations.forEach(function (mutation) {\n\t\t\t\tif (mutation.attributeName === \"class\") {\n\t\t\t\t\tlet attributeValue = jQuery(mutation.target).prop(mutation.attributeName);\n\t\t\t\t\tif (attributeValue.includes('disabled')) {\n\t\t\t\t\t\tjQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(jQuery('.fs-modal').find('.button-deactivate')[0], {\n\t\t\tattributes: true\n\t\t});\n\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["MutationObserver","mutations","forEach","mutation","attributeName","jQuery","target","prop","includes","find","removeClass","observe","attributes","error","console","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prototype","hasOwnProperty","call"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-admin-freemius.p1.min.js","mappings":"sBAAA,WACC,IAEgB,IAAIA,kBAAiB,SAAUC,GAC7CA,EAAUC,SAAQ,SAAUC,GACI,UAA3BA,EAASC,eACSC,OAAOF,EAASG,QAAQC,KAAKJ,EAASC,eACxCI,SAAS,aAC3BH,OAAO,aAAaI,KAAK,sBAAsBC,YAAY,kBAMtDC,QAAQN,OAAO,aAAaI,KAAK,sBAAsB,GAAI,CACnEG,YAAY,IAGZ,MAAOC,GACRC,QAAQD,MAAMA,IAnBhB,KCCIE,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACK,EAAK5B,IAAUwB,OAAOK,UAAUC,eAAeC,KAAKH,EAAK5B,G","sources":["webpack://wgact/./src/js/admin/freemius-keep-deactivate-button-enabled.jsx","webpack://wgact/webpack/bootstrap","webpack://wgact/webpack/runtime/compat get default export","webpack://wgact/webpack/runtime/define property getters","webpack://wgact/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["(function () {\n\ttry {\n\n\t\tlet observer = new MutationObserver(function (mutations) {\n\t\t\tmutations.forEach(function (mutation) {\n\t\t\t\tif (mutation.attributeName === \"class\") {\n\t\t\t\t\tlet attributeValue = jQuery(mutation.target).prop(mutation.attributeName);\n\t\t\t\t\tif (attributeValue.includes('disabled')) {\n\t\t\t\t\t\tjQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(jQuery('.fs-modal').find('.button-deactivate')[0], {\n\t\t\tattributes: true\n\t\t});\n\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n})();\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["MutationObserver","mutations","forEach","mutation","attributeName","jQuery","target","prop","includes","find","removeClass","observe","attributes","error","console","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prototype","hasOwnProperty","call"],"sourceRoot":""}
js/admin/wpm-admin.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={684:()=>{jQuery((function(){function e(e,t){e.preventDefault();let n={action:"wpm_dismissed_notice_handler",set:t};jQuery.post(ajaxurl,n,(function(e){})),jQuery(".wpm-rating-success-notice").remove()}jQuery(".wpm-rating-success-notice").show(),jQuery(document).on("click","#wpm-rate-it",(function(t){e(t,"rating_done"),window.open("https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform","_blank").focus()})),jQuery(document).on("click","#wpm-already-did",(function(t){e(t,"rating_done")})),jQuery(document).on("click","#wpm-maybe-later",(function(t){e(t,"later")}))}))},940:()=>{function e(e){jQuery.post(ajaxurl,e,(function(e){location.reload()}))}jQuery((function(){jQuery(document).on("click",".incompatible-plugin-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",disable_warning:jQuery(this).data("plugin-slug")})})),jQuery(document).on("click","#wpm-wp-rocket-js-concatenation-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_wp_rocket_javascript_concatenation"})})),jQuery(document).on("click","#wpm-dismiss-wp-rocket-js-concatenation-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_wp_rocket_javascript_concatenation_error"})})),jQuery(document).on("click","#wpm-litespeed-inline-js-dom-ready-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-dismiss-litespeed-inline-js-dom-ready-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-paypal-standard-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_paypal_standard_warning"})}))}))},663:()=>{jQuery((function(){jQuery("#debug-info-button").click((function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").click()}))}))},958:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},966:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=window.location.search,s=new URLSearchParams(i);s.delete("section"),s.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){let n=[],i={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){i[jQuery(this).data("sectionSlug")]=i[jQuery(this).data("sectionSlug")]||[],i[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="subnav-li subnav-li-inactive" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(i)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let s=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".subnav-tabs").hide(),jQuery(".subnav-tabs[data-section-slug="+e+"]").show();let i=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[i].slug)}(s,n),s in i&&jQuery("ul[data-section-slug="+s+"]").children(":first").trigger("click")})),jQuery(".subnav-li").on("click",(function(e){var n,i;e.preventDefault(),jQuery(this).addClass("subnav-li-active").removeClass("subnav-li-inactive").siblings().addClass("subnav-li-inactive").removeClass("subnav-li-active"),n=jQuery(this).parent().data("section-slug"),i=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,i)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")}))}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(684),n(940),n(663),n(958),n(966)})()})();
2
  //# sourceMappingURL=wpm-admin.p1.min.js.map
1
+ (()=>{var e={494:()=>{jQuery((function(){function e(e,t){e.preventDefault();let n={action:"wpm_dismissed_notice_handler",set:t};jQuery.post(ajaxurl,n,(function(e){})),jQuery(".wpm-rating-success-notice").remove()}jQuery(".wpm-rating-success-notice").show(),jQuery(document).on("click","#wpm-rate-it",(function(t){e(t,"rating_done"),window.open("https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform","_blank").focus()})),jQuery(document).on("click","#wpm-already-did",(function(t){e(t,"rating_done")})),jQuery(document).on("click","#wpm-maybe-later",(function(t){e(t,"later")}))}))},877:()=>{function e(e){jQuery.post(ajaxurl,e,(function(e){location.reload()}))}jQuery((function(){jQuery(document).on("click",".incompatible-plugin-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",disable_warning:jQuery(this).data("plugin-slug")})})),jQuery(document).on("click","#wpm-wp-rocket-js-concatenation-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_wp_rocket_javascript_concatenation"})})),jQuery(document).on("click","#wpm-dismiss-wp-rocket-js-concatenation-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_wp_rocket_javascript_concatenation_error"})})),jQuery(document).on("click","#wpm-litespeed-inline-js-dom-ready-disable",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"disable_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-dismiss-litespeed-inline-js-dom-ready-error",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_litespeed_inline_js_dom_ready"})})),jQuery(document).on("click","#wpm-paypal-standard-error-dismissal-button",(function(t){t.preventDefault(),e({action:"environment_check_handler",set:"dismiss_paypal_standard_warning"})}))}))},327:()=>{jQuery((function(){jQuery("#debug-info-button").click((function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").click()}))}))},299:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},163:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=window.location.search,s=new URLSearchParams(i);s.delete("section"),s.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){let n=[],i={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){i[jQuery(this).data("sectionSlug")]=i[jQuery(this).data("sectionSlug")]||[],i[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="subnav-li subnav-li-inactive" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(i)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let s=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".subnav-tabs").hide(),jQuery(".subnav-tabs[data-section-slug="+e+"]").show();let i=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[i].slug)}(s,n),s in i&&jQuery("ul[data-section-slug="+s+"]").children(":first").trigger("click")})),jQuery(".subnav-li").on("click",(function(e){var n,i;e.preventDefault(),jQuery(this).addClass("subnav-li-active").removeClass("subnav-li-inactive").siblings().addClass("subnav-li-inactive").removeClass("subnav-li-active"),n=jQuery(this).parent().data("section-slug"),i=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+i+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,i)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")}))}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(494),n(877),n(327),n(299),n(163)})()})();
2
  //# sourceMappingURL=wpm-admin.p1.min.js.map
js/admin/wpm-admin.p1.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wpm-admin.p1.min.js","mappings":"sBAAAA,QAAO,WAqBN,SAASC,EAAcC,EAAGC,GAEzBD,EAAEE,iBAEF,IAAIC,EAAO,CACV,OAAU,+BACV,IAAUF,GAGXH,OAAOM,KAAKC,QAASF,GAAM,SAAUG,OAIrCR,OAAO,8BAA8BS,SAhCtCT,OAAO,8BAA8BU,OAGrCV,OAAOW,UAAUC,GAAG,QAAS,gBAAgB,SAAUV,GACtDD,EAAcC,EAAG,eAEPW,OAAOC,KAAK,uHAAwH,UAC1IC,WAGLf,OA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,2BAA2Ba,QAAQ,OAAOnC,OAG9MqB,EAAOC,EAAaC,MA5EhBR,IAAoB,CAEvB,IAAIgD,EAAgBhD,IAEpBzB,OAAO,uBAAyByE,EAAa,QAAc,KAAKF,QAAQ,UAEpC,IAAhCE,EAAa,YAChBzE,OAAO,wBAA0ByE,EAAa,QAAc,KAAKH,SAAS,yBAA2BG,EAAa,WAAiB,KAAKF,QAAQ,cAGjJvE,OAAO,uBAAyB2C,EAAS,GAAT,KAAsB,KAAK4B,QAAQ,cChFjEG,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QCpBfJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EnC,OAAOqC,eAAeX,EAASS,EAAK,CAAEG,YAAY,EAAM7D,IAAKyD,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACG,EAAKC,IAAUxC,OAAOyC,UAAUC,eAAeC,KAAKJ,EAAKC,G","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/admin/ask-for-rating.js","webpack://WooCommerce-Pixel-Manager/./src/js/admin/environment-check.js","webpack://WooCommerce-Pixel-Manager/./src/js/admin/helpers.js","webpack://WooCommerce-Pixel-Manager/./src/js/admin/script-blocker-warning.js","webpack://WooCommerce-Pixel-Manager/./src/js/admin/tabs.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/webpack/runtime/compat get default export","webpack://WooCommerce-Pixel-Manager/webpack/runtime/define property getters","webpack://WooCommerce-Pixel-Manager/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["jQuery(function () {\n\n\tjQuery('.wpm-rating-success-notice').show();\n\n\t// go and rate it or already done\n\tjQuery(document).on('click', '#wpm-rate-it', function (e) {\n\t\tprocess_click(e, 'rating_done');\n\n\t\tlet win = window.open('https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform', '_blank');\n\t\twin.focus();\n\t});\n\n\tjQuery(document).on('click', '#wpm-already-did', function (e) {\n\t\tprocess_click(e, 'rating_done');\n\t});\n\n\t// maybe rate later\n\tjQuery(document).on('click', '#wpm-maybe-later', function (e) {\n\t\tprocess_click(e, 'later');\n\t});\n\n\tfunction process_click(e, set) {\n\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'wpm_dismissed_notice_handler',\n\t\t\t'set' : set\n\t\t};\n\n\t\tjQuery.post(ajaxurl, data, function (response) {\n\t\t\t// console.log('Got this from the server: ' + response);\n\t\t\t// console.log('update rating done');\n\t\t});\n\t\tjQuery('.wpm-rating-success-notice').remove();\n\t}\n});\n","jQuery(function () {\n\n\t// disable incompatible plugin warning\n\tjQuery(document).on('click', '.incompatible-plugin-error-dismissal-button', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action' : 'environment_check_handler',\n\t\t\t'disable_warning': jQuery(this).data('plugin-slug'),\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\n\t// disable WP Rocket JavaScript concatenation\n\tjQuery(document).on('click', '#wpm-wp-rocket-js-concatenation-disable', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'disable_wp_rocket_javascript_concatenation'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss WP Rocket JavaScript concatenation error\n\tjQuery(document).on('click', '#wpm-dismiss-wp-rocket-js-concatenation-error', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_wp_rocket_javascript_concatenation_error'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// disable WP Rocket JavaScript concatenation\n\tjQuery(document).on('click', '#wpm-litespeed-inline-js-dom-ready-disable', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'disable_litespeed_inline_js_dom_ready'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss WP Rocket JavaScript concatenation error\n\tjQuery(document).on('click', '#wpm-dismiss-litespeed-inline-js-dom-ready-error', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_litespeed_inline_js_dom_ready'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss PayPal standard payment gateway warning\n\tjQuery(document).on('click', '#wpm-paypal-standard-error-dismissal-button', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_paypal_standard_warning'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n});\n\nfunction wpm_send_ajax_data(data) {\n\tjQuery.post(ajaxurl, data, function (response) {\n\t\t// console.log('Got this from the server: ' + response);\n\t\t// console.log('update rating done');\n\t\tlocation.reload();\n\t});\n}\n","jQuery(function () {\n\n\t// copy debug info textarea\n\tjQuery(\"#debug-info-button\").click(function () {\n\t\tjQuery(\"#debug-info-textarea\").select();\n\t\tdocument.execCommand('copy');\n\t});\n\n\tjQuery(\"#wpm_pro_version_demo\").on('click', function () {\n\t\tjQuery(\"#submit\").click();\n\t});\n});\n","function wpm_hide_script_blocker_warning() {\n\tjQuery('#script-blocker-notice').hide();\n}\n\n// try to hide as soon as this script is loaded\n// might be too early in some cases, as the HTML is not rendered yet\nwpm_hide_script_blocker_warning();\n\n// if all other earlier attempts to hide did fail\n// run the function after entire DOM has been loaded\njQuery(function () {\n\twpm_hide_script_blocker_warning();\n});\n","jQuery(function () {\n\n\tlet sections = [];\n\tlet subsections = {};\n\n\t// hide unnecessary elements\n\tjQuery('.section').closest('tr').hide();\n\n\t// collect information on sections\n\tjQuery('.section').each(function () {\n\t\tsections.push({\n\t\t\t'slug' : jQuery(this).data('sectionSlug'),\n\t\t\t'title': jQuery(this).data('sectionTitle'),\n\t\t});\n\t});\n\n\t// collect information on subsections\n\tjQuery('.subsection').each(function () {\n\n\t\tsubsections[jQuery(this).data('sectionSlug')] = subsections[jQuery(this).data('sectionSlug')] || [];\n\n\t\tsubsections[jQuery(this).data('sectionSlug')].push({\n\t\t\t'title': jQuery(this).data('subsectionTitle'),\n\t\t\t'slug' : jQuery(this).data('subsectionSlug')\n\t\t});\n\t});\n\n\t// create tabs for sections\n\tsections.forEach(\n\t\tfunction (section) {\n\t\t\tjQuery(\".nav-tab-wrapper\").append(\"<a href=\\\"#\\\" class=\\\"nav-tab\\\" data-section-slug=\\\"\" + section['slug'] + \"\\\">\" + section['title'] + \"</a>\");\n\t\t});\n\n\t// create tabs for each subsections\n\tjQuery(\".nav-tab-wrapper\").after(createSubtabUlHtml(subsections));\n\n\t// create on-click events on section tabs that toggle the views\n\tjQuery(\".nav-tab-wrapper a\").on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t// show clicked tab as active\n\t\tjQuery(this).addClass(\"nav-tab-active\").siblings().removeClass(\"nav-tab-active\");\n\n\t\t// toggle the sections visible / invisible based on clicked tab\n\n\t\tlet sectionSlug = jQuery(this).data('section-slug')\n\t\ttoggleSections(sectionSlug, sections);\n\n\t\t// if subsection exists, click on first subsection\n\t\tif (sectionSlug in subsections) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionSlug + \"]\").children(':first').trigger('click')\n\t\t}\n\t});\n\n\t// create on-click events on subsection tabs that toggle the views\n\tjQuery(\".subnav-li\").on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t// jQuery(this).hide();\n\t\tjQuery(this)\n\t\t\t.addClass('subnav-li-active').removeClass('subnav-li-inactive')\n\t\t\t.siblings()\n\t\t\t.addClass('subnav-li-inactive').removeClass('subnav-li-active');\n\n\t\ttoggleSubsection(jQuery(this).parent().data('section-slug'), jQuery(this).data('subsection-slug'));\n\t});\n\n\t// if someone access a plugin tab by deep link, open the right tab\n\t// or fallback to default (first tab)\n\n\t// if deeplink is being opened open the according section and subsection\n\tif (getSectionParams()) {\n\n\t\tlet sectionParams = getSectionParams();\n\n\t\tjQuery(\"a[data-section-slug=\" + sectionParams['section'] + \"]\").trigger('click');\n\n\t\tif (sectionParams['subsection'] !== false) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionParams['section'] + \"]\").children(\"[data-subsection-slug=\" + sectionParams['subsection'] + \"]\").trigger('click')\n\t\t}\n\t} else {\n\t\tjQuery(\"a[data-section-slug=\" + sections[0]['slug'] + \"]\").trigger('click');\n\t}\n});\n\n// creates the html with all subsection elements\nfunction createSubtabUlHtml(subsections) {\n\n\tlet subsectionsKeys = Object.keys(subsections);\n\n\tlet html = '';\n\n\tsubsectionsKeys.forEach(function (subsectionKey) {\n\t\thtml += '<ul class=\"subnav-tabs\" data-section-slug=\"' + subsectionKey + '\">';\n\n\t\tlet subtabs = subsections[subsectionKey];\n\n\t\tsubtabs.forEach(function (subtab) {\n\t\t\thtml += '<li class=\"subnav-li subnav-li-inactive\" data-subsection-slug=\"' + subtab['slug'] + '\">' + subtab['title'] + '</li>'\n\t\t});\n\n\t\thtml += '</ul>';\n\t});\n\n\treturn html;\n}\n\n// if section (and subsection) URL parameters are set,\n// return them, otherwise return false\nfunction getSectionParams() {\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\n\tif (urlParams.get('section')) {\n\t\treturn {\n\t\t\t'section' : urlParams.get('section'),\n\t\t\t'subsection': urlParams.get('subsection')\n\t\t};\n\t} else {\n\t\treturn false;\n\t}\n}\n\n// toggles the sections\nfunction toggleSections(sectionSlug, sections) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide();\n\tjQuery(\".subnav-tabs\").hide();\n\tjQuery(\".subnav-tabs[data-section-slug=\" + sectionSlug + \"]\").show();\n\n\tlet sectionPos = sections.findIndex((arrayElement) => arrayElement['slug'] === sectionSlug);\n\n\tjQuery(\"div[data-section-slug=\" + sectionSlug + \"]\").closest(\"table\").prevAll(\"h2:first\").next().nextUntil(\"h2, .submit\").andSelf().show();\n\n\t// set the URL with the active tab parameter\n\tsetUrl(sections[sectionPos]['slug']);\n}\n\nfunction toggleSubsection(sectionSlug, subsectionSlug) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide();\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").siblings().andSelf().hide();\n\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"table\").show();\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").nextUntil(jQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug]\").closest('tr')).show();\n\n\t// set the URL with the active tab parameter\n\tsetUrl(sectionSlug, subsectionSlug);\n}\n\n// sets the new URL parameters\nfunction setUrl(sectionSlug, subsectionSlug = \"\") {\n\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\n\turlParams.delete('section');\n\turlParams.delete('subsection');\n\n\tlet newParams = \"section=\" + sectionSlug;\n\tnewParams += subsectionSlug ? \"&subsection=\" + subsectionSlug : \"\";\n\n\thistory.pushState('', 'wpm' + sectionSlug, document.location.pathname + \"?page=wpm&\" + newParams);\n\n\t// make WP remember which was the selected tab on a save and return to the same tab after saving\n\tjQuery('input[name =\"_wp_http_referer\"]').val(getAdminPath() + \"?page=wpm&\" + newParams + \"&settings-updated=true\");\n}\n\nfunction getAdminPath() {\n\tlet url = new URL(jQuery('#wp-admin-canonical').attr('href'));\n\treturn url.pathname;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["jQuery","process_click","e","set","preventDefault","data","post","ajaxurl","response","remove","show","document","on","window","open","focus","wpm_send_ajax_data","location","reload","this","click","select","execCommand","wpm_hide_script_blocker_warning","hide","getSectionParams","queryString","search","urlParams","URLSearchParams","get","setUrl","sectionSlug","subsectionSlug","delete","newParams","history","pushState","pathname","val","getAdminPath","URL","attr","sections","subsections","closest","each","push","forEach","section","append","after","subsectionsKeys","Object","keys","html","subsectionKey","subtab","createSubtabUlHtml","addClass","siblings","removeClass","nextUntil","andSelf","sectionPos","findIndex","arrayElement","prevAll","next","toggleSections","children","trigger","parent","sectionParams","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","call"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-admin.p1.min.js","mappings":"sBAAAA,QAAO,WAqBN,SAASC,EAAcC,EAAGC,GAEzBD,EAAEE,iBAEF,IAAIC,EAAO,CACV,OAAU,+BACV,IAAUF,GAGXH,OAAOM,KAAKC,QAASF,GAAM,SAAUG,OAIrCR,OAAO,8BAA8BS,SAhCtCT,OAAO,8BAA8BU,OAGrCV,OAAOW,UAAUC,GAAG,QAAS,gBAAgB,SAAUV,GACtDD,EAAcC,EAAG,eAEPW,OAAOC,KAAK,uHAAwH,UAC1IC,WAGLf,OAAOW,UAAUC,GAAG,QAAS,oBAAoB,SAAUV,GAC1DD,EAAcC,EAAG,kBAIlBF,OAAOW,UAAUC,GAAG,QAAS,oBAAoB,SAAUV,GAC1DD,EAAcC,EAAG,gB,SC2DnB,SAASc,EAAmBX,GAC3BL,OAAOM,KAAKC,QAASF,GAAM,SAAUG,GAGpCS,SAASC,YAjFXlB,QAAO,WAGNA,OAAOW,UAAUC,GAAG,QAAS,+CAA+C,SAAUV,GACrFA,EAAEE,iBAOFY,EALW,CACV,OAAmB,4BACnB,gBAAmBhB,OAAOmB,MAAMd,KAAK,oBAQvCL,OAAOW,UAAUC,GAAG,QAAS,2CAA2C,SAAUV,GACjFA,EAAEE,iBAOFY,EALW,CACV,OAAU,4BACV,IAAU,kDAOZhB,OAAOW,UAAUC,GAAG,QAAS,iDAAiD,SAAUV,GACvFA,EAAEE,iBAOFY,EALW,CACV,OAAU,4BACV,IAAU,wDAOZhB,OAAOW,UAAUC,GAAG,QAAS,8CAA8C,SAAUV,GACpFA,EAAEE,iBAOFY,EALW,CACV,OAAU,4BACV,IAA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AQ,CAAEG,EAAGH,IAC5BA,GCLRR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EnC,OAAOqC,eAAeX,EAASS,EAAK,CAAEG,YAAY,EAAM7D,IAAKyD,EAAWC,MCJ3Eb,EAAoBc,EAAI,CAACG,EAAKC,IAAUxC,OAAOyC,UAAUC,eAAeC,KAAKJ,EAAKC,G","sources":["webpack://wgact/./src/js/admin/ask-for-rating.jsx","webpack://wgact/./src/js/admin/environment-check.jsx","webpack://wgact/./src/js/admin/helpers.jsx","webpack://wgact/./src/js/admin/script-blocker-warning.jsx","webpack://wgact/./src/js/admin/tabs.jsx","webpack://wgact/webpack/bootstrap","webpack://wgact/webpack/runtime/compat get default export","webpack://wgact/webpack/runtime/define property getters","webpack://wgact/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["jQuery(function () {\n\n\tjQuery('.wpm-rating-success-notice').show();\n\n\t// go and rate it or already done\n\tjQuery(document).on('click', '#wpm-rate-it', function (e) {\n\t\tprocess_click(e, 'rating_done');\n\n\t\tlet win = window.open('https://wordpress.org/support/view/plugin-reviews/woocommerce-google-adwords-conversion-tracking-tag?rate=5#postform', '_blank');\n\t\twin.focus();\n\t});\n\n\tjQuery(document).on('click', '#wpm-already-did', function (e) {\n\t\tprocess_click(e, 'rating_done');\n\t});\n\n\t// maybe rate later\n\tjQuery(document).on('click', '#wpm-maybe-later', function (e) {\n\t\tprocess_click(e, 'later');\n\t});\n\n\tfunction process_click(e, set) {\n\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'wpm_dismissed_notice_handler',\n\t\t\t'set' : set\n\t\t};\n\n\t\tjQuery.post(ajaxurl, data, function (response) {\n\t\t\t// console.log('Got this from the server: ' + response);\n\t\t\t// console.log('update rating done');\n\t\t});\n\t\tjQuery('.wpm-rating-success-notice').remove();\n\t}\n});\n","jQuery(function () {\n\n\t// disable incompatible plugin warning\n\tjQuery(document).on('click', '.incompatible-plugin-error-dismissal-button', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action' : 'environment_check_handler',\n\t\t\t'disable_warning': jQuery(this).data('plugin-slug'),\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\n\t// disable WP Rocket JavaScript concatenation\n\tjQuery(document).on('click', '#wpm-wp-rocket-js-concatenation-disable', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'disable_wp_rocket_javascript_concatenation'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss WP Rocket JavaScript concatenation error\n\tjQuery(document).on('click', '#wpm-dismiss-wp-rocket-js-concatenation-error', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_wp_rocket_javascript_concatenation_error'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// disable WP Rocket JavaScript concatenation\n\tjQuery(document).on('click', '#wpm-litespeed-inline-js-dom-ready-disable', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'disable_litespeed_inline_js_dom_ready'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss WP Rocket JavaScript concatenation error\n\tjQuery(document).on('click', '#wpm-dismiss-litespeed-inline-js-dom-ready-error', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_litespeed_inline_js_dom_ready'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n\t// dismiss PayPal standard payment gateway warning\n\tjQuery(document).on('click', '#wpm-paypal-standard-error-dismissal-button', function (e) {\n\t\te.preventDefault();\n\n\t\tlet data = {\n\t\t\t'action': 'environment_check_handler',\n\t\t\t'set' : 'dismiss_paypal_standard_warning'\n\t\t};\n\n\t\twpm_send_ajax_data(data);\n\t});\n\n});\n\nfunction wpm_send_ajax_data(data) {\n\tjQuery.post(ajaxurl, data, function (response) {\n\t\t// console.log('Got this from the server: ' + response);\n\t\t// console.log('update rating done');\n\t\tlocation.reload();\n\t});\n}\n","jQuery(function () {\n\n\t// copy debug info textarea\n\tjQuery(\"#debug-info-button\").click(function () {\n\t\tjQuery(\"#debug-info-textarea\").select();\n\t\tdocument.execCommand('copy');\n\t});\n\n\tjQuery(\"#wpm_pro_version_demo\").on('click', function () {\n\t\tjQuery(\"#submit\").click();\n\t});\n});\n","function wpm_hide_script_blocker_warning() {\n\tjQuery('#script-blocker-notice').hide();\n}\n\n// try to hide as soon as this script is loaded\n// might be too early in some cases, as the HTML is not rendered yet\nwpm_hide_script_blocker_warning();\n\n// if all other earlier attempts to hide did fail\n// run the function after entire DOM has been loaded\njQuery(function () {\n\twpm_hide_script_blocker_warning();\n});\n","jQuery(function () {\n\n\tlet sections = [];\n\tlet subsections = {};\n\n\t// hide unnecessary elements\n\tjQuery('.section').closest('tr').hide();\n\n\t// collect information on sections\n\tjQuery('.section').each(function () {\n\t\tsections.push({\n\t\t\t'slug' : jQuery(this).data('sectionSlug'),\n\t\t\t'title': jQuery(this).data('sectionTitle'),\n\t\t});\n\t});\n\n\t// collect information on subsections\n\tjQuery('.subsection').each(function () {\n\n\t\tsubsections[jQuery(this).data('sectionSlug')] = subsections[jQuery(this).data('sectionSlug')] || [];\n\n\t\tsubsections[jQuery(this).data('sectionSlug')].push({\n\t\t\t'title': jQuery(this).data('subsectionTitle'),\n\t\t\t'slug' : jQuery(this).data('subsectionSlug')\n\t\t});\n\t});\n\n\t// create tabs for sections\n\tsections.forEach(\n\t\tfunction (section) {\n\t\t\tjQuery(\".nav-tab-wrapper\").append(\"<a href=\\\"#\\\" class=\\\"nav-tab\\\" data-section-slug=\\\"\" + section['slug'] + \"\\\">\" + section['title'] + \"</a>\");\n\t\t});\n\n\t// create tabs for each subsections\n\tjQuery(\".nav-tab-wrapper\").after(createSubtabUlHtml(subsections));\n\n\t// create on-click events on section tabs that toggle the views\n\tjQuery(\".nav-tab-wrapper a\").on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t// show clicked tab as active\n\t\tjQuery(this).addClass(\"nav-tab-active\").siblings().removeClass(\"nav-tab-active\");\n\n\t\t// toggle the sections visible / invisible based on clicked tab\n\n\t\tlet sectionSlug = jQuery(this).data('section-slug')\n\t\ttoggleSections(sectionSlug, sections);\n\n\t\t// if subsection exists, click on first subsection\n\t\tif (sectionSlug in subsections) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionSlug + \"]\").children(':first').trigger('click')\n\t\t}\n\t});\n\n\t// create on-click events on subsection tabs that toggle the views\n\tjQuery(\".subnav-li\").on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t// jQuery(this).hide();\n\t\tjQuery(this)\n\t\t\t.addClass('subnav-li-active').removeClass('subnav-li-inactive')\n\t\t\t.siblings()\n\t\t\t.addClass('subnav-li-inactive').removeClass('subnav-li-active');\n\n\t\ttoggleSubsection(jQuery(this).parent().data('section-slug'), jQuery(this).data('subsection-slug'));\n\t});\n\n\t// if someone access a plugin tab by deep link, open the right tab\n\t// or fallback to default (first tab)\n\n\t// if deeplink is being opened open the according section and subsection\n\tif (getSectionParams()) {\n\n\t\tlet sectionParams = getSectionParams();\n\n\t\tjQuery(\"a[data-section-slug=\" + sectionParams['section'] + \"]\").trigger('click');\n\n\t\tif (sectionParams['subsection'] !== false) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionParams['section'] + \"]\").children(\"[data-subsection-slug=\" + sectionParams['subsection'] + \"]\").trigger('click')\n\t\t}\n\t} else {\n\t\tjQuery(\"a[data-section-slug=\" + sections[0]['slug'] + \"]\").trigger('click');\n\t}\n});\n\n// creates the html with all subsection elements\nfunction createSubtabUlHtml(subsections) {\n\n\tlet subsectionsKeys = Object.keys(subsections);\n\n\tlet html = '';\n\n\tsubsectionsKeys.forEach(function (subsectionKey) {\n\t\thtml += '<ul class=\"subnav-tabs\" data-section-slug=\"' + subsectionKey + '\">';\n\n\t\tlet subtabs = subsections[subsectionKey];\n\n\t\tsubtabs.forEach(function (subtab) {\n\t\t\thtml += '<li class=\"subnav-li subnav-li-inactive\" data-subsection-slug=\"' + subtab['slug'] + '\">' + subtab['title'] + '</li>'\n\t\t});\n\n\t\thtml += '</ul>';\n\t});\n\n\treturn html;\n}\n\n// if section (and subsection) URL parameters are set,\n// return them, otherwise return false\nfunction getSectionParams() {\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\n\tif (urlParams.get('section')) {\n\t\treturn {\n\t\t\t'section' : urlParams.get('section'),\n\t\t\t'subsection': urlParams.get('subsection')\n\t\t};\n\t} else {\n\t\treturn false;\n\t}\n}\n\n// toggles the sections\nfunction toggleSections(sectionSlug, sections) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide();\n\tjQuery(\".subnav-tabs\").hide();\n\tjQuery(\".subnav-tabs[data-section-slug=\" + sectionSlug + \"]\").show();\n\n\tlet sectionPos = sections.findIndex((arrayElement) => arrayElement['slug'] === sectionSlug);\n\n\tjQuery(\"div[data-section-slug=\" + sectionSlug + \"]\").closest(\"table\").prevAll(\"h2:first\").next().nextUntil(\"h2, .submit\").andSelf().show();\n\n\t// set the URL with the active tab parameter\n\tsetUrl(sections[sectionPos]['slug']);\n}\n\nfunction toggleSubsection(sectionSlug, subsectionSlug) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide();\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").siblings().andSelf().hide();\n\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"table\").show();\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").nextUntil(jQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug]\").closest('tr')).show();\n\n\t// set the URL with the active tab parameter\n\tsetUrl(sectionSlug, subsectionSlug);\n}\n\n// sets the new URL parameters\nfunction setUrl(sectionSlug, subsectionSlug = \"\") {\n\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\n\turlParams.delete('section');\n\turlParams.delete('subsection');\n\n\tlet newParams = \"section=\" + sectionSlug;\n\tnewParams += subsectionSlug ? \"&subsection=\" + subsectionSlug : \"\";\n\n\thistory.pushState('', 'wpm' + sectionSlug, document.location.pathname + \"?page=wpm&\" + newParams);\n\n\t// make WP remember which was the selected tab on a save and return to the same tab after saving\n\tjQuery('input[name =\"_wp_http_referer\"]').val(getAdminPath() + \"?page=wpm&\" + newParams + \"&settings-updated=true\");\n}\n\nfunction getAdminPath() {\n\tlet url = new URL(jQuery('#wp-admin-canonical').attr('href'));\n\treturn url.pathname;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["jQuery","process_click","e","set","preventDefault","data","post","ajaxurl","response","remove","show","document","on","window","open","focus","wpm_send_ajax_data","location","reload","this","click","select","execCommand","wpm_hide_script_blocker_warning","hide","getSectionParams","queryString","search","urlParams","URLSearchParams","get","setUrl","sectionSlug","subsectionSlug","delete","newParams","history","pushState","pathname","val","getAdminPath","URL","attr","sections","subsections","closest","each","push","forEach","section","append","after","subsectionsKeys","Object","keys","html","subsectionKey","subtab","createSubtabUlHtml","addClass","siblings","removeClass","nextUntil","andSelf","sectionPos","findIndex","arrayElement","prevAll","next","toggleSections","children","trigger","parent","sectionParams","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","call"],"sourceRoot":""}
js/public/wpm-public.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={164:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.pixel_id||null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.facebook)&&void 0!==n&&n.loaded||wpm.canIFire("ads","facebook-ads")&&wpm.loadFacebookPixel()})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToCart",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToCart",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmBeginCheckout",(function(e){try{var t,o,a;if(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.facebook)||void 0===a||!a.loaded)return;let e=wpm.getRandomEventId();fbq("track","InitiateCheckout",{},{eventID:e}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"InitiateCheckout",event_id:e,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToWishlist",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let e=wpm.getRandomEventId();fbq("track","AddToWishlist",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:e}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToWishlist",event_id:e,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;wpm.fbViewContent(t)}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;let a=wpm.getRandomEventId();fbq("track","Search",{},{eventID:a}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"Search",event_id:a,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}catch(e){console.error(e)}})),jQuery(document).on("wpmLoadAlways",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;wpm.setFbUserData()}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.facebook)||void 0===o||!o.loaded)return;fbq("track","Purchase",{content_type:"product",value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,content_ids:wpm.facebookContentIds()},{eventID:wpmDataLayer.order.id})}catch(e){console.error(e)}}))},1:()=>{!function(e,t,o){let a;e.loadFacebookPixel=function(){try{wpmDataLayer.pixels.facebook.loaded=!0,e=window,t=document,o="script",e.fbq||(a=e.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},e._fbq||(e._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(r=t.createElement(o)).async=!0,r.src="https://connect.facebook.net/en_US/fbevents.js",(n=t.getElementsByTagName(o)[0]).parentNode.insertBefore(r,n)),fbq("init",wpmDataLayer.pixels.facebook.pixel_id),fbq("track","PageView")}catch(o){console.error(o)}var e,t,o,a,r,n},e.getRandomEventId=function(){return(Math.random()+1).toString(36).substring(2)},e.getFbUserData=function(){return a||e.getFbUserDataFromBrowser()},e.setFbUserData=function(){a=e.getFbUserDataFromBrowser()},e.getFbUserDataFromBrowser=function(){return{fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc"),client_user_agent:navigator.userAgent}},e.fbViewContent=function(t){try{var o,a,r;if(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.facebook)||void 0===r||!r.loaded)return;let n=e.getRandomEventId();fbq("track","ViewContent",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:wpmDataLayer.shop.currency,value:t.price},{eventID:n}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"ViewContent",event_id:n,user_data:e.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}catch(e){console.error(e)}},e.facebookContentIds=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?e.push(String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])):e.push(String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))}return e}}(window.wpm=window.wpm||{},jQuery)},12:(e,t,o)=>{o(1),o(164)},165:()=>{jQuery(document).on("wpmViewItemList",(function(e,t){try{var o,a,r,n,i,s,d,l,c,u,p;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;if(null!==(u=wpmDataLayer)&&void 0!==u&&null!==(p=u.general)&&void 0!==p&&p.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;if(!t)return;wpm.gtagLoaded().then((function(){gtag("event","view_item_list",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmAddToCart",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","add_to_cart",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmViewItem",(function(e,t){try{var o,a,r,n,i,s,d,l,c;if(jQuery.isEmptyObject(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.ads)||void 0===n?void 0:n.conversionIds))return;if(null===(i=wpmDataLayer)||void 0===i||null===(s=i.pixels)||void 0===s||null===(d=s.google)||void 0===d||null===(l=d.ads)||void 0===l||null===(c=l.dynamic_remarketing)||void 0===c||!c.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","view_item",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:(t.quantity?t.quantity:1)*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity?t.quantity:1,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmSearch",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;let u=[];for(const[e,t]of Object.entries(wpmDataLayer.products)){var l,c;if(null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.general)&&void 0!==c&&c.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;u.push({id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical})}wpm.gtagLoaded().then((function(){gtag("event","view_search_results",{send_to:wpm.getGoogleAdsConversionIdentifiers(),items:u})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:wpm.getGoogleAdsConversionIdentifiers(),value:wpmDataLayer.order.value_filtered,items:wpm.getGoogleAdsDynamicRemarketingOrderItems()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmLogin",(function(){try{var e,t,o,a,r,n,i,s,d;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(null===(r=wpmDataLayer)||void 0===r||null===(n=r.pixels)||void 0===n||null===(i=n.google)||void 0===i||null===(s=i.ads)||void 0===s||null===(d=s.dynamic_remarketing)||void 0===d||!d.status)return;if(!wpm.googleConfigConditionsMet("ads"))return;wpm.gtagLoaded().then((function(){gtag("event","login",{send_to:wpm.getGoogleAdsConversionIdentifiers()})}))}catch(e){console.error(e)}})),jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n;if(jQuery.isEmptyObject(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.ads)||void 0===a?void 0:a.conversionIds))return;if(!wpm.googleConfigConditionsMet("ads"))return;let i={},s={};i={send_to:wpm.getGoogleAdsConversionIdentifiersWithLabel(),transaction_id:wpmDataLayer.order.number,value:wpmDataLayer.order.value_filtered,currency:wpmDataLayer.order.currency,new_customer:wpmDataLayer.order.new_customer},null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.order)&&void 0!==n&&n.aw_merchant_id&&(s={discount:wpmDataLayer.order.discount,aw_merchant_id:wpmDataLayer.order.aw_merchant_id,aw_feed_country:wpmDataLayer.order.aw_feed_country,aw_feed_language:wpmDataLayer.order.aw_feed_language,items:wpm.getGoogleAdsRegularOrderItems()}),wpm.gtagLoaded().then((function(){gtag("event","conversion",{...i,...s})}))}catch(e){console.error(e)}}))},42:()=>{!function(e,t,o){let a=[];e.getGoogleAdsConversionIdentifiersWithLabel=function(){for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))a.push(e+"/"+t);return a},e.getGoogleAdsConversionIdentifiers=function(){let e=[];for(const[t,o]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))e.push(t);return e},e.getGoogleAdsRegularOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e},e.getGoogleAdsDynamicRemarketingOrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a)):(a.id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]),e.push(a))}return e}}(window.wpm=window.wpm||{},jQuery)},190:(e,t,o)=>{o(42),o(165)},625:()=>{jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.universal)||void 0===r||!r.property_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.universal)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.universal.property_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGAUAOrderItems()})}))}catch(e){console.error(e)}}))},19:()=>{!function(e,t,o){e.getGAUAOrderItems=function(){let e=[],t=1;for(const[r,n]of Object.entries(wpmDataLayer.order.items)){var o,a;let r;r={quantity:n.quantity,price:n.price,name:n.name,currency:wpmDataLayer.order.currency,category:wpmDataLayer.products[n.id].category.join("/"),list_position:t},null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.general)&&void 0!==a&&a.variationsOutput&&0!==n.variation_id?(r.id=String(wpmDataLayer.products[n.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.variant=wpmDataLayer.products[n.variation_id].variant_name,r.brand=wpmDataLayer.products[n.variation_id].brand):(r.id=String(wpmDataLayer.products[n.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),r.brand=wpmDataLayer.products[n.id].brand),e.push(r),t++}return e}}(window.wpm=window.wpm||{},jQuery)},562:(e,t,o)=>{o(19),o(625)},572:()=>{jQuery(document).on("wpmOrderReceivedPage",(function(){try{var e,t,o,a,r,n,i,s,d,l;if(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.analytics)||void 0===a||null===(r=a.ga4)||void 0===r||!r.measurement_id)return;if(null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.mp_active)return;if(!wpm.googleConfigConditionsMet("analytics"))return;wpm.gtagLoaded().then((function(){gtag("event","purchase",{send_to:[wpmDataLayer.pixels.google.analytics.ga4.measurement_id],transaction_id:wpmDataLayer.order.number,affiliation:wpmDataLayer.order.affiliation,currency:wpmDataLayer.order.currency,value:wpmDataLayer.order.value_regular,discount:wpmDataLayer.order.discount,tax:wpmDataLayer.order.tax,shipping:wpmDataLayer.order.shipping,coupon:wpmDataLayer.order.coupon,items:wpm.getGA4OrderItems()})}))}catch(e){console.error(e)}}))},228:()=>{!function(e,t,o){e.getGA4OrderItems=function(){let e=[];for(const[a,r]of Object.entries(wpmDataLayer.order.items)){var t,o;let a;a={quantity:r.quantity,price:r.price,item_name:r.name,currency:wpmDataLayer.order.currency,item_category:wpmDataLayer.products[r.id].category.join("/")},null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput&&0!==r.variation_id?(a.item_id=String(wpmDataLayer.products[r.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_variant=wpmDataLayer.products[r.variation_id].variant_name,a.item_brand=wpmDataLayer.products[r.variation_id].brand):(a.item_id=String(wpmDataLayer.products[r.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type]),a.item_brand=wpmDataLayer.products[r.id].brand),e.push(a)}return e}}(window.wpm=window.wpm||{},jQuery)},522:(e,t,o)=>{o(228),o(572)},774:(e,t,o)=>{o(562),o(522)},294:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o;void 0===(null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o?void 0:o.state)&&(wpm.canGoogleLoad()?wpm.loadGoogle():wpm.logPreventedPixelLoading("google","analytics / ads"))}))},860:()=>{!function(e,t,o){e.googleConfigConditionsMet=function(t){var o,a,r,n;return!(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active)||("category"===e.getConsentValues().mode?!0===e.getConsentValues().categories[t]:"pixel"===e.getConsentValues().mode&&e.getConsentValues().pixels.includes("google-"+t))},e.getVisitorConsentStatusAndUpdateGoogleConsentSettings=function(t){return"category"===e.getConsentValues().mode?(e.getConsentValues().categories.analytics&&(t.analytics_storage="granted"),e.getConsentValues().categories.ads&&(t.ad_storage="granted")):"pixel"===e.getConsentValues().mode&&(t.analytics_storage=e.getConsentValues().pixels.includes("google-analytics")?"granted":"denied",t.ad_storage=e.getConsentValues().pixels.includes("google-ads")?"granted":"denied"),t},e.updateGoogleConsentMode=function(){let e=!(arguments.length>0&&arguments[0]!==o)||arguments[0],t=!(arguments.length>1&&arguments[1]!==o)||arguments[1];try{if(!window.gtag||!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent)return;gtag("consent","update",{analytics_storage:e?"granted":"denied",ad_storage:t?"granted":"denied"})}catch(e){console.error(e)}},e.fireGtagGoogleAds=function(){try{var e,t,o,a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h;if(wpmDataLayer.pixels.google.ads.state="loading",null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.ads)&&void 0!==a&&null!==(r=a.enhanced_conversions)&&void 0!==r&&r.active)for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e,{allow_enhanced_conversions:!0});else for(const[e,t]of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds))gtag("config",e);null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.ads)&&void 0!==d&&d.conversionIds&&null!==(l=wpmDataLayer)&&void 0!==l&&null!==(c=l.pixels)&&void 0!==c&&null!==(u=c.google)&&void 0!==u&&null!==(p=u.ads)&&void 0!==p&&p.phone_conversion_label&&null!==(g=wpmDataLayer)&&void 0!==g&&null!==(m=g.pixels)&&void 0!==m&&null!==(y=m.google)&&void 0!==y&&null!==(w=y.ads)&&void 0!==w&&w.phone_conversion_number&&gtag("config",Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]+"/"+wpmDataLayer.pixels.google.ads.phone_conversion_label,{phone_conversion_number:wpmDataLayer.pixels.google.ads.phone_conversion_number}),"order_received_page"===wpmDataLayer.shop.page_type&&null!==(v=wpmDataLayer)&&void 0!==v&&null!==(f=v.order)&&void 0!==f&&null!==(_=f.google)&&void 0!==_&&null!==(h=_.ads)&&void 0!==h&&h.enhanced_conversion_data&&(window.enhanced_conversion_data=wpmDataLayer.order.google.ads.enhanced_conversion_data),wpmDataLayer.pixels.google.ads.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsUA=function(){try{wpmDataLayer.pixels.google.analytics.universal.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.universal.property_id,wpmDataLayer.pixels.google.analytics.universal.parameters),wpmDataLayer.pixels.google.analytics.universal.state="ready"}catch(e){console.error(e)}},e.fireGtagGoogleAnalyticsGA4=function(){try{wpmDataLayer.pixels.google.analytics.ga4.state="loading",gtag("config",wpmDataLayer.pixels.google.analytics.ga4.measurement_id,wpmDataLayer.pixels.google.analytics.ga4.parameters),wpmDataLayer.pixels.google.analytics.ga4.state="ready"}catch(e){console.error(e)}},e.isGoogleActive=function(){var e,t,o,a,r,n,i,s,d,l,c,u,p,g;return!(!(null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id||null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id)&&jQuery.isEmptyObject(null===(c=wpmDataLayer)||void 0===c||null===(u=c.pixels)||void 0===u||null===(p=u.google)||void 0===p||null===(g=p.ads)||void 0===g?void 0:g.conversionIds))},e.getGoogleGtagId=function(){var e,t,o,a,r,n,i,s,d,l;return null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(o=t.google)&&void 0!==o&&null!==(a=o.analytics)&&void 0!==a&&null!==(r=a.universal)&&void 0!==r&&r.property_id?wpmDataLayer.pixels.google.analytics.universal.property_id:null!==(n=wpmDataLayer)&&void 0!==n&&null!==(i=n.pixels)&&void 0!==i&&null!==(s=i.google)&&void 0!==s&&null!==(d=s.analytics)&&void 0!==d&&null!==(l=d.ga4)&&void 0!==l&&l.measurement_id?wpmDataLayer.pixels.google.analytics.ga4.measurement_id:Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]},e.loadGoogle=function(){e.isGoogleActive()&&(wpmDataLayer.pixels.google.state="loading",e.loadScriptAndCacheIt("https://www.googletagmanager.com/gtag/js?id="+e.getGoogleGtagId()).done((function(t,o){try{var a,r,n,i,s,d,l,c,u,p,g,m,y,w,v,f,_,h,L,D,C,b;if(window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.google)&&void 0!==n&&null!==(i=n.consent_mode)&&void 0!==i&&i.active){var x,j,k,I;let t={ad_storage:wpmDataLayer.pixels.google.consent_mode.ad_storage,analytics_storage:wpmDataLayer.pixels.google.consent_mode.analytics_storage,wait_for_update:wpmDataLayer.pixels.google.consent_mode.wait_for_update};null!==(x=wpmDataLayer)&&void 0!==x&&null!==(j=x.pixels)&&void 0!==j&&null!==(k=j.google)&&void 0!==k&&null!==(I=k.consent_mode)&&void 0!==I&&I.region&&(t.region=wpmDataLayer.pixels.google.consent_mode.region),t=e.getVisitorConsentStatusAndUpdateGoogleConsentSettings(t),gtag("consent","default",t),gtag("set","ads_data_redaction",wpmDataLayer.pixels.google.consent_mode.ads_data_redaction),gtag("set","url_passthrough",wpmDataLayer.pixels.google.consent_mode.url_passthrough)}null!==(s=wpmDataLayer)&&void 0!==s&&null!==(d=s.pixels)&&void 0!==d&&null!==(l=d.google)&&void 0!==l&&null!==(c=l.linker)&&void 0!==c&&c.settings&&gtag("set","linker",wpmDataLayer.pixels.google.linker.settings),gtag("js",new Date),jQuery.isEmptyObject(null===(u=wpmDataLayer)||void 0===u||null===(p=u.pixels)||void 0===p||null===(g=p.google)||void 0===g||null===(m=g.ads)||void 0===m?void 0:m.conversionIds)||(e.googleConfigConditionsMet("ads")?e.fireGtagGoogleAds():e.logPreventedPixelLoading("google-ads","ads")),null!==(y=wpmDataLayer)&&void 0!==y&&null!==(w=y.pixels)&&void 0!==w&&null!==(v=w.google)&&void 0!==v&&null!==(f=v.analytics)&&void 0!==f&&null!==(_=f.universal)&&void 0!==_&&_.property_id&&(e.googleConfigConditionsMet("analytics")?e.fireGtagGoogleAnalyticsUA():e.logPreventedPixelLoading("google-universal-analytics","analytics")),null!==(h=wpmDataLayer)&&void 0!==h&&null!==(L=h.pixels)&&void 0!==L&&null!==(D=L.google)&&void 0!==D&&null!==(C=D.analytics)&&void 0!==C&&null!==(b=C.ga4)&&void 0!==b&&b.measurement_id&&(e.googleConfigConditionsMet("analytics")?e.fireGtagGoogleAnalyticsGA4():e.logPreventedPixelLoading("ga4","analytics")),wpmDataLayer.pixels.google.state="ready"}catch(e){console.error(e)}})))},e.canGoogleLoad=function(){var t,o,a,r;return!(null===(t=wpmDataLayer)||void 0===t||null===(o=t.pixels)||void 0===o||null===(a=o.google)||void 0===a||null===(r=a.consent_mode)||void 0===r||!r.active)||("category"===e.getConsentValues().mode?!(!e.getConsentValues().categories.ads&&!e.getConsentValues().categories.analytics):"pixel"===e.getConsentValues().mode?e.getConsentValues().pixels.includes("google-ads")||e.getConsentValues().pixels.includes("google-analytics"):(console.error("Couldn't find a valid load condition for Google mode in wpmConsentValues"),!1))},e.gtagLoaded=function(){return new Promise((function(e,t){var o,a,r;void 0===(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r?void 0:r.state)&&t();let n=0;!function o(){var a,r,i;return"ready"===(null===(a=wpmDataLayer)||void 0===a||null===(r=a.pixels)||void 0===r||null===(i=r.google)||void 0===i?void 0:i.state)?e():n>=5e3?t():(n+=200,void setTimeout(o,200))}()}))}}(window.wpm=window.wpm||{},jQuery)},580:(e,t,o)=>{o(860),o(294)},69:(e,t,o)=>{o(580),o(190),o(774),o(463)},945:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n,i,s;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.google)||void 0===o||null===(a=o.optimize)||void 0===a||!a.container_id||null!==(r=wpmDataLayer)&&void 0!==r&&null!==(n=r.pixels)&&void 0!==n&&null!==(i=n.google)&&void 0!==i&&null!==(s=i.optimize)&&void 0!==s&&s.loaded||wpm.canIFire("analytics","google-optimize")&&wpm.load_google_optimize_pixel()}))},962:()=>{!function(e,t,o){e.load_google_optimize_pixel=function(){try{wpmDataLayer.pixels.google.optimize.loaded=!0,e.loadScriptAndCacheIt("https://www.googleoptimize.com/optimize.js?id="+wpmDataLayer.pixels.google.optimize.container_id)}catch(e){console.error(e)}}}(window.wpm=window.wpm||{},jQuery)},463:(e,t,o)=>{o(962),o(945)},300:()=>{jQuery(document).on("wpmLoadPixels",(function(){var e,t,o,a,r,n,i,s,d;null===(e=wpmDataLayer)||void 0===e||null===(t=e.pixels)||void 0===t||null===(o=t.hotjar)||void 0===o||!o.site_id||null!==(a=wpmDataLayer)&&void 0!==a&&null!==(r=a.pixels)&&void 0!==r&&null!==(n=r.hotjar)&&void 0!==n&&n.loaded||!wpm.canIFire("analytics","hotjar")||null!==(i=wpmDataLayer)&&void 0!==i&&null!==(s=i.pixels)&&void 0!==s&&null!==(d=s.hotjar)&&void 0!==d&&d.loaded||wpm.load_hotjar_pixel()}))},376:()=>{!function(e,t,o){e.load_hotjar_pixel=function(){try{wpmDataLayer.pixels.hotjar.loaded=!0,e=window,t=document,e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6},o=t.getElementsByTagName("head")[0],(a=t.createElement("script")).async=1,a.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,o.appendChild(a)}catch(e){console.error(e)}var e,t,o,a}}(window.wpm=window.wpm||{},jQuery)},787:(e,t,o)=>{o(376),o(300)},299:()=>{jQuery(document).on("click",".remove_from_cart_button, .remove",(function(){try{let e=new URL(jQuery(this).attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e);wpm.removeProductFromCart(t)}catch(e){console.error(e)}})),jQuery(document).on("click",".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button",(function(){try{if("product"===wpmDataLayer.shop.page_type){if(void 0!==jQuery(this).attr("href")&&jQuery(this).attr("href").includes("add-to-cart")){let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}else if("simple"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).val();wpm.addProductToCart(t,e)}else if("variable"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("[name='variation_id']").val();wpm.addProductToCart(t,e)}else if("grouped"===wpmDataLayer.shop.product_type)jQuery(".woocommerce-grouped-product-list-item").each((function(){let e=Number(jQuery(this).find(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).attr("class"),o=wpm.getPostIdFromString(t);wpm.addProductToCart(o,e)}));else if("bundle"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("input[name=add-to-cart]").val();wpm.addProductToCart(t,e)}}else{let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}}catch(e){console.error(e)}})),jQuery(document).one("click","a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)",(function(e){try{if(jQuery(e.target).closest("a").attr("href")){let t=jQuery(e.target).closest("a").attr("href");if(t.includes("add-to-cart=")){let e=t.match(/(add-to-cart=)(\d+)/);e&&wpm.addProductToCart(e[2],1)}}}catch(e){console.error(e)}})),jQuery(document).on("click",".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product",(function(){try{let e=jQuery(this).nextAll(".wpmProductId:first").data("id");if(e){if(e=getIdBasedOndVariationsOutputSetting(e),!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmSelectContentGaUa",t),jQuery(document).trigger("wpmSelectItem",t)}}}catch(e){console.error(e)}})),jQuery(document).one("click",".checkout-button, .cart-checkout-button, .button.checkout",(function(){jQuery(document).trigger("wpmBeginCheckout")})),jQuery(document).on("input","#billing_email",(function(){wpm.isEmail(jQuery(this).val())&&(wpm.fireCheckoutProgress(2),wpm.emailSelected=!0)})),jQuery(document).on("click",".wc_payment_methods",(function(){!1===wpm.paymentMethodSelected&&wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val()),wpm.paymentMethodSelected=!0})),jQuery(document).one("click","#place_order",(function(){!1===wpm.emailSelected&&wpm.fireCheckoutProgress(2),!1===wpm.paymentMethodSelected&&(wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val())),wpm.fireCheckoutProgress(4)})),jQuery(document).on("click","[name='update_cart']",(function(){try{jQuery(".cart_item").each((function(){let e=new URL(jQuery(this).find(".product-remove").find("a").attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e),o=jQuery(this).find(".qty").val();0===o?wpm.removeProductFromCart(t):o<wpmDataLayer.cart[t].quantity?wpm.removeProductFromCart(t,wpmDataLayer.cart[t].quantity-o):o>wpmDataLayer.cart[t].quantity&&wpm.addProductToCart(t,o-wpmDataLayer.cart[t].quantity)}))}catch(e){console.error(e),wpm.getCartItemsFromBackend()}})),jQuery(document).on("click",".add_to_wishlist, .wl-add-to",(function(){try{let e;if(jQuery(this).data("productid")?e=jQuery(this).data("productid"):jQuery(this).data("product-id")&&(e=jQuery(this).data("product-id")),!e)throw Error("Wasn't able to retrieve a productId");let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmAddToWishlist",t)}catch(e){console.error(e)}})),jQuery(document).on("updated_cart_totals",(function(){jQuery(document).trigger("wpmViewCart")})),jQuery(".single_variation_wrap").on("show_variation",(function(e,t){try{let e=getIdBasedOndVariationsOutputSetting(t.variation_id);if(!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.error(e)}})),jQuery(".single_variation_wrap").on("hide_variation",(function(){try{var e,t;let o=jQuery("body").attr("class").match(/(postid-)(\d+)/)[2];if(!o)throw Error("Wasn't able to retrieve a productId");if("variable"===wpmDataLayer.shop.product_type&&null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.general)&&void 0!==t&&t.variationsOutput)for(const[e,t]of Object.entries(wpmDataLayer.products))if("parentId"in t){o=t.id;break}if(wpmDataLayer.products&&wpmDataLayer.products[o]){let e=wpm.getProductDetailsFormattedForEvent(o);jQuery(document).trigger("wpmViewItem",e)}}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){try{wpm.doesWooCommerceCartExist()&&wpm.getCartItems()}catch(e){console.error(e)}})),jQuery(window).on("wpmLoad",(function(){wpmDataLayer.products=wpmDataLayer.products||{};let e=wpm.getAddToCartLinkProductIds();wpm.getProductsFromBackend(e)})),jQuery(window).on("wpmLoad",(function(){if(!wpm.getCookie("wpmReferrer"))if(document.referrer){let e=new URL(document.referrer).hostname;e!==window.location.host?wpm.setCookie("wpmReferrer",e):wpm.setCookie("wpmReferrer","")}else wpm.setCookie("wpmReferrer","")})),jQuery(window).on("wpmLoad",(function(){try{var e;if("undefined"!=typeof wpmDataLayer&&(null===(e=wpmDataLayer)||void 0===e||!e.wpmLoadFired)){var t,o;if(jQuery(document).trigger("wpmLoadAlways"),"product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());jQuery(document).trigger("wpmViewItem",e)}else"product_category"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmCategory"):"search"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmSearch"):"cart"===wpmDataLayer.shop.page_type?jQuery(document).trigger("wpmViewCart"):"order_received_page"===wpmDataLayer.shop.page_type&&wpmDataLayer.order?wpm.isOrderIdStored(wpmDataLayer.order.id)||(jQuery(document).trigger("wpmOrderReceivedPage"),wpm.writeOrderIdToStorage(wpmDataLayer.order.id)):jQuery(document).trigger("wpmEverywhereElse");null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.user)&&void 0!==o&&o.id&&!wpm.hasLoginEventFired()&&(jQuery(document).trigger("wpmLogin"),wpm.setLoginEventFired()),wpmDataLayer.wpmLoadFired=!0}}catch(e){console.error(e)}})),jQuery(window).on("wpmPreLoadPixels",(function(){var e,t,o;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.shop)&&void 0!==t&&null!==(o=t.cookie_consent_mgmt)&&void 0!==o&&o.explicit_consent&&wpm.updateConsentCookieValues(!0),jQuery(document).trigger("wpmLoadPixels",{})}))},584:()=>{!function(e,t,o){const a="_wpm_order_ids",r="_wpm_endpoint_available",n="/wp-json/";function i(){return""!==e.getCookie(a)}e.emailSelected=!1,e.paymentMethodSelected=!1,e.useRestEndpoint=function(){return e.isSessionStorageAvailable()&&e.isRestEndpointAvailable()&&e.isBelowRestErrorThreshold()},e.isBelowRestErrorThreshold=function(){return window.sessionStorage.getItem(0)<=10},e.isRestEndpointAvailable=function(){if(window.sessionStorage.getItem(r))return JSON.parse(window.sessionStorage.getItem(r));e.testEndpoint()},e.isSessionStorageAvailable=function(){return!!window.sessionStorage},e.testEndpoint=function(){let e=arguments.length>0&&arguments[0]!==o?arguments[0]:location.protocol+"//"+location.host+n,t=arguments.length>1&&arguments[1]!==o?arguments[1]:r;jQuery.ajax(e,{type:"HEAD",timeout:1e3,statusCode:{200:function(e){window.sessionStorage.setItem(t,JSON.stringify(!0))},404:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))},0:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))}}}).then((e=>{}))},e.isWpmRestEndpointAvailable=function(){let t=arguments.length>0&&arguments[0]!==o?arguments[0]:r;return!!e.getCookie(t)},e.writeOrderIdToStorage=function(t){if(window.Storage)if(null===localStorage.getItem(a)){let e=[];e.push(t),window.localStorage.setItem(a,JSON.stringify(e))}else{let e=JSON.parse(localStorage.getItem(a));e.includes(t)||(e.push(t),window.localStorage.setItem(a,JSON.stringify(e)))}else{let o=new Date;o.setDate(o.getDate()+365);let r=[];i()&&(r=JSON.parse(e.getCookie(a))),r.includes(t)||(r.push(t),document.cookie="_wpm_order_ids="+JSON.stringify(r)+";expires="+o.toUTCString())}"function"==typeof e.storeOrderIdOnServer&&wpmDataLayer.orderDeduplication&&e.storeOrderIdOnServer(t)},e.isOrderIdStored=function(t){return wpmDataLayer.orderDeduplication?window.Storage?null!==localStorage.getItem(a)&&JSON.parse(localStorage.getItem(a)).includes(t):!!i()&&JSON.parse(e.getCookie(a)).includes(t):(console.log("order duplication prevention: off"),!1)},e.isEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.removeProductFromCart=function(t){let a=arguments.length>1&&arguments[1]!==o?arguments[1]:null;try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");let o;if(o=null==a?wpmDataLayer.cart[t].quantity:a,wpmDataLayer.cart[t]){let r=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmRemoveFromCart",r),null==a||wpmDataLayer.cart[t].quantity===a?(delete wpmDataLayer.cart[t],sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity-o,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(e){console.error(e)}},getIdBasedOndVariationsOutputSetting=function(e){try{var t,o;return null!==(t=wpmDataLayer)&&void 0!==t&&null!==(o=t.general)&&void 0!==o&&o.variationsOutput?e:wpmDataLayer.products[e].isVariation?wpmDataLayer.products[e].parentId:e}catch(e){console.error(e)}},e.addProductToCart=function(t,o){try{var a;if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");if(null!==(a=wpmDataLayer)&&void 0!==a&&a.products[t]){var r;let a=e.getProductDetailsFormattedForEvent(t,o);jQuery(document).trigger("wpmAddToCart",a),null!==(r=wpmDataLayer)&&void 0!==r&&r.cart[t]?wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity+o:("cart"in wpmDataLayer||(wpmDataLayer.cart={}),wpmDataLayer.cart[t]=e.getProductDetailsFormattedForEvent(t,o)),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))}}catch(t){console.error(t),e.getCartItemsFromBackend()}},e.getCartItems=function(){sessionStorage?sessionStorage.getItem("wpmDataLayerCart")&&"order_received_page"!==wpmDataLayer.shop.page_type?e.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart"))):sessionStorage.setItem("wpmDataLayerCart",JSON.stringify({})):e.getCartItemsFromBackend()},e.getCartItemsFromBackend=function(){try{let t={action:"wpm_get_cart_items"};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:t,success:function(t){t.cart||(t.cart={}),e.saveCartObjectToDataLayer(t.cart),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(t.cart))}})}catch(e){console.error(e)}},e.getProductsFromBackend=function(t){if((t=t.filter((e=>!wpmDataLayer.products.hasOwnProperty(e))))&&0!==t.length)try{let o={action:"wpm_get_product_ids",productIds:t};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:o,success:function(e){wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.saveCartObjectToDataLayer=function(e){wpmDataLayer.cart=e,wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},e.fireCheckoutOption=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:null,a=arguments.length>2&&arguments[2]!==o?arguments[2]:null,r={step:e,checkout_option:t,value:a};jQuery(document).trigger("wpmFireCheckoutOption",r)},e.fireCheckoutProgress=function(e){let t={step:e};jQuery(document).trigger("wpmFireCheckoutProgress",t)},e.getPostIdFromString=function(e){try{return e.match(/(post-)(\d+)/)[2]}catch(e){console.error(e)}},e.triggerViewItemList=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");jQuery(document).trigger("wpmViewItemList",e.getProductDataForViewItemEvent(t))},e.getProductDataForViewItemEvent=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");try{if(wpmDataLayer.products[t])return e.getProductDetailsFormattedForEvent(t)}catch(e){console.error(e)}},e.getMainProductIdFromProductPage=function(){try{return["simple","variable","grouped","composite","bundle"].indexOf(wpmDataLayer.shop.product_type)>=0&&jQuery(".wpmProductId:first").data("id")}catch(e){console.error(e)}},e.viewItemListTriggerTestMode=function(e){jQuery(e).css({position:"relative"}),jQuery(e).append('<div id="viewItemListTriggerOverlay"></div>'),jQuery(e).find("#viewItemListTriggerOverlay").css({"z-index":"10",display:"block",position:"absolute",height:"100%",top:"0",left:"0",right:"0",opacity:wpmDataLayer.viewItemListTrigger.opacity,"background-color":wpmDataLayer.viewItemListTrigger.backgroundColor})},e.getSearchTermFromUrl=function(){try{return new URLSearchParams(window.location.search).get("s")}catch(e){console.error(e)}};let s,d={};e.observerCallback=function(t,o){t.forEach((t=>{try{let a,r=jQuery(t.target).data("ioid");if(a=jQuery(t.target).next(".wpmProductId").length?jQuery(t.target).next(".wpmProductId").data("id"):jQuery(t.target).find(".wpmProductId").data("id"),!a)throw Error("wpmProductId element not found");t.isIntersecting?d[r]=setTimeout((()=>{e.triggerViewItemList(a),wpmDataLayer.viewItemListTrigger.testMode&&e.viewItemListTriggerTestMode(t.target),!1===wpmDataLayer.viewItemListTrigger.repeat&&o.unobserve(t.target)}),wpmDataLayer.viewItemListTrigger.timeout):(clearTimeout(d[r]),wpmDataLayer.viewItemListTrigger.testMode&&jQuery(t.target).find("#viewItemListTriggerOverlay").remove())}catch(e){console.error(e)}}))};let l,c=0;e.startIntersectionObserverToWatch=function(){try{e.urlHasParameter("vildemomode")&&(wpmDataLayer.viewItemListTrigger.testMode=!0),s=new IntersectionObserver(e.observerCallback,{threshold:wpmDataLayer.viewItemListTrigger.threshold}),l=jQuery(".wpmProductId").map((function(e,t){return jQuery(t).parent().hasClass("type-product")||jQuery(t).parent().hasClass("product")||jQuery(t).parent().hasClass("product-item-inner")?jQuery(t).parent():jQuery(t).prev().hasClass("wc-block-grid__product")||jQuery(t).prev().hasClass("product")||jQuery(t).prev().hasClass("product-small")||jQuery(t).prev().hasClass("woocommerce-LoopProduct-link")?jQuery(this).prev():jQuery(t).closest(".product").length?jQuery(t).closest(".product"):void 0})),l.each((function(e,t){jQuery(t[0]).data("ioid",c++),s.observe(t[0])}))}catch(e){console.error(e)}},e.startProductsMutationObserverToWatch=function(){try{let e=jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first();e.length&&u.observe(e[0],{attributes:!0,childList:!0,characterData:!0})}catch(e){console.error(e)}};let u=new MutationObserver((function(e){e.forEach((function(e){let t=e.addedNodes;null!==t&&jQuery(t).each((function(){(jQuery(this).hasClass("type-product")||jQuery(this).hasClass("product-small")||jQuery(this).hasClass("wc-block-grid__product"))&&p(this)&&(jQuery(this).data("ioid",c++),s.observe(this))}))}))})),p=function(e){return!(!jQuery(e).find(".wpmProductId").length&&!jQuery(e).siblings(".wpmProductId").length)};e.setCookie=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:"",a=arguments.length>2&&arguments[2]!==o?arguments[2]:null;if(a){let o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3);let r="expires="+o.toUTCString();document.cookie=e+"="+t+";"+r+";path=/"}else document.cookie=e+"="+t+";path=/"},e.getCookie=function(e){let t=e+"=",o=decodeURIComponent(document.cookie).split(";");for(let e=0;e<o.length;e++){let a=o[e];for(;" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""},e.getWpmSessionData=function(){if(window.sessionStorage){let e=window.sessionStorage.getItem("_wpm");return null!==e?JSON.parse(e):{}}return{}},e.setWpmSessionData=function(e){window.sessionStorage&&window.sessionStorage.setItem("_wpm",JSON.stringify(e))},e.storeOrderIdOnServer=function(t){try{let o={action:"wpm_purchase_pixels_fired",order_id:t,nonce:e.nonce};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:o,success:function(e){!1===e.success&&console.log(e)},error:function(e){console.log(e)}})}catch(e){console.error(e)}},e.getProductIdByCartItemKeyUrl=function(e){let t,o=new URLSearchParams(e.search).get("remove_item");return t=0===wpmDataLayer.cartItemKeys[o].variation_id?wpmDataLayer.cartItemKeys[o].product_id:wpmDataLayer.cartItemKeys[o].variation_id,t},e.getAddToCartLinkProductIds=function(){return jQuery("a").map((function(){let e=jQuery(this).attr("href");if(e&&e.includes("?add-to-cart=")){let t=e.match(/(add-to-cart=)(\d+)/);if(t)return t[2]}})).get()},e.getProductDetailsFormattedForEvent=function(e){let t=arguments.length>1&&arguments[1]!==o?arguments[1]:1,a={id:e.toString(),dyn_r_ids:wpmDataLayer.products[e].dyn_r_ids,name:wpmDataLayer.products[e].name,list_name:wpmDataLayer.shop.list_name,brand:wpmDataLayer.products[e].brand,category:wpmDataLayer.products[e].category,variant:wpmDataLayer.products[e].variant,list_position:wpmDataLayer.products[e].position,quantity:t,price:wpmDataLayer.products[e].price,currency:wpmDataLayer.shop.currency,isVariable:wpmDataLayer.products[e].isVariable,isVariation:wpmDataLayer.products[e].isVariation,parentId:wpmDataLayer.products[e].parentId};return a.isVariation&&(a.parentId_dyn_r_ids=wpmDataLayer.products[e].parentId_dyn_r_ids),a},e.setReferrerToCookie=function(){e.getCookie("wpmReferrer")||e.setCookie("wpmReferrer",document.referrer)},e.getReferrerFromCookie=function(){return e.getCookie("wpmReferrer")?e.getCookie("wpmReferrer"):null},e.getClidFromBrowser=function(){let t,a=arguments.length>0&&arguments[0]!==o?arguments[0]:"gclid";return t={gclid:"_gcl_aw",dclid:"_gcl_dc"},e.getCookie(t[a])?e.getCookie(t[a]).match(/(GCL.[\d]*.)(.*)/)[2]:""},e.getUserAgent=function(){return navigator.userAgent},e.getViewPort=function(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}};let g=function(){let t=e.getCookie("cmplz_statistics"),o=e.getCookie("cmplz_marketing");return!(!e.getCookie("cmplz_consent_status")&&!e.getCookie("cmplz_banner-status"))&&{analytics:"allow"===t,ads:"allow"===o,visitorHasChosen:!0}},m=function(){let t=e.getCookie("cookielawinfo-checkbox-analytics")||e.getCookie("cookielawinfo-checkbox-analytiques"),o=e.getCookie("cookielawinfo-checkbox-advertisement")||e.getCookie("cookielawinfo-checkbox-publicite"),a=e.getCookie("CookieLawInfoConsent");return!(!t&&!o)&&{analytics:"yes"===t,ads:"yes"===o,visitorHasChosen:!!a}},y={categories:{},pixels:[],mode:"category",visitorHasChosen:!1};e.getConsentValues=function(){return y},e.setConsentValueCategories=function(){let e=arguments.length>0&&arguments[0]!==o&&arguments[0],t=arguments.length>1&&arguments[1]!==o&&arguments[1];y.categories.analytics=e,y.categories.ads=t},e.updateConsentCookieValues=function(){let t,a=arguments.length>0&&arguments[0]!==o&&arguments[0];if(t=e.getCookie("CookieConsent"))t=decodeURI(t),y.categories.analytics=t.indexOf("statistics:true")>=0,y.categories.ads=t.indexOf("marketing:true")>=0,y.visitorHasChosen=!0;else if(t=e.getCookie("CookieScriptConsent"))t=JSON.parse(t),"reject"===t.action?(y.categories.analytics=!1,y.categories.ads=!1):2===t.categories.length?(y.categories.analytics=!0,y.categories.ads=!0):(y.categories.analytics=t.categories.indexOf("performance")>=0,y.categories.ads=t.categories.indexOf("targeting")>=0),y.visitorHasChosen=!0;else if(t=e.getCookie("borlabs-cookie")){var r,n,i,s,d,l,c,u;t=decodeURI(t),t=JSON.parse(t),y.categories.analytics=!(null===(r=t)||void 0===r||null===(n=r.consents)||void 0===n||!n.statistics),y.categories.ads=!(null===(i=t)||void 0===i||null===(s=i.consents)||void 0===s||!s.marketing),y.visitorHasChosen=!0,y.pixels=[...(null===(d=t)||void 0===d||null===(l=d.consents)||void 0===l?void 0:l.statistics)||[],...(null===(c=t)||void 0===c||null===(u=c.consents)||void 0===u?void 0:u.marketing)||[]],y.mode="pixel"}else(t=g())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=t.visitorHasChosen):(t=e.getCookie("cookie_notice_accepted"))?(y.categories.analytics=!0,y.categories.ads=!0,y.visitorHasChosen=!0):(t=e.getCookie("hu-consent"))?(t=JSON.parse(t),y.categories.analytics=!!t.categories[3],y.categories.ads=!!t.categories[4],y.visitorHasChosen=!0):(t=m())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=!0===t.visitorHasChosen):(t=e.getCookie("moove_gdpr_popup"))?(t=JSON.parse(t),y.categories.analytics="1"===t.thirdparty,y.categories.ads="1"===t.advanced,y.visitorHasChosen=!0):(y.categories.analytics=!a,y.categories.ads=!a)},e.updateConsentCookieValues(),e.setConsentDefaultValuesToExplicit=function(){y.categories={analytics:!1,ads:!1}},e.canIFire=function(t,o){let a;return"category"===y.mode?a=!!y.categories[t]:"pixel"===y.mode?a=y.pixels.includes(o):(console.error("Couldn't find a valid consent mode in wpmConsentValues"),a=!1),!!a||(e.logPreventedPixelLoading(o,t),!1)},e.logPreventedPixelLoading=function(e,t){var o,a,r;null!==(o=wpmDataLayer)&&void 0!==o&&null!==(a=o.shop)&&void 0!==a&&null!==(r=a.cookie_consent_mgmt)&&void 0!==r&&r.explicit_consent?console.log('WooCommerce Pixel Manager: The "'+e+" (category: "+t+')" pixel has not fired because you have not given consent for it yet. (WPM is in explicit consent mode.)'):console.log('WooCommerce Pixel Manager: The "'+e+" (category: "+t+')" pixel has not fired because you have removed consent for this pixel. (WPM is in implicit consent mode.)')},e.scriptTagObserver=new MutationObserver((o=>{o.forEach((o=>{let{addedNodes:a}=o;[...a].forEach((o=>{t(o).data("wpm-cookie-category")&&(e.shouldScriptBeActive(o)?e.unblockScript(o):e.blockScript(o))}))}))})),e.scriptTagObserver.observe(document.head,{childList:!0,subtree:!0}),window.addEventListener("DOMContentLoaded",(()=>e.scriptTagObserver.disconnect())),e.shouldScriptBeActive=function(e){var o,a,r,n;return!((wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent||y.visitorHasChosen)&&("category"!==y.mode||!t(e).data("wpm-cookie-category").split(",").some((e=>y.categories[e])))&&("pixel"!==y.mode||!y.pixels.includes(t(e).data("wpm-pixel-name")))&&("pixel"!==y.mode||"google"!==t(e).data("wpm-pixel-name")||!["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&(null===(o=wpmDataLayer)||void 0===o||null===(a=o.pixels)||void 0===a||null===(r=a.google)||void 0===r||null===(n=r.consent_mode)||void 0===n||!n.active||"google"!==t(e).data("wpm-pixel-name")))},e.unblockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove();let r=t(e).data("wpm-src");r&&t(e).attr("src",r),e.type="text/javascript",a&&t(e).appendTo("head"),jQuery(document).trigger("wpmPreLoadPixels",{})},e.blockScript=function(e){let a=arguments.length>1&&arguments[1]!==o&&arguments[1];a&&t(e).remove(),t(e).attr("src")&&t(e).removeAttr("src"),e.type="blocked/javascript",a&&t(e).appendTo("head")},e.unblockAllScripts=function(){let a=!(arguments.length>0&&arguments[0]!==o)||arguments[0],r=!(arguments.length>1&&arguments[1]!==o)||arguments[1];t.each(t('script[type="blocked/javascript"]'),(function(o,n){(t(n).data("wpm-cookie-category").includes("analytics")&&a||t(n).data("wpm-cookie-category").includes("ads")&&r)&&e.unblockScript(n,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},e.unblockSelectedPixels=function(){t.each(t('script[type="blocked/javascript"]'),(function(o,a){(y.pixels.includes(t(a).data("wpm-pixel-name"))||"google"===t(a).data("wpm-pixel-name")&&["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&e.unblockScript(a,!0)})),jQuery(document).trigger("wpmPreLoadPixels",{})},window.addEventListener("borlabs-cookie-consent-saved",(function(){e.updateConsentCookieValues(),"pixel"===y.mode?(e.unblockSelectedPixels(),e.updateGoogleConsentMode(y.pixels.includes("google-analytics"),y.pixels.includes("google-ads"))):(e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads))})),window.addEventListener("CookiebotOnAccept",(function(){Cookiebot.consent.statistics&&(y.categories.analytics=!0),Cookiebot.consent.marketing&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}),!1),window.addEventListener("CookieScriptAccept",(function(t){t.detail.categories.includes("performance")&&(y.categories.analytics=!0),t.detail.categories.includes("targeting")&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),window.addEventListener("CookieScriptAcceptAll",(function(){e.unblockAllScripts(!0,!0),e.updateGoogleConsentMode(!0,!0)})),document.addEventListener("cmplzStatusChange",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),document.addEventListener("setCookieNotice",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),e.huObserver=new MutationObserver((function(t){t.forEach((t=>{let{addedNodes:o}=t;[...o].forEach((t=>{"hu"===t.id&&jQuery(".hu-cookies-save").on("click",(function(){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}))}))}))})),window.hu&&e.huObserver.observe(document.documentElement||document.body,{childList:!0,subtree:!0}),e.version=function(){console.log(wpmDataLayer.version)},e.loadScriptAndCacheIt=function(e,t){return t=jQuery.extend(t||{},{dataType:"script",cache:!0,url:e}),jQuery.ajax(t)},e.getOrderItemPrice=function(e){return(e.total+e.total_tax)/e.quantity},e.hasLoginEventFired=function(){let t=e.getWpmSessionData();return null==t?void 0:t.loginEventFired},e.setLoginEventFired=function(){let t=e.getWpmSessionData();t.loginEventFired=!0,e.setWpmSessionData(t)},e.wpmDataLayerExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof wpmDataLayer)return e();setTimeout(t,50)}()}))},e.jQueryExists=function(){return new Promise((function(e){!function t(){if("undefined"!=typeof jQuery)return e();setTimeout(t,100)}()}))},e.pageLoaded=function(){return new Promise((function(e){!function t(){if("complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.pageReady=function(){return new Promise((function(e){!function t(){if("interactive"===document.readyState||"complete"===document.readyState)return e();setTimeout(t,50)}()}))},e.isMiniCartActive=function(){if(window.sessionStorage){for(const[e,t]of Object.entries(window.sessionStorage))if(e.includes("wc_fragments"))return!0;return!1}return!1},e.doesWooCommerceCartExist=function(){return document.cookie.includes("woocommerce_items_in_cart")},e.urlHasParameter=function(e){return new URLSearchParams(window.location.search).has(e)},window.wpmLoaded={}}(window.wpm=window.wpm||{},jQuery)},534:(e,t,o)=>{o(584)},207:()=>{wpm.wpmDataLayerExists().then((function(){console.log("WooCommerce Pixel Manager: "+(wpmDataLayer.version.pro?"Pro":"Free")+" Version "+wpmDataLayer.version.number+" loaded"),jQuery(document).trigger("wpmPreLoadPixels",{})})).then((function(){wpm.pageLoaded().then((function(){jQuery(document).trigger("wpmLoad",{})}))})),wpm.pageReady().then((function(){wpm.wpmDataLayerExists().then((function(){wpm.startIntersectionObserverToWatch(),wpm.startProductsMutationObserverToWatch()}))}))}},t={};function o(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,o),n.exports}o(534),wpm.jQueryExists().then((function(){o(299),o(69),o(12),o(787),o(207)}))})();
2
  //# sourceMappingURL=wpm-public.p1.min.js.map
1
+ (()=>{var e={398:()=>{!function(e,t,a){let r;e.getRandomEventId=function(){return(Math.random()+1).toString(36).substring(2)},e.getFbUserData=function(){return r||e.getFbUserDataFromBrowser()},e.setFbUserData=function(){r=e.getFbUserDataFromBrowser()},e.getFbUserDataFromBrowser=function(){return{fbp:e.getCookie("_fbp"),fbc:e.getCookie("_fbc"),client_user_agent:navigator.userAgent}},e.fbViewContent=function(t){if(!window.fbq)return;let a=e.getRandomEventId();fbq("track","ViewContent",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],currency:wpmDataLayer.shop.currency,value:t.price},{eventID:a}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"ViewContent",event_id:a,user_data:e.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})}}(window.wpm=window.wpm||{},jQuery),jQuery((function(){var e,t;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&t.facebook&&(jQuery(document).on("wpmAddToCart",(function(e,t){if(!window.fbq)return;let a=wpm.getRandomEventId();fbq("track","AddToCart",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:a}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToCart",event_id:a,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})})),jQuery(document).on("wpmBeginCheckout",(function(e){if(!window.fbq)return;let t=wpm.getRandomEventId();fbq("track","InitiateCheckout",{},{eventID:t}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"InitiateCheckout",event_id:t,user_data:wpm.getFbUserData(),event_source_url:window.location.href})})),jQuery(document).on("wpmAddToWishlist",(function(e,t){if(!window.fbq)return;let a=wpm.getRandomEventId();fbq("track","AddToWishlist",{content_type:"product",content_name:t.name,content_ids:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],value:parseFloat(t.quantity*t.price),currency:t.currency},{eventID:a}),t.currency=wpmDataLayer.shop.currency,jQuery(document).trigger("wpmFbCapiEvent",{event_name:"AddToWishlist",event_id:a,user_data:wpm.getFbUserData(),product_data:t,product_id:t.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],event_source_url:window.location.href})})),jQuery(document).on("wpmViewItem",(function(e,t){window.fbq&&wpm.fbViewContent(t)})))})),jQuery(window).on("load",(function(){var e,t;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&t.facebook&&(wpm.setFbUserData(),wpmExists().then((function(){try{if("product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());wpm.fbViewContent(e)}else if("search"===wpmDataLayer.shop.page_type){if(!window.fbq)return;let e=wpm.getRandomEventId();fbq("track","Search",{},{eventID:e}),jQuery(document).trigger("wpmFbCapiEvent",{event_name:"Search",event_id:e,user_data:wpm.getFbUserData(),event_source_url:window.location.href})}}catch(e){console.log(e)}})))}))},832:()=>{jQuery((function(){var e,t,a,r,o;null!==(e=wpmDataLayer)&&void 0!==e&&null!==(t=e.pixels)&&void 0!==t&&null!==(a=t.google)&&void 0!==a&&null!==(r=a.ads)&&void 0!==r&&null!==(o=r.dynamic_remarketing)&&void 0!==o&&o.status&&(jQuery(document).on("wpmViewItemList",(function(e,t){wpmDataLayer.general.variationsOutput&&t.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids||t&&googleConfigConditionsMet("ads")&&gtag("event","view_item_list",{send_to:wpmDataLayer.pixels.google.ads.conversionIds,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})})),jQuery(document).on("wpmAddToCart",(function(e,t){gtag("event","add_to_cart",{send_to:wpmDataLayer.pixels.google.ads.conversionIds,value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:t.quantity,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})})),jQuery(document).on("wpmViewItem",(function(e,t){gtag("event","view_item",{send_to:wpmDataLayer.pixels.google.ads.conversionIds,value:t.quantity*t.price,items:[{id:t.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],quantity:1,price:t.price,google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})})))})),jQuery(window).on("load",(function(){wpmExists().then((function(){try{if("product"===wpmDataLayer.shop.page_type&&"variable"!==wpmDataLayer.shop.product_type&&wpm.getMainProductIdFromProductPage()){let e=wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());gtag("event","view_item",{send_to:wpmDataLayer.pixels.google.ads.conversionIds,value:1*e.price,items:[{id:e.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical}]})}else if("search"===wpmDataLayer.shop.page_type){let e=[];for(const[t,a]of Object.entries(wpmDataLayer.products)){if(wpmDataLayer.general.variationsOutput&&a.isVariable&&!1===wpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids)return;e.push({id:a.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],google_business_vertical:wpmDataLayer.pixels.google.ads.google_business_vertical})}gtag("event","view_search_results",{send_to:wpmDataLayer.pixels.google.ads.conversionIds,items:e})}}catch(e){console.log(e)}}))}))},712:()=>{!function(e,t,a){const r="_wpm_order_ids",o="_wpm_endpoint_available",i="/wp-json/";function n(){return""!==e.getCookie(r)}e.useRestEndpoint=function(){return e.isSessionStorageAvailable()&&e.isRestEndpointAvailable()&&e.isBelowRestErrorThreshold()},e.isBelowRestErrorThreshold=function(){return window.sessionStorage.getItem(0)<=10},e.isRestEndpointAvailable=function(){if(window.sessionStorage.getItem(o))return JSON.parse(window.sessionStorage.getItem(o));e.testEndpoint()},e.isSessionStorageAvailable=function(){return!!window.sessionStorage},e.testEndpoint=function(){let e=arguments.length>0&&arguments[0]!==a?arguments[0]:location.protocol+"//"+location.host+i,t=arguments.length>1&&arguments[1]!==a?arguments[1]:o;jQuery.ajax(e,{type:"HEAD",timeout:1e3,statusCode:{200:function(e){window.sessionStorage.setItem(t,JSON.stringify(!0))},404:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))},0:function(e){window.sessionStorage.setItem(t,JSON.stringify(!1))}}}).then((e=>{}))},e.isWpmRestEndpointAvailable=function(){let t=arguments.length>0&&arguments[0]!==a?arguments[0]:o;return!!e.getCookie(t)},e.writeOrderIdToStorage=function(t){if(window.Storage)if(null===localStorage.getItem(r)){let e=[];e.push(t),window.localStorage.setItem(r,JSON.stringify(e))}else{let e=JSON.parse(localStorage.getItem(r));e.includes(t)||(e.push(t),window.localStorage.setItem(r,JSON.stringify(e)))}else{let a=new Date;a.setDate(a.getDate()+365);let o=[];n()&&(o=JSON.parse(e.getCookie(r))),o.includes(t)||(o.push(t),document.cookie="_wpm_order_ids="+JSON.stringify(o)+";expires="+a.toUTCString())}"function"==typeof e.storeOrderIdOnServer&&wpmDataLayer.orderDeduplication&&e.storeOrderIdOnServer(t)},e.isOrderIdStored=function(t){return wpmDataLayer.orderDeduplication?window.Storage?null!==localStorage.getItem(r)&&JSON.parse(localStorage.getItem(r)).includes(t):!!n()&&JSON.parse(e.getCookie(r)).includes(t):(console.log("order deduplication: off"),!1)},e.isEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},e.removeProductFromCart=function(t){let r=arguments.length>1&&arguments[1]!==a?arguments[1]:null;try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");let a;if(a=null==r?wpmDataLayer.cart[t].quantity:r,wpmDataLayer.cart[t]){let o=e.getProductDetailsFormattedForEvent(t,a);jQuery(document).trigger("wpmRemoveFromCart",o),null==r||wpmDataLayer.cart[t].quantity===r?(delete wpmDataLayer.cart[t],sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity-a,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(e){console.log(e)}},getIdBasedOndVariationsOutputSetting=function(e){try{return wpmDataLayer.general.variationsOutput?e:wpmDataLayer.products[e].isVariation?wpmDataLayer.products[e].parentId:e}catch(e){console.log(e)}},e.addProductToCart=function(t,r){try{if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products[t]){let o=e.getProductDetailsFormattedForEvent(t,r);jQuery(document).trigger("wpmAddToCart",o),wpmDataLayer.cart!==a&&wpmDataLayer.cart[t]!==a?(wpmDataLayer.cart[t].quantity=wpmDataLayer.cart[t].quantity+r,sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):wpmDataLayer.cart?(wpmDataLayer.cart[t]=e.getProductDetailsFormattedForEvent(t,r),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart))):(wpmDataLayer.cart={[t]:e.getProductDetailsFormattedForEvent(t,r)},sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(wpmDataLayer.cart)))}}catch(t){console.log(t),e.getCartItemsFromBackend()}},e.getCartItems=function(){sessionStorage?sessionStorage.getItem("wpmDataLayerCart")&&"order_received_page"!==wpmDataLayer.shop.page_type?e.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem("wpmDataLayerCart"))):sessionStorage.setItem("wpmDataLayerCart",JSON.stringify({})):e.getCartItemsFromBackend()},e.getCartItemsFromBackend=function(){try{let t={action:"wpm_get_cart_items"};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:t,success:function(t){t.cart||(t.cart={}),e.saveCartObjectToDataLayer(t.cart),sessionStorage&&sessionStorage.setItem("wpmDataLayerCart",JSON.stringify(t.cart))}})}catch(e){console.log(e)}},e.getProductsFromBackend=function(t){if((t=t.filter((e=>!wpmDataLayer.products.hasOwnProperty(e))))&&0!==t.length)try{let a={action:"wpm_get_product_ids",productIds:t};jQuery.ajax({type:"get",dataType:"json",url:e.ajax_url,data:a,success:function(e){wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},error:function(e){console.log(e)}})}catch(e){console.log(e)}},e.saveCartObjectToDataLayer=function(e){wpmDataLayer.cart=e,wpmDataLayer.products=Object.assign({},wpmDataLayer.products,e)},e.fireCheckoutOption=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:null,r=arguments.length>2&&arguments[2]!==a?arguments[2]:null,o={step:e,checkout_option:t,value:r};jQuery(document).trigger("wpmFireCheckoutOption",o)},e.fireCheckoutProgress=function(e){let t={step:e};jQuery(document).trigger("wpmFireCheckoutProgress",t)},e.getPostIdFromString=function(e){try{return e.match(/(post-)(\d+)/)[2]}catch(e){console.log(e)}},e.triggerViewItemList=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");if(!(t=getIdBasedOndVariationsOutputSetting(t)))throw Error("Wasn't able to retrieve a productId");jQuery(document).trigger("wpmViewItemList",e.getProductDataForViewItemEvent(t))},e.getProductDataForViewItemEvent=function(t){if(!t)throw Error("Wasn't able to retrieve a productId");try{if(wpmDataLayer.products[t])return e.getProductDetailsFormattedForEvent(t)}catch(e){console.log(e)}},e.getMainProductIdFromProductPage=function(){try{return["simple","variable","grouped","composite","bundle"].indexOf(wpmDataLayer.shop.product_type)>=0&&jQuery(".wpmProductId:first").data("id")}catch(e){console.log(e)}},e.viewItemListTriggerTestMode=function(e){jQuery(e).css({position:"relative"}),jQuery(e).append('<div id="viewItemListTriggerOverlay"></div>'),jQuery(e).find("#viewItemListTriggerOverlay").css({"z-index":"10",display:"block",position:"absolute",height:"100%",top:"0",left:"0",right:"0",opacity:wpmDataLayer.viewItemListTrigger.opacity,"background-color":wpmDataLayer.viewItemListTrigger.backgroundColor})},e.getSearchTermFromUrl=function(){try{return new URLSearchParams(window.location.search).get("s")}catch(e){console.log(e)}};let s,c={};e.observerCallback=function(t,a){t.forEach((t=>{try{let r,o=jQuery(t.target).data("ioid");if(r=jQuery(t.target).next(".wpmProductId").length?jQuery(t.target).next(".wpmProductId").data("id"):jQuery(t.target).find(".wpmProductId").data("id"),!r)throw Error("wpmProductId element not found");t.isIntersecting?c[o]=setTimeout((()=>{e.triggerViewItemList(r),wpmDataLayer.viewItemListTrigger.testMode&&e.viewItemListTriggerTestMode(t.target),!1===wpmDataLayer.viewItemListTrigger.repeat&&a.unobserve(t.target)}),wpmDataLayer.viewItemListTrigger.timeout):(clearTimeout(c[o]),wpmDataLayer.viewItemListTrigger.testMode&&jQuery(t.target).find("#viewItemListTriggerOverlay").remove())}catch(e){console.log(e)}}))};let d,u=0;e.startIntersectionObserverToWatch=function(){try{new URLSearchParams(window.location.search).has("vildemomode")&&(wpmDataLayer.viewItemListTrigger.testMode=!0),s=new IntersectionObserver(e.observerCallback,{threshold:wpmDataLayer.viewItemListTrigger.threshold}),d=jQuery(".wpmProductId").map((function(e,t){return jQuery(t).parent().hasClass("type-product")||jQuery(t).parent().hasClass("product")||jQuery(t).parent().hasClass("product-item-inner")?jQuery(t).parent():jQuery(t).prev().hasClass("wc-block-grid__product")||jQuery(t).prev().hasClass("product")||jQuery(t).prev().hasClass("product-small")||jQuery(t).prev().hasClass("woocommerce-LoopProduct-link")?jQuery(this).prev():jQuery(t).closest(".product").length?jQuery(t).closest(".product"):void 0})),d.each((function(e,t){jQuery(t[0]).data("ioid",u++),s.observe(t[0])}))}catch(e){console.log(e)}},e.startProductsMutationObserverToWatch=function(){try{let e=jQuery(".wpmProductId:eq(0)").parents().has(jQuery(".wpmProductId:eq(1)").parents()).first();e.length&&l.observe(e[0],{attributes:!0,childList:!0,characterData:!0})}catch(e){console.log(e)}};let l=new MutationObserver((function(e){e.forEach((function(e){let t=e.addedNodes;null!==t&&jQuery(t).each((function(){(jQuery(this).hasClass("type-product")||jQuery(this).hasClass("product-small")||jQuery(this).hasClass("wc-block-grid__product"))&&p(this)&&(jQuery(this).data("ioid",u++),s.observe(this))}))}))})),p=function(e){return!(!jQuery(e).find(".wpmProductId").length&&!jQuery(e).siblings(".wpmProductId").length)};e.setCookie=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:"",r=arguments.length>2&&arguments[2]!==a?arguments[2]:null;if(r){let a=new Date;a.setTime(a.getTime()+24*r*60*60*1e3);let o="expires="+a.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}else document.cookie=e+"="+t+";path=/"},e.getCookie=function(e){let t=e+"=",a=decodeURIComponent(document.cookie).split(";");for(let e=0;e<a.length;e++){let r=a[e];for(;" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return""},e.storeOrderIdOnServer=function(t){try{let a={action:"wpm_purchase_pixels_fired",order_id:t,nonce:e.nonce};jQuery.ajax({type:"post",dataType:"json",url:e.ajax_url,data:a,success:function(e){!1===e.success&&console.log(e)},error:function(e){console.log(e)}})}catch(e){console.log(e)}},e.getProductIdByCartItemKeyUrl=function(e){let t=new URLSearchParams(e.search).get("remove_item"),a=null;return a=0===wpmDataLayer.cartItemKeys[t].variation_id?wpmDataLayer.cartItemKeys[t].product_id:wpmDataLayer.cartItemKeys[t].variation_id,a},e.getAddToCartLinkProductIds=function(){return jQuery("a").map((function(){let e=jQuery(this).attr("href");if(e&&e.includes("?add-to-cart=")){let t=e.match(/(add-to-cart=)(\d+)/);if(t)return t[2]}})).get()},e.getProductDetailsFormattedForEvent=function(e){let t=arguments.length>1&&arguments[1]!==a?arguments[1]:1,r={id:e.toString(),dyn_r_ids:wpmDataLayer.products[e].dyn_r_ids,name:wpmDataLayer.products[e].name,list_name:wpmDataLayer.shop.list_name,brand:wpmDataLayer.products[e].brand,category:wpmDataLayer.products[e].category,variant:wpmDataLayer.products[e].variant,list_position:wpmDataLayer.products[e].position,quantity:t,price:wpmDataLayer.products[e].price,currency:wpmDataLayer.shop.currency,isVariable:wpmDataLayer.products[e].isVariable,isVariation:wpmDataLayer.products[e].isVariation,parentId:wpmDataLayer.products[e].parentId};return r.isVariation&&(r.parentId_dyn_r_ids=wpmDataLayer.products[e].parentId_dyn_r_ids),r},e.setReferrerToCookie=function(){e.getCookie("wpmReferrer")||e.setCookie("wpmReferrer",document.referrer)},e.getReferrerFromCookie=function(){return e.getCookie("wpmReferrer")?e.getCookie("wpmReferrer"):null},e.getClidFromBrowser=function(){let t,r=arguments.length>0&&arguments[0]!==a?arguments[0]:"gclid";return t={gclid:"_gcl_aw",dclid:"_gcl_dc"},e.getCookie(t[r])?e.getCookie(t[r]).match(/(GCL.[\d]*.)(.*)/)[2]:""},e.getUserAgent=function(){return navigator.userAgent},e.getViewPort=function(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}};let g=function(){let t=e.getCookie("cmplz_statistics"),a=e.getCookie("cmplz_marketing");return!(!e.getCookie("cmplz_consent_status")&&!e.getCookie("cmplz_banner-status"))&&{analytics:"allow"===t,ads:"allow"===a,visitorHasChosen:!0}},m=function(){let t=e.getCookie("cookielawinfo-checkbox-analytics"),a=e.getCookie("cookielawinfo-checkbox-advertisement"),r=e.getCookie("CookieLawInfoConsent");return!(!t&&!a)&&{analytics:"yes"===t,ads:"yes"===a,visitorHasChosen:!!r}},y={categories:{},pixels:[],mode:"category",visitorHasChosen:!1};e.getConsentValues=function(){return y},e.updateConsentCookieValues=function(){let t,r=arguments.length>0&&arguments[0]!==a&&arguments[0];if(t=e.getCookie("CookieConsent"))t=decodeURI(t),y.categories.analytics=t.indexOf("statistics:true")>=0,y.categories.ads=t.indexOf("marketing:true")>=0,y.visitorHasChosen=!0;else if(t=e.getCookie("CookieScriptConsent"))t=JSON.parse(t),"reject"===t.action?(y.categories.analytics=!1,y.categories.ads=!1):2===t.categories.length?(y.categories.analytics=!0,y.categories.ads=!0):(y.categories.analytics=t.categories.indexOf("performance")>=0,y.categories.ads=t.categories.indexOf("targeting")>=0),y.visitorHasChosen=!0;else if(t=e.getCookie("borlabs-cookie")){var o,i,n,s,c,d,u,l;t=decodeURI(t),t=JSON.parse(t),y.categories.analytics=!(null===(o=t)||void 0===o||null===(i=o.consents)||void 0===i||!i.statistics),y.categories.ads=!(null===(n=t)||void 0===n||null===(s=n.consents)||void 0===s||!s.marketing),y.visitorHasChosen=!0,y.pixels=[...(null===(c=t)||void 0===c||null===(d=c.consents)||void 0===d?void 0:d.statistics)||[],...(null===(u=t)||void 0===u||null===(l=u.consents)||void 0===l?void 0:l.marketing)||[]],y.mode="pixel"}else(t=g())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=t.visitorHasChosen):(t=e.getCookie("cookie_notice_accepted"))?(y.categories.analytics=!0,y.categories.ads=!0,y.visitorHasChosen=!0):(t=e.getCookie("hu-consent"))?(t=JSON.parse(t),y.categories.analytics=!!t.categories[3],y.categories.ads=!!t.categories[4],y.visitorHasChosen=!0):(t=m())?(y.categories.analytics=!0===t.analytics,y.categories.ads=!0===t.ads,y.visitorHasChosen=!0===t.visitorHasChosen):(t=e.getCookie("moove_gdpr_popup"))?(t=JSON.parse(t),y.categories.analytics="1"===t.thirdparty,y.categories.ads="1"===t.advanced,y.visitorHasChosen=!0):(y.categories.analytics=!r,y.categories.ads=!r)},e.updateConsentCookieValues(),e.setConsentDefaultValuesToExplicit=function(){y.categories={analytics:!1,ads:!1}},e.scriptTagObserver=new MutationObserver((a=>{a.forEach((a=>{let{addedNodes:r}=a;[...r].forEach((a=>{t(a).data("wpm-cookie-category")&&(e.shouldScriptBeActive(a)?e.unblockScript(a):e.blockScript(a))}))}))})),e.scriptTagObserver.observe(document.head,{childList:!0,subtree:!0}),window.addEventListener("DOMContentLoaded",(()=>e.scriptTagObserver.disconnect())),e.shouldScriptBeActive=function(e){var a,r,o,i;return!((wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent||y.visitorHasChosen)&&("category"!==y.mode||!t(e).data("wpm-cookie-category").split(",").some((e=>y.categories[e])))&&("pixel"!==y.mode||!y.pixels.includes(t(e).data("wpm-pixel-name")))&&("pixel"!==y.mode||"google"!==t(e).data("wpm-pixel-name")||!["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&(null===(a=wpmDataLayer)||void 0===a||null===(r=a.pixels)||void 0===r||null===(o=r.google)||void 0===o||null===(i=o.consent_mode)||void 0===i||!i.active||"google"!==t(e).data("wpm-pixel-name")))},e.unblockScript=function(e){let r=arguments.length>1&&arguments[1]!==a&&arguments[1];r&&t(e).remove();let o=t(e).data("wpm-src");o&&t(e).attr("src",o),e.type="text/javascript",r&&t(e).appendTo("head")},e.blockScript=function(e){let r=arguments.length>1&&arguments[1]!==a&&arguments[1];r&&t(e).remove(),t(e).attr("src")&&t(e).removeAttr("src"),e.type="blocked/javascript",r&&t(e).appendTo("head")},e.unblockAllScripts=function(){let r=!(arguments.length>0&&arguments[0]!==a)||arguments[0],o=!(arguments.length>1&&arguments[1]!==a)||arguments[1];t.each(t('script[type="blocked/javascript"]'),(function(a,i){(t(i).data("wpm-cookie-category").includes("analytics")&&r||t(i).data("wpm-cookie-category").includes("ads")&&o)&&e.unblockScript(i,!0)}))},e.unblockSelectedPixels=function(){t.each(t('script[type="blocked/javascript"]'),(function(a,r){(y.pixels.includes(t(r).data("wpm-pixel-name"))||"google"===t(r).data("wpm-pixel-name")&&["google-analytics","google-ads"].some((e=>y.pixels.includes(e))))&&e.unblockScript(r,!0)}))},e.googleConfigConditionsMet=function(e){return!!wpmDataLayer.pixels.google.consent_mode.active||("category"===y.mode?!0===y.categories[e]:"pixel"===y.mode&&y.pixels.includes("google-"+e))},e.getVisitorConsentStatusAndUpdateGoogleConsentSettings=function(e){return"category"===y.mode?(y.categories.analytics&&(e.analytics_storage="granted"),y.categories.ads&&(e.ad_storage="granted")):"pixel"===y.mode&&(e.analytics_storage=y.pixels.includes("google-analytics")?"granted":"denied",e.ad_storage=y.pixels.includes("google-ads")?"granted":"denied"),e},e.updateGoogleConsentMode=function(){let e=!(arguments.length>0&&arguments[0]!==a)||arguments[0],t=!(arguments.length>1&&arguments[1]!==a)||arguments[1];window.gtag&&wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent&&gtag("consent","update",{analytics_storage:e?"granted":"denied",ad_storage:t?"granted":"denied"})},window.addEventListener("borlabs-cookie-consent-saved",(function(t){e.updateConsentCookieValues(),"pixel"===y.mode?(e.unblockSelectedPixels(),e.updateGoogleConsentMode(y.pixels.includes("google-analytics"),y.pixels.includes("google-ads"))):(e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads))})),window.addEventListener("CookiebotOnAccept",(function(t){Cookiebot.consent.statistics&&(y.categories.analytics=!0),Cookiebot.consent.marketing&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}),!1),window.addEventListener("CookieScriptAccept",(function(t){t.detail.categories.includes("performance")&&(y.categories.analytics=!0),t.detail.categories.includes("targeting")&&(y.categories.ads=!0),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),window.addEventListener("CookieScriptAcceptAll",(function(t){e.unblockAllScripts(!0,!0),e.updateGoogleConsentMode(!0,!0)})),document.addEventListener("cmplzStatusChange",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),document.addEventListener("setCookieNotice",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)})),e.huObserver=new MutationObserver((function(t){t.forEach((t=>{let{addedNodes:a}=t;[...a].forEach((t=>{"hu"===t.id&&jQuery(".hu-cookies-save").on("click",(function(t){e.updateConsentCookieValues(),e.unblockAllScripts(y.categories.analytics,y.categories.ads),e.updateGoogleConsentMode(y.categories.analytics,y.categories.ads)}))}))}))})),window.hu&&e.huObserver.observe(document.documentElement||document.body,{childList:!0,subtree:!0}),e.version=function(){console.log(wpmDataLayer.version)},window.wpmLoaded={}}(window.wpm=window.wpm||{},jQuery),jQuery((function(){wpm.startIntersectionObserverToWatch(),wpm.startProductsMutationObserverToWatch(),jQuery("body"),jQuery(".products, .product"),jQuery(document).on("click",".remove_from_cart_button, .remove",(function(e){try{let e=new URL(jQuery(this).attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e);wpm.removeProductFromCart(t)}catch(e){console.log(e)}})),jQuery(document).on("click",".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button",(function(e){try{if("product"===wpmDataLayer.shop.page_type){if(void 0!==jQuery(this).attr("href")&&jQuery(this).attr("href").includes("add-to-cart")){let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}else if("simple"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).val();wpm.addProductToCart(t,e)}else if("variable"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("[name='variation_id']").val();wpm.addProductToCart(t,e)}else if("grouped"===wpmDataLayer.shop.product_type)jQuery(".woocommerce-grouped-product-list-item").each((function(){let e=Number(jQuery(this).find(".input-text.qty").val());e||0===e||(e=1);let t=jQuery(this).attr("class"),a=wpm.getPostIdFromString(t);wpm.addProductToCart(a,e)}));else if("bundle"===wpmDataLayer.shop.product_type){let e=Number(jQuery(".input-text.qty").val());e||0===e||(e=1);let t=jQuery("input[name=add-to-cart]").val();wpm.addProductToCart(t,e)}}else{let e=1,t=jQuery(this).data("product_id");wpm.addProductToCart(t,e)}}catch(e){console.log(e)}})),jQuery(document).one("click","a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)",(function(e){try{if(jQuery(e.target).closest("a").attr("href")){let t=jQuery(e.target).closest("a").attr("href");if(t.includes("add-to-cart=")){let e=t.match(/(add-to-cart=)(\d+)/);e&&wpm.addProductToCart(e[2],1)}}}catch(e){console.log(e)}})),jQuery(document).on("click",".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product",(function(e){try{let e=jQuery(this).nextAll(".wpmProductId:first").data("id");if(e){if(e=getIdBasedOndVariationsOutputSetting(e),!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmSelectContentGaUa",t),jQuery(document).trigger("wpmSelectItem",t)}}}catch(e){console.log(e)}})),jQuery(document).one("click",".checkout-button, .cart-checkout-button, .button.checkout",(function(e){jQuery(document).trigger("wpmBeginCheckout")}));let e=!1;jQuery(document).on("input","#billing_email",(function(){wpm.isEmail(jQuery(this).val())&&(wpm.fireCheckoutProgress(2),e=!0)}));let t=!1;jQuery(document).on("click",".wc_payment_methods",(function(){!1===t&&wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val()),t=!0})),jQuery(document).one("click","#place_order",(function(){!1===e&&wpm.fireCheckoutProgress(2),!1===t&&(wpm.fireCheckoutProgress(3),wpm.fireCheckoutOption(3,jQuery("input[name='payment_method']:checked").val())),wpm.fireCheckoutProgress(4)})),jQuery(document).on("click","[name='update_cart']",(function(e){try{jQuery(".cart_item").each((function(){let e=new URL(jQuery(this).find(".product-remove").find("a").attr("href")),t=wpm.getProductIdByCartItemKeyUrl(e),a=jQuery(this).find(".qty").val();0===a?wpm.removeProductFromCart(t):a<wpmDataLayer.cart[t].quantity?wpm.removeProductFromCart(t,wpmDataLayer.cart[t].quantity-a):a>wpmDataLayer.cart[t].quantity&&wpm.addProductToCart(t,a-wpmDataLayer.cart[t].quantity)}))}catch(e){console.log(e),wpm.getCartItemsFromBackend()}})),jQuery(".single_variation_wrap").on("show_variation",(function(e,t){try{let e=getIdBasedOndVariationsOutputSetting(t.variation_id);if(!e)throw Error("Wasn't able to retrieve a productId");if(wpmDataLayer.products&&wpmDataLayer.products[e]){let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmViewItem",t)}}catch(e){console.log(e)}})),jQuery(document).on("click",".add_to_wishlist, .wl-add-to",(function(){try{let e;if(jQuery(this).data("productid")?e=jQuery(this).data("productid"):jQuery(this).data("product-id")&&(e=jQuery(this).data("product-id")),!e)throw Error("Wasn't able to retrieve a productId");let t=wpm.getProductDetailsFormattedForEvent(e);jQuery(document).trigger("wpmAddToWishlist",t)}catch(e){console.log(e)}})),jQuery(document).on("updated_cart_totals",(function(){jQuery(document).trigger("wpmViewCart")}))})),jQuery(document).ajaxSend((function(e,t,a){a.url.includes("get_refreshed_fragments")&&sessionStorage&&(sessionStorage.getItem("wpmMiniCartActive")||sessionStorage.setItem("wpmMiniCartActive",JSON.stringify(!0)))})),jQuery(window).on("load",(function(){try{JSON.parse(sessionStorage.getItem("wpmMiniCartActive"))&&JSON.parse(sessionStorage.getItem("wpmFirstPageLoad"))&&!0===wpmDataLayer.shop.mini_cart.track?wpm.getCartItems():sessionStorage.setItem("wpmFirstPageLoad",JSON.stringify(!0))}catch(e){console.log(e)}})),jQuery(window).on("load",(function(){wpmDataLayer.products=wpmDataLayer.products||{};let e=wpm.getAddToCartLinkProductIds();wpm.getProductsFromBackend(e)})),jQuery(window).on("load",(function(){if(!wpm.getCookie("wpmReferrer"))if(document.referrer){let e=new URL(document.referrer).hostname;e!==window.location.host?wpm.setCookie("wpmReferrer",e):wpm.setCookie("wpmReferrer","")}else wpm.setCookie("wpmReferrer","")}))}},t={};function a(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,a),i.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";a(712),a(832),a(398)})()})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AAO,EAGT,OAAO,EAEP,OAAO,GAITrJ,EAAI4O,yBAA2B,WAC9B,OAAOnP,SAASkS,OAAOtI,SAAS,8BAGjCrJ,EAAIgV,gBAAkB,SAAU0H,GAE/B,OADgB,IAAI9I,gBAAgB9R,OAAOC,SAAS8R,QACnCgC,IAAI6G,IAOtB5a,OAAM,UAAgB,GAz1CtB,CAu2CCA,OAAO9B,IAAM8B,OAAO9B,KAAO,GAAIR,S,cCr2CjC6F,EAAQ,M,SCMRrF,IAAIkc,qBACFnW,MAAK,WACL7D,QAAQ6P,IAAI,+BAAiCpS,aAAa2D,QAAQqZ,IAAM,MAAQ,QAAS,YAAchd,aAAa2D,QAAQmD,OAAS,WACrIjH,OAAOC,UAAU6B,QAAQ,mBAAoB,OAE7CyE,MAAK,WACL/F,IAAIsc,aAAavW,MAAK,WACrBvG,OAAOC,UAAU6B,QAAQ,UAAW,UAWvCtB,IAAIwc,YAAYzW,MAAK,WAMpB/F,IAAIkc,qBACFnW,MAAK,WAEL/F,IAAI+U,mCAGJ/U,IAAI0V,+CC1CHkH,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBna,IAAjBoa,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,IAOV,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,QCjBf3X,EAAQ,KAGRrF,IAAIoc,eAAerW,MAAK,WAEvBV,EAAQ,KAERA,EAAQ,IACRA,EAAQ,IACRA,EAAQ,KAuBRA,EAAQ,S","sources":["webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/facebook/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/ads/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga3/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/ga4/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/analytics/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/base/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/google/optimize/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/hotjar/loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/event_listeners.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/functions.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/functions_loader.js","webpack://WooCommerce-Pixel-Manager/./src/js/public/wpm/init.js","webpack://WooCommerce-Pixel-Manager/webpack/bootstrap","webpack://WooCommerce-Pixel-Manager/./src/js/public/main.js"],"sourcesContent":["/**\n * All event listeners\n * */\n\n// Load pixel event\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.facebook?.pixel_id && !wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tif (wpm.canIFire(\"ads\", \"facebook-ads\")) wpm.loadFacebookPixel()\n\t}\n})\n\n// AddToCart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t// console.log('eventId: ' + eventId);\n\n\t\tfbq(\"track\", \"AddToCart\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToCart\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// InitiateCheckout event\njQuery(document).on(\"wpmBeginCheckout\", function (event) {\n\n\ttry {\n\t\t// console.log('firing facebook ads InitiateCheckout event');\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"InitiateCheckout\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"InitiateCheckout\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// AddToWishlist event\njQuery(document).on(\"wpmAddToWishlist\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads AddToWishlist event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\n\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"AddToWishlist\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tproduct_data : product,\n\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// ViewContent event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\t// console.log('firing facebook ads ViewContent event');\n\t\t// console.log(product);\n\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.fbViewContent(product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tlet eventId = wpm.getRandomEventId()\n\n\t\tfbq(\"track\", \"Search\", {}, {\n\t\t\teventID: eventId,\n\t\t})\n\n\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\tevent_name : \"Search\",\n\t\t\tevent_id : eventId,\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// load always event\njQuery(document).on(\"wpmLoadAlways\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.setFbUserData()\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// https://developers.pinterest.com/docs/tag/conversion/\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Purchase\",\n\t\t\t{\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcontent_ids : wpm.facebookContentIds(),\n\t\t\t},\n\t\t\t{eventID: wpmDataLayer.order.id},\n\t\t)\n\n\n\t\t// console.log(wpm.facebookContentIds())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Facebook\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet fBUserData\n\n\twpm.loadFacebookPixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.facebook.loaded = true\n\n\t\t\t// @formatter:off\n\t\t\t!function(f,b,e,v,n,t,s)\n\t\t\t{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n\t\t\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};\n\t\t\t\tif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n\t\t\t\tn.queue=[];t=b.createElement(e);t.async=!0;\n\t\t\t\tt.src=v;s=b.getElementsByTagName(e)[0];\n\t\t\t\ts.parentNode.insertBefore(t,s)}(window, document,'script',\n\t\t\t\t'https://connect.facebook.net/en_US/fbevents.js');\n\t\t\t// @formatter:on\n\n\t\t\tfbq(\"init\", wpmDataLayer.pixels.facebook.pixel_id)\n\t\t\tfbq(\"track\", \"PageView\")\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getRandomEventId = function () {\n\t\treturn (Math.random() + 1).toString(36).substring(2)\n\t}\n\n\twpm.getFbUserData = function () {\n\t\t// We need the first one for InitiateCheckout\n\t\t// where getting the user_data from the browser is too slow\n\t\t// using wpm.getCookie(), so we cache the user_data earlier.\n\t\t// And we need the second one because the ViewContent hit happens too fast\n\t\t// after adding a variation to the cart because the function to cache\n\t\t// the user_data is too slow. But we can get the user_data using wpm.getCookie()\n\t\t// because we don't move away from the page and can wait for the browser\n\t\t// to get it.\n\t\tif (fBUserData) {\n\t\t\treturn fBUserData\n\t\t} else {\n\t\t\treturn wpm.getFbUserDataFromBrowser()\n\t\t}\n\t}\n\n\twpm.setFbUserData = function () {\n\t\tfBUserData = wpm.getFbUserDataFromBrowser()\n\t}\n\n\twpm.getFbUserDataFromBrowser = function () {\n\t\treturn {\n\t\t\tfbp : wpm.getCookie(\"_fbp\"),\n\t\t\tfbc : wpm.getCookie(\"_fbc\"),\n\t\t\tclient_user_agent: navigator.userAgent,\n\t\t}\n\t}\n\n\twpm.fbViewContent = function (product) {\n\n\t\ttry {\n\t\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\t\tlet eventId = wpm.getRandomEventId()\n\n\t\t\tfbq(\"track\", \"ViewContent\", {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tcontent_name: product.name,\n\t\t\t\t// content_category: product.category,\n\t\t\t\tcontent_ids: product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t\tvalue : product.price,\n\t\t\t}, {\n\t\t\t\teventID: eventId,\n\t\t\t})\n\n\t\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\n\t\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\t\tevent_name : \"ViewContent\",\n\t\t\t\tevent_id : eventId,\n\t\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\t\tproduct_data : product,\n\t\t\t\tproduct_id : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\tevent_source_url: window.location.href,\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.facebookContentIds = function () {\n\t\tlet prodIds = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t}\n\n\t\treturn prodIds\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Facebook loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n\n","/**\n * Load Google Ads event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tif (\n\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\tproduct.isVariable &&\n\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t) return\n\n\t\t// try to prevent that WC sends cached hits to Google\n\t\tif (!product) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_item_list\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"add_to_cart\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : product.quantity * product.price,\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tquantity : product.quantity,\n\t\t\t\t\tprice : product.price,\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", function (event, product) {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_item\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : (product.quantity ? product.quantity : 1) * product.price,\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tquantity : (product.quantity ? product.quantity : 1),\n\t\t\t\t\tprice : product.price,\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}],\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"wpmSearch\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tlet products = []\n\n\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t})\n\t\t}\n\n\t\t// console.log(products);\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"view_search_results\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\t// value : 1 * product.price,\n\t\t\t\titems: products,\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view order received page event\n// TODO distinguish with or without cart data active\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\titems : wpm.getGoogleAdsDynamicRemarketingOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGoogleAdsDynamicRemarketingOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// user log in event\njQuery(document).on(\"wpmLogin\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"login\", {\n\t\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view order received page event\n// new_customer parameter: https://support.google.com/google-ads/answer/9917012\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif(jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data_basic = {}\n\t\tlet data_with_cart = {}\n\n\t\tdata_basic = {\n\t\t\tsend_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),\n\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnew_customer : wpmDataLayer.order.new_customer,\n\t\t}\n\n\t\tif (wpmDataLayer?.order?.aw_merchant_id) {\n\t\t\tdata_with_cart = {\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\taw_merchant_id : wpmDataLayer.order.aw_merchant_id,\n\t\t\t\taw_feed_country : wpmDataLayer.order.aw_feed_country,\n\t\t\t\taw_feed_language: wpmDataLayer.order.aw_feed_language,\n\t\t\t\titems : wpm.getGoogleAdsRegularOrderItems(),\n\t\t\t}\n\t\t}\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"conversion\", {...data_basic, ...data_with_cart})\n\t\t})\n\n\t\t// console.log({...data_basic,...data_with_cart})\n\n\t\t// console.log(wpm.getGoogleAdsOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n\n\n\n","/**\n * Load Google Ads functions\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet conversionIdentifiers = []\n\n\twpm.getGoogleAdsConversionIdentifiersWithLabel = function () {\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key + \"/\" + item)\n\t\t}\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsConversionIdentifiers = function () {\n\n\t\tlet conversionIdentifiers = []\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\tconversionIdentifiers.push(key)\n\t\t}\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsRegularOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\": 1,\n\t\t// \"price\" : 45\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity: item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n\twpm.getGoogleAdsDynamicRemarketingOrderItems = function () {\n\t\t// \"id\" : \"gla_34\",\n\t\t// \"quantity\" : 1,\n\t\t// \"price\" : 45,\n\t\t// \"google_business_vertical\": \"retail\"\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load Google Ads\n */\n\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load Google Universal Analytics (GA3) event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.universal.property_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGAUAOrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// console.log(wpm.getGAUAOrderItems())\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Add functions for Google Analytics Universal\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGAUAOrderItems = function () {\n\n\t\t// \"id\" : \"34\",\n\t\t// \"name\" : \"Hoodie\",\n\t\t// \"brand\" : \"\",\n\t\t// \"category\" : \"Hoodies\",\n\t\t// \"list_position\": 1,\n\t\t// \"price\" : 45,\n\t\t// \"quantity\" : 1,\n\t\t// \"variant\" : \"Color: blue | Logo: yes\"\n\n\n\t\tlet orderItems = [],\n\t\t\tlist_position = 1\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tname : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcategory : wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t\tlist_position: list_position,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t\tlist_position++\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Google Universal Analytics (GA3) loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Load GA4 event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGA4OrderItems(),\n\t\t\t})\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Load GA4 functions\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGA4OrderItems = function () {\n\n\t\t// \"item_id\" : \"34\",\n\t\t// \"item_name\" : \"Hoodie\",\n\t\t// \"quantity\" : 1,\n\t\t// \"item_brand\" : \"\",\n\t\t// \"item_variant\" : \"Color: blue | Logo: yes\",\n\t\t// \"price\" : 45,\n\t\t// \"currency\" : \"CHF\",\n\t\t// \"item_category\": \"Hoodies\"\n\n\n\t\tlet orderItems = []\n\n\t\tfor (const [key, item] of Object.entries(wpmDataLayer.order.items)) {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\titem_name : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\titem_category: wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t}\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * GA4 loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Google Analytics loader\n */\n\nrequire(\"./ga3/loader\")\nrequire(\"./ga4/loader\")\n","/**\n * Load Google base event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") {\n\t\tif (wpm.canGoogleLoad()) {\n\t\t\twpm.loadGoogle()\n\t\t} else {\n\t\t\twpm.logPreventedPixelLoading(\"google\", \"analytics / ads\")\n\t\t}\n\t}\n})\n","/**\n * Load Google base functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.googleConfigConditionsMet = function (type) {\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (wpm.getConsentValues().mode === \"category\") {\n\t\t\treturn wpm.getConsentValues().categories[type] === true\n\t\t} else if (wpm.getConsentValues().mode === \"pixel\") {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-\" + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {\n\n\t\tif (wpm.getConsentValues().mode === \"category\") {\n\t\t\tif (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = \"granted\"\n\t\t\tif (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = \"granted\"\n\t\t} else if ((wpm.getConsentValues().mode === \"pixel\")) {\n\t\t\tgoogle_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes(\"google-analytics\") ? \"granted\" : \"denied\"\n\t\t\tgoogle_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes(\"google-ads\") ? \"granted\" : \"denied\"\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.updateGoogleConsentMode = function (analytics = true, ads = true) {\n\n\t\ttry {\n\t\t\tif (\n\t\t\t\t!window.gtag ||\n\t\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t\t) return\n\n\t\t\tgtag(\"consent\", \"update\", {\n\t\t\t\tanalytics_storage: analytics ? \"granted\" : \"denied\",\n\t\t\t\tad_storage : ads ? \"granted\" : \"denied\",\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAds = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.ads.state = \"loading\"\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key, {\"allow_enhanced_conversions\": true})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [key, item] of Object.entries(wpmDataLayer.pixels.google.ads.conversionIds)) {\n\t\t\t\t\tgtag(\"config\", key)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {\n\t\t\t\tgtag(\"config\", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + \"/\" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {\n\t\t\t\t\tphone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// ! enhanced_conversion_data needs to be var\n\t\t\t// https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools\n\t\t\tif (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data) {\n\t\t\t\twindow.enhanced_conversion_data = wpmDataLayer.order.google.ads.enhanced_conversion_data\n\t\t\t}\n\n\t\t\twpmDataLayer.pixels.google.ads.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsUA = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsGA4 = function () {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, wpmDataLayer.pixels.google.analytics.ga4.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.isGoogleActive = function () {\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||\n\t\t\t!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)\n\t\t) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getGoogleGtagId = function () {\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.universal.property_id\n\t\t} else if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.ga4.measurement_id\n\t\t} else {\n\t\t\treturn Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t}\n\t}\n\n\twpm.loadGoogle = function () {\n\n\t\tif (wpm.isGoogleActive()) {\n\n\t\t\twpmDataLayer.pixels.google.state = \"loading\"\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googletagmanager.com/gtag/js?id=\" + wpm.getGoogleGtagId())\n\t\t\t\t.done(function (script, textStatus) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// console.log('Google Optimize loaded')\n\t\t\t\t\t\t// alert('Google Optimize loaded')\n\n\t\t\t\t\t\t// Initiate Google dataLayer and gtag\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\t\t\t\twindow.gtag = function gtag() {\n\t\t\t\t\t\t\tdataLayer.push(arguments)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Consent Mode\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\n\t\t\t\t\t\t\tlet google_consent_settings = {\n\t\t\t\t\t\t\t\t\"ad_storage\" : wpmDataLayer.pixels.google.consent_mode.ad_storage,\n\t\t\t\t\t\t\t\t\"analytics_storage\": wpmDataLayer.pixels.google.consent_mode.analytics_storage,\n\t\t\t\t\t\t\t\t\"wait_for_update\" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.region) {\n\t\t\t\t\t\t\t\tgoogle_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgoogle_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)\n\n\t\t\t\t\t\t\tgtag(\"consent\", \"default\", google_consent_settings)\n\t\t\t\t\t\t\tgtag(\"set\", \"ads_data_redaction\", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)\n\t\t\t\t\t\t\tgtag(\"set\", \"url_passthrough\", wpmDataLayer.pixels.google.consent_mode.url_passthrough)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Linker\n\t\t\t\t\t\t// https://developers.google.com/gtagjs/devguide/linker\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.linker?.settings) {\n\t\t\t\t\t\t\tgtag(\"set\", \"linker\", wpmDataLayer.pixels.google.linker.settings)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgtag(\"js\", new Date())\n\n\t\t\t\t\t\t// Google Ads loader\n\t\t\t\t\t\tif (!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) { // Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"ads\")) { \t\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAds()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-ads\", \"ads\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t// Google Universal Analytics loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) { \t\t// Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsUA()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-universal-analytics\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// GA4 loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) { \t\t\t// Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsGA4()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"ga4\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twpmDataLayer.pixels.google.state = \"ready\"\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\twpm.canGoogleLoad = function () {\n\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (\"category\" === wpm.getConsentValues().mode) {\n\t\t\treturn !!(wpm.getConsentValues().categories[\"ads\"] || wpm.getConsentValues().categories[\"analytics\"])\n\t\t} else if (\"pixel\" === wpm.getConsentValues().mode) {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-ads\") || wpm.getConsentValues().pixels.includes(\"google-analytics\")\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid load condition for Google mode in wpmConsentValues\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.gtagLoaded = function () {\n\t\treturn new Promise(function (resolve, reject) {\n\n\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject()\n\n\t\t\tlet startTime = 0\n\t\t\tlet timeout = 5000\n\t\t\tlet frequency = 200;\n\n\t\t\t(function wait() {\n\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t\t\t\tif (startTime >= timeout) return reject()\n\t\t\t\tstartTime += frequency\n\t\t\t\tsetTimeout(wait, frequency)\n\t\t\t})()\n\t\t})\n\t}\n\n\t// wpm.gtagLoadednew = function () {\n\t// \treturn Promise.race([\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t//\n\t// \t\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject();\n\t//\n\t//\n\t// \t\t\t\t(function wait() {\n\t// \t\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t// \t\t\t\t\tif (to >= 1000) return reject()\n\t// \t\t\t\t\tsetTimeout(wait, 100)\n\t// \t\t\t\t})()\n\t// \t\t\t}),\n\t// \t\t\tnew Promise(function (resolve, reject) {\n\t// \t\t\t\tsetTimeout(() => reject(), 1000)\n\t// \t\t\t}),\n\t// \t\t],\n\t// \t)\n\t// \t\t// .then((value) => {console.log(\"race then value: \" + value)})\n\t// \t\t.catch(\n\t// \t\t\t(value) => {\n\t// \t\t\t\tconsole.log(\"race catch value: \" + value)\n\t// \t\t\t\treturn Promise.reject()\n\t// \t\t\t})\n\t// }\n\n\n\t// const promise1 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(resolve, 500, \"one\")\n\t// })\n\t//\n\t// const promise2 = new Promise((resolve, reject) => {\n\t// \tsetTimeout(reject, 100, \"two\")\n\t// })\n\t//\n\t// let onlyRunIfResolves = function () {\n\t// \treturn Promise.race([promise1, promise2])\n\t// \t\t.catch(() => {\n\t// \t\t})\n\t// }\n\t//\n\t// onlyRunIfResolves()\n\t// \t.then(() => {\n\t// \t\tconsole.log(\"running function\")\n\t// \t})\n\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Load Google base\n */\n\n// Load base\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// require(\"./event_listeners_premium\")\n// #endif\n","/**\n * Load Google\n */\n\n// Load base\nrequire(\"./base/loader\")\n\n//Load additional Google libraries\nrequire(\"./ads/loader\")\nrequire(\"./analytics/loader\")\nrequire(\"./optimize/loader\")\n\n\n","/**\n * Load Google Optimize event listeners\n */\n\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.google?.optimize?.container_id && !wpmDataLayer?.pixels?.google?.optimize?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"google-optimize\")) wpm.load_google_optimize_pixel()\n\t}\n})\n","/**\n * Load Google Optimize functions\n */\n\n\n(function (wpm, $, undefined) {\n\n\twpm.load_google_optimize_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.optimize.loaded = true\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googleoptimize.com/optimize.js?id=\" + wpmDataLayer.pixels.google.optimize.container_id)\n\t\t\t// .done(function (script, textStatus) {\n\t\t\t// \t\tconsole.log('Google Optimize loaded')\n\t\t\t// });\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Load Google Optimize\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load Hotjar event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.hotjar?.site_id && !wpmDataLayer?.pixels?.hotjar?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"hotjar\") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()\n\t}\n})\n","/**\n * Load Hotjar functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.load_hotjar_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.hotjar.loaded = true;\n\n\t\t\t// @formatter:off\n\t\t\t(function(h,o,t,j,a,r){\n\t\t\t\th.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n\t\t\t\th._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};\n\t\t\t\ta=o.getElementsByTagName('head')[0];\n\t\t\t\tr=o.createElement('script');r.async=1;\n\t\t\t\tr.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n\t\t\t\ta.appendChild(r);\n\t\t\t})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n\t\t\t// @formatter:on\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Hotjar loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Register event listeners\n */\n\n// remove_from_cart event\njQuery(document).on(\"click\", \".remove_from_cart_button, .remove\", function () {\n\t// jQuery('.remove_from_cart_button, .remove').on('click', function (e) {\n\n\ttry {\n\t\t// console.log('remove_from_cart: ' + jQuery(this).data('product_id'));\n\n\t\tlet url = new URL(jQuery(this).attr(\"href\"))\n\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\t\twpm.removeProductFromCart(productId)\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// add_to_cart event\njQuery(document).on(\"click\", \".add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button\", function () {\n\t// jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {\n\n\ttry {\n\t\t// console.log('add_to_cart');\n\n\t\tif (wpmDataLayer.shop.page_type === \"product\") {\n\n\t\t\t// first process related and upsell products\n\t\t\tif (typeof jQuery(this).attr(\"href\") !== \"undefined\" && jQuery(this).attr(\"href\").includes(\"add-to-cart\")) {\n\t\t\t\t// console.log('add-to-cart on upsell and related products');\n\t\t\t\tlet quantity = 1\n\t\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t} else {\n\n\t\t\t\tif (wpmDataLayer.shop.product_type === \"simple\") {\n\n\t\t\t\t\t// console.log('test');\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(this).val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"variable\") {\n\n\t\t\t\t\t// console.log('variable');\n\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(\"[name='variation_id']\").val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"grouped\") {\n\n\t\t\t\t\t// console.log('grouped');\n\n\t\t\t\t\tjQuery(\".woocommerce-grouped-product-list-item\").each(function () {\n\n\t\t\t\t\t\tlet quantity = Number(jQuery(this).find(\".input-text.qty\").val())\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\t\tlet classes = jQuery(this).attr(\"class\")\n\t\t\t\t\t\tlet productId = wpm.getPostIdFromString(classes)\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t\t})\n\t\t\t\t} else if (wpmDataLayer.shop.product_type === \"bundle\") {\n\n\t\t\t\t\t// console.log('bundle');\n\n\t\t\t\t\tlet quantity = Number(jQuery(\".input-text.qty\").val())\n\n\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1\n\n\t\t\t\t\tlet productId = jQuery(\"input[name=add-to-cart]\").val()\n\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t\t// console.log('non product page');\n\n\t\t\tlet quantity = 1\n\t\t\tlet productId = jQuery(this).data(\"product_id\")\n\t\t\t// console.log('productId: ' + productId);\n\t\t\twpm.addProductToCart(productId, quantity)\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// if someone clicks anywhere on a custom /?add-to-cart=123 link\n// trigger the add to cart event\n// body.one('click', function (e) {\n//\n// try {\n// if (jQuery(this)[0].URL) {\n//\n// let href = new URL(jQuery(this)[0].URL);\n// let searchParams = new URLSearchParams(href.search);\n//\n// if (searchParams.has('add-to-cart')) {\n// // console.log('non product page, /?add-to-cart=123 link');\n//\n// let productId = searchParams.get('add-to-cart');\n// wpm.addProductToCart(productId, 1);\n// }\n// }\n// } catch (e) {\n// console.error(e);\n// }\n// });\n\n\n/**\n * If someone clicks anywhere on a custom /?add-to-cart=123 link\n * trigger the add to cart event\n */\njQuery(document).one(\"click\", \"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\", function (event) {\n\t// jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {\n\n\ttry {\n\t\tif (jQuery(event.target).closest(\"a\").attr(\"href\")) {\n\n\t\t\tlet href = jQuery(event.target).closest(\"a\").attr(\"href\")\n\n\t\t\tif (href.includes(\"add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\t// console.log('pid: ' + matches[2])\n\t\t\t\tif (matches) wpm.addProductToCart(matches[2], 1)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// select_content GA UA event\n// select_item GA 4 event\n// jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {\njQuery(document).on(\"click\", \".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\", function () {\n\t// jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {\n\n\ttry {\n\n\t\t/**\n\t\t *\n\t\t * On some pages the event fires multiple times, and on product pages\n\t\t * even on page load. Using e.stopPropagation helps to prevent this,\n\t\t * but I dont know why. We don't even have to use this, since only a real\n\t\t * product click yields a valid productId. So we filter the invalid click\n\t\t * events out later down the code. I'll keep it that way because this is\n\t\t * the most compatible way across shops.\n\t\t * e.stopPropagation();\n\t\t * */\n\n\t\t\t// console.log('select_content and select_item');\n\n\t\tlet productId = jQuery(this).nextAll(\".wpmProductId:first\").data(\"id\")\n\t\t// console.log('select_content and select_item: ' + productId);\n\n\n\t\t/**\n\t\t * On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t * In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t * related products, which are found below.\n\t\t */\n\n\t\tif (productId) {\n\n\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\t// console.log('prodid: ' + productId);\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmSelectContentGaUa\", product)\n\t\t\t\tjQuery(document).trigger(\"wpmSelectItem\", product)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// begin_checkout event\njQuery(document).one(\"click\", \".checkout-button, .cart-checkout-button, .button.checkout\", function () {\n\t// jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {\n\t// console.log('begin_checkout');\n\n\tjQuery(document).trigger(\"wpmBeginCheckout\")\n})\n\n\n// checkout_progress event\n// track checkout option event: entered valid billing email\njQuery(document).on(\"input\", \"#billing_email\", function () {\n\t// jQuery('#billing_email').on('input', function () {\n\n\tif (wpm.isEmail(jQuery(this).val())) {\n\t\t// wpm.fireCheckoutOption(2);\n\t\twpm.fireCheckoutProgress(2)\n\t\twpm.emailSelected = true\n\t}\n})\n\n// track checkout option event: purchase click\njQuery(document).on(\"click\", \".wc_payment_methods\", function () {\n\t// jQuery('.wc_payment_methods').on('click', function () {\n\n\tif (false === wpm.paymentMethodSelected) {\n\t\twpm.fireCheckoutProgress(3)\n\t}\n\n\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\twpm.paymentMethodSelected = true\n})\n\n// track checkout option event: purchase click\njQuery(document).one(\"click\", \"#place_order\", function () {\n\t// jQuery('#place_order').one('click', function () {\n\n\tif (false === wpm.emailSelected) {\n\t\twpm.fireCheckoutProgress(2)\n\t}\n\n\tif (false === wpm.paymentMethodSelected) {\n\t\twpm.fireCheckoutProgress(3)\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t}\n\n\twpm.fireCheckoutProgress(4)\n})\n\n// update cart event\njQuery(document).on(\"click\", \"[name='update_cart']\", function () {\n\t// jQuery(\"[name='update_cart']\").on('click', function (e) {\n\n\ttry {\n\t\tjQuery(\".cart_item\").each(function () {\n\n\t\t\t// let productId = jQuery(this).find('[data-product_id]').data('product_id');\n\n\t\t\tlet url = new URL(jQuery(this).find(\".product-remove\").find(\"a\").attr(\"href\"))\n\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\n\t\t\tlet quantity = jQuery(this).find(\".qty\").val()\n\n\t\t\tif (quantity === 0) {\n\t\t\t\twpm.removeProductFromCart(productId)\n\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)\n\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t\twpm.getCartItemsFromBackend()\n\t}\n})\n\n\n// add_to_wishlist\njQuery(document).on(\"click\", \".add_to_wishlist, .wl-add-to\", function () {\n\t// jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {\n\n\ttry {\n\t\t// console.log('add_to_wishlist');\n\t\t// console.log('this:' + jQuery(this).data('product-id'));\n\n\t\tlet productId\n\n\t\tif (jQuery(this).data(\"productid\")) { // for the WooCommerce wishlist plugin\n\t\t\tproductId = jQuery(this).data(\"productid\")\n\t\t} else if (jQuery(this).data(\"product-id\")) { // for the YITH wishlist plugin\n\t\t\tproductId = jQuery(this).data(\"product-id\")\n\t\t}\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t// console.log('add_to_wishlist');\n\t\t// console.log(product);\n\n\t\tjQuery(document).trigger(\"wpmAddToWishlist\", product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\njQuery(document).on(\"updated_cart_totals\", function () {\n\tjQuery(document).trigger(\"wpmViewCart\")\n})\n\n\n/**\n * Called when the user selects all the required dropdowns / attributes\n *\n * Has to be hooked after document ready\n *\n * https://stackoverflow.com/a/27849208/4688612\n * https://stackoverflow.com/a/65065335/4688612\n */\njQuery(\".single_variation_wrap\").on(\"show_variation\", function (event, variation) {\n\n\ttry {\n\t\tlet productId = getIdBasedOndVariationsOutputSetting(variation.variation_id)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t// console.log('productId: ' + productId);\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n/**\n * Called on variable products when no selection has been done yet\n * or when the visitor deselects his choice.\n *\n * Has to be hooked after document ready\n */\n\njQuery(\".single_variation_wrap\").on(\"hide_variation\", function () {\n\n\ttry {\n\t\tlet classes = jQuery(\"body\").attr(\"class\")\n\t\tlet productId = classes.match(/(postid-)(\\d+)/)[2]\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t/**\n\t\t * If we have a variable product with no preset,\n\t\t * and variations output is enabled,\n\t\t * then we send a viewItem event with the first\n\t\t * variation we find for the parent.\n\t\t * If variations output is disabled,\n\t\t * we just send the parent ID.\n\t\t */\n\t\tif (\n\t\t\t\"variable\" === wpmDataLayer.shop.product_type &&\n\t\t\twpmDataLayer?.general?.variationsOutput\n\t\t) {\n\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\t\t\t\tif (\"parentId\" in product) {\n\t\t\t\t\t// console.log('pid: ' + value.parentId)\n\t\t\t\t\tproductId = product.id\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t// console.log('productId: ' + productId);\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * Set up wpm events\n */\n\n\n// populate the wpmDataLayer with the cart items\njQuery(window).on(\"wpmLoad\", function () {\n\n\ttry {\n\t\t// When a new session is initiated there are no items in the cart,\n\t\t// so we can save the call to get the cart items\n\t\tif (wpm.doesWooCommerceCartExist()) wpm.getCartItems()\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// get all add-to-cart= products from backend\njQuery(window).on(\"wpmLoad\", function () {\n\n\twpmDataLayer.products = wpmDataLayer.products || {}\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds()\n\n\twpm.getProductsFromBackend(productIds)\n})\n\n/**\n * Save the referrer into a cookie\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer)\n\t\t\tlet referrerHostname = referrerUrl.hostname\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", referrerHostname)\n\t\t\t} else {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t\t}\n\n\t\t} else {\n\t\t\twpm.setCookie(\"wpmReferrer\", \"\")\n\t\t}\n\t}\n})\n\n\n/**\n * Create our own load event in order to better handle script flow execution when JS \"optimizers\" shuffle the code.\n */\n\njQuery(window).on(\"wpmLoad\", function () {\n\ttry {\n\t\tif (typeof wpmDataLayer != \"undefined\" && !wpmDataLayer?.wpmLoadFired) {\n\n\t\t\tjQuery(document).trigger(\"wpmLoadAlways\")\n\n\t\t\tif (\"product\" === wpmDataLayer.shop.page_type && wpmDataLayer.shop.product_type !== \"variable\" && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())\n\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\n\t\t\t} else if (\"product_category\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmCategory\")\n\n\t\t\t} else if (\"search\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmSearch\")\n\n\t\t\t} else if (\"cart\" === wpmDataLayer.shop.page_type) {\n\n\t\t\t\tjQuery(document).trigger(\"wpmViewCart\")\n\n\t\t\t} else if (\"order_received_page\" === wpmDataLayer.shop.page_type && wpmDataLayer.order) {\n\n\t\t\t\tif (!wpm.isOrderIdStored(wpmDataLayer.order.id)) {\n\n\t\t\t\t\tjQuery(document).trigger(\"wpmOrderReceivedPage\")\n\t\t\t\t\twpm.writeOrderIdToStorage(wpmDataLayer.order.id)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {\n\t\t\t\tjQuery(document).trigger(\"wpmLogin\")\n\t\t\t\twpm.setLoginEventFired()\n\t\t\t}\n\n\t\t\t// /**\n\t\t\t// * Load mini cart fragments into a wpm session storage key,\n\t\t\t// * after the document load event.\n\t\t\t// */\n\t\t\t// jQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t\t\t// \t// console.log('settings.url: ' + settings.url);\n\t\t\t//\n\t\t\t// \tif (settings.url.includes(\"get_refreshed_fragments\") && sessionStorage) {\n\t\t\t// \t\tif (!sessionStorage.getItem(\"wpmMiniCartActive\")) {\n\t\t\t// \t\t\tsessionStorage.setItem(\"wpmMiniCartActive\", JSON.stringify(true))\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// })\n\n\t\t\twpmDataLayer.wpmLoadFired = true\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// jQuery(window).on(\"load\", function () {\n// \tjQuery(document).trigger(\"wpmLoad\", {})\n// })\n\njQuery(window).on(\"wpmPreLoadPixels\", function () {\n\n\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\twpm.updateConsentCookieValues(true)\n\t}\n\tjQuery(document).trigger(\"wpmLoadPixels\", {})\n})\n","/**\n * Create a wpm namespace under which all functions are declared\n */\n\n// https://stackoverflow.com/a/5947280/4688612\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : \"_wpm_order_ids\",\n\t\tcookieExpiresDays: 365,\n\t}\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookieWpmRestEndpointAvailable: \"_wpm_endpoint_available\",\n\t\trestEndpoint : \"/wp-json/\",\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\twpm.emailSelected = false\n\twpm.paymentMethodSelected = false\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = function () {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold()\n\t}\n\n\twpm.isBelowRestErrorThreshold = function () {\n\t\treturn window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold\n\t}\n\n\twpm.isRestEndpointAvailable = function () {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable))\n\t\t} else {\n\t\t\t// return wpm.testEndpoint();\n\t\t\t// just set the value whenever possible in order not to wait or block the main thread\n\t\t\twpm.testEndpoint()\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = function () {\n\n\t\treturn !!window.sessionStorage\n\t}\n\n\twpm.testEndpoint = function (\n\t\turl = location.protocol + \"//\" + location.host + wpmRestSettings.restEndpoint,\n\t\tcookieName = wpmRestSettings.cookieWpmRestEndpointAvailable,\n\t) {\n\t\t// console.log('testing endpoint');\n\n\t\tjQuery.ajax(url, {\n\t\t\ttype : \"HEAD\",\n\t\t\ttimeout: 1000,\n\t\t\t// async: false,\n\t\t\tstatusCode: {\n\t\t\t\t200: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, true);\n\t\t\t\t\t// console.log('endpoint works');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true))\n\t\t\t\t},\n\t\t\t\t404: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t\t0 : function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\t\t},\n\t\t\t},\n\t\t}).then(response => {\n\t\t\t// console.log('test done')\n\t\t\t// console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));\n\t\t\t// return JSON.parse(window.sessionStorage.getItem(cookieName));\n\t\t})\n\t}\n\n\twpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {\n\n\t\treturn !!wpm.getCookie(cookieName)\n\t}\n\n\twpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date()\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)\n\n\t\t\tlet ids = []\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId)\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + \"=\" + JSON.stringify(ids) + \";expires=\" + expiresDate.toUTCString()\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = []\n\t\t\t\tids.push(orderId)\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId)\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === \"function\" && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer(orderId)\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName)\n\t\treturn key !== \"\"\n\t}\n\n\twpm.isOrderIdStored = function (orderId) {\n\n\t\t// console.log('deduper: ' + wpmDataLayer.orderDeduplication);\n\t\tif (wpmDataLayer.orderDeduplication) {\n\t\t\t// console.log('order deduplication: on');\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"order duplication prevention: off\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.isEmail = function (email) {\n\t\t// https://emailregex.com/\n\t\tlet regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\t\treturn regex.test(email)\n\t}\n\n\twpm.removeProductFromCart = function (productId, quantityToRemove = null) {\n\t\t// console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet quantity\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove\n\t\t\t}\n\n\t\t\t// console.log('product_id: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log(productId);\n\t\t\t// console.log(wpmDataLayer.cart);\n\t\t\t// console.log(wpmDataLayer.cart[productId]);\n\n\t\t\tif (wpmDataLayer.cart[productId]) {\n\n\t\t\t\t// let product = {\n\t\t\t\t// id : productId.toString(),\n\t\t\t\t// dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,\n\t\t\t\t// name : wpmDataLayer.cart[productId].name,\n\t\t\t\t// // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n\t\t\t\t// brand : wpmDataLayer.cart[productId].brand,\n\t\t\t\t// category: wpmDataLayer.cart[productId].category,\n\t\t\t\t// variant : wpmDataLayer.cart[productId].variant,\n\t\t\t\t// // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart\n\t\t\t\t// quantity : quantity,\n\t\t\t\t// price : wpmDataLayer.cart[productId].price,\n\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t// };\n\t\t\t\t//\n\t\t\t\t// if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log('removing');\n\t\t\t\t// console.log(data);\n\n\t\t\t\tjQuery(document).trigger(\"wpmRemoveFromCart\", product)\n\n\t\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\t\t\t\t\tdelete wpmDataLayer.cart[productId]\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t} else {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\n\t\t}\n\t}\n\n\tgetIdBasedOndVariationsOutputSetting = function (productId) {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput) {\n\t\t\t\t// console.log('test');\n\t\t\t\treturn productId\n\t\t\t} else {\n\t\t\t\tif (wpmDataLayer.products[productId].isVariation) {\n\t\t\t\t\treturn wpmDataLayer.products[productId].parentId\n\t\t\t\t} else {\n\t\t\t\t\treturn productId\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = function (productId, quantity) {\n\n\t\ttry {\n\t\t\t// console.log('productId: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer?.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\t\t// console.log(productId)\n\t\t\t\t// console.log(wpmDataLayer.cart)\n\n\t\t\t\tjQuery(document).trigger(\"wpmAddToCart\", product)\n\n\t\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\t\tif (wpmDataLayer?.cart[productId]) {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity\n\t\t\t\t} else {\n\n\t\t\t\t\tif (!(\"cart\" in wpmDataLayer)) wpmDataLayer.cart = {}\n\t\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t\t}\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\twpm.getCartItems = function () {\n\n\t\t// console.log('get cart items');\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem(\"wpmDataLayerCart\") || wpmDataLayer.shop.page_type === \"order_received_page\") {\n\t\t\t\tsessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify({}))\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem(\"wpmDataLayerCart\")))\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\t// get all cart items from the backend\n\twpm.getCartItemsFromBackend = function () {\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction: \"wpm_get_cart_items\",\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (cartItems) {\n\n\t\t\t\t\t\t// save all cart items into wpmDataLayer\n\n\t\t\t\t\t\tif (!cartItems[\"cart\"]) cartItems[\"cart\"] = {}\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(cartItems[\"cart\"])\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(cartItems[\"cart\"]))\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductsFromBackend = function (productIds) {\n\t\t// console.log('getting pids from back-end: ' + productIds)\n\t\t// get productIds from the backend\n\n\t\t// reduce productIds by products already in the dataLayer\n\t\tproductIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item))\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return\n\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_get_product_ids\",\n\t\t\t\tproductIds: productIds,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (products) {\n\n\t\t\t\t\t\t// merge products into wpmDataLayer.products\n\t\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products)\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.saveCartObjectToDataLayer = function (cartObject) {\n\t\twpmDataLayer.cart = cartObject\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)\n\t}\n\n\twpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutOption\", data)\n\t}\n\n\twpm.fireCheckoutProgress = function (step) {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutProgress\", data)\n\t}\n\n\twpm.getPostIdFromString = function (string) {\n\t\t// console.log(string);\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2]\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = function (productId) {\n\n\t\t// productId = null;\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tproductId = getIdBasedOndVariationsOutputSetting(productId)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tjQuery(document).trigger(\"wpmViewItemList\", wpm.getProductDataForViewItemEvent(productId))\n\t}\n\n\twpm.getProductDataForViewItemEvent = function (productId) {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\twpm.getMainProductIdFromProductPage = function () {\n\t\ttry {\n\t\t\tif ([\"simple\", \"variable\", \"grouped\", \"composite\", \"bundle\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery(\".wpmProductId:first\").data(\"id\")\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = function (target) {\n\n\t\tjQuery(target).css({\"position\": \"relative\"})\n\t\tjQuery(target).append(\"<div id=\\\"viewItemListTriggerOverlay\\\"></div>\")\n\t\tjQuery(target).find(\"#viewItemListTriggerOverlay\").css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = function () {\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get(\"s\")\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {}\n\n\twpm.observerCallback = function (entries, observer) {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId\n\n\t\t\t\tlet elementId = jQuery(entry.target).data(\"ioid\")\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next(\".wpmProductId\").length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next(\".wpmProductId\").data(\"id\")\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find(\".wpmProductId\").data(\"id\")\n\t\t\t\t}\n\n\t\t\t\t// productId = null;\n\n\t\t\t\tif (!productId) throw Error(\"wpmProductId element not found\")\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\t\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\t\twpm.triggerViewItemList(productId)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find(\"#viewItemListTriggerOverlay\").remove()\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t})\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io\n\tlet ioid = 0\n\tlet allIoElementsToWatch\n\n\tlet getAllElementsToWatch = function () {\n\n\t\tallIoElementsToWatch = jQuery(\".wpmProductId\")\n\t\t\t.map(function (i, elem) {\n\t\t\t\t// console.log(elem);\n\t\t\t\tif (\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"type-product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).parent().hasClass(\"product-item-inner\")\n\t\t\t\t) {\n\t\t\t\t\t// console.log(elem);\n\t\t\t\t\treturn jQuery(elem).parent()\n\t\t\t\t} else if (\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"wc-block-grid__product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"product-small\") ||\n\t\t\t\t\tjQuery(elem).prev().hasClass(\"woocommerce-LoopProduct-link\")\n\t\t\t\t) {\n\t\t\t\t\treturn jQuery(this).prev()\n\t\t\t\t} else if (jQuery(elem).closest(\".product\").length) {\n\t\t\t\t\treturn jQuery(elem).closest(\".product\")\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\twpm.startIntersectionObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tif (wpm.urlHasParameter(\"vildemomode\")) wpmDataLayer.viewItemListTrigger.testMode = true\n\n\t\t\t// set up intersection observer\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t})\n\n\t\t\tgetAllElementsToWatch()\n\n\t\t\t// console.log(allElementsToWatch);\n\n\t\t\tallIoElementsToWatch.each(function (i, elem) {\n\t\t\t\t// console.log(elem[0]);\n\t\t\t\t// jQuery(elem[0]).attr('data-ioid', ioid++);\n\t\t\t\tjQuery(elem[0]).data(\"ioid\", ioid++)\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery(\".wpmProductId:eq(0)\").parents().has(jQuery(\".wpmProductId:eq(1)\").parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tlet productsMutationObserver = new MutationObserver(function (mutations) {\n\n\t\tmutations.forEach(function (mutation) {\n\t\t\tlet newNodes = mutation.addedNodes // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes) // jQuery set\n\t\t\t\tnodes.each(function () {\n\t\t\t\t\tif (\n\t\t\t\t\t\tjQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(this)) {\n\t\t\t\t\t\t\tjQuery(this).data(\"ioid\", ioid++)\n\t\t\t\t\t\t\tio.observe(this)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n\n\tlet hasWpmProductIdElement = function (elem) {\n\t\treturn !!(jQuery(elem).find(\".wpmProductId\").length ||\n\t\t\tjQuery(elem).siblings(\".wpmProductId\").length)\n\t}\n\n\twpm.setCookie = function (cookieName, cookieValue = \"\", expiryDays = null) {\n\t\tif (expiryDays) {\n\t\t\tlet d = new Date()\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))\n\t\t\tlet expires = \"expires=\" + d.toUTCString()\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\"\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\"\n\t\t}\n\t}\n\n\twpm.getCookie = function (cookieName) {\n\t\tlet name = cookieName + \"=\"\n\t\tlet decodedCookie = decodeURIComponent(document.cookie)\n\t\tlet ca = decodedCookie.split(\";\")\n\t\tfor (let i = 0; i < ca.length; i++) {\n\t\t\tlet c = ca[i]\n\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\tc = c.substring(1)\n\t\t\t}\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length)\n\t\t\t}\n\t\t}\n\t\treturn \"\"\n\t}\n\n\twpm.getWpmSessionData = function () {\n\t\tif (window.sessionStorage) {\n\n\t\t\tlet data = window.sessionStorage.getItem(\"_wpm\")\n\t\t\tif (data !== null) {\n\t\t\t\treturn JSON.parse(data)\n\t\t\t} else {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} else {\n\t\t\treturn {}\n\t\t}\n\t}\n\n\twpm.setWpmSessionData = function (data) {\n\t\tif (window.sessionStorage) {\n\t\t\twindow.sessionStorage.setItem(\"_wpm\", JSON.stringify(data))\n\t\t}\n\t}\n\n\twpm.storeOrderIdOnServer = function (orderId) {\n\n\t\t// console.log('saving wpm_purchase_pixels_fired');\n\n\t\t// console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);\n\t\t// console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);\n\t\t// console.log('url: ' + wpm.ajax_url);\n\t\t// console.log('nonce: ' + wpm.nonce);\n\n\t\ttry {\n\t\t\t// save the state in the database\n\t\t\tlet data = {\n\t\t\t\taction : \"wpm_purchase_pixels_fired\",\n\t\t\t\torder_id: orderId,\n\t\t\t\t// nonce : ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t}\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\tif (response.success === false) {\n\t\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response)\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = function (url) {\n\t\tlet searchParams = new URLSearchParams(url.search)\n\t\tlet cartItemKey = searchParams.get(\"remove_item\")\n\n\t\tlet productId\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"product_id\"]\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"]\n\t\t}\n\n\t\treturn productId\n\t}\n\n\twpm.getAddToCartLinkProductIds = function () {\n\t\treturn jQuery(\"a\").map(function () {\n\t\t\tlet href = jQuery(this).attr(\"href\")\n\n\t\t\tif (href && href.includes(\"?add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\tif (matches) return matches[2]\n\t\t\t}\n\t\t}).get()\n\t}\n\n\twpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {\n\n\t\t// console.log(wpmDataLayer.products[productId].dyn_r_ids)\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t}\n\n\t\tif (product.isVariation) product[\"parentId_dyn_r_ids\"] = wpmDataLayer.products[productId].parentId_dyn_r_ids\n\n\t\treturn product\n\t}\n\n\twpm.setReferrerToCookie = function () {\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\t\t\twpm.setCookie(\"wpmReferrer\", document.referrer)\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = function () {\n\t\tif (wpm.getCookie(\"wpmReferrer\")) {\n\t\t\treturn wpm.getCookie(\"wpmReferrer\")\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = function (clidId = \"gclid\") {\n\n\t\tlet clidCookieId\n\n\t\tclidCookieId = {\n\t\t\tgclid: \"_gcl_aw\",\n\t\t\tdclid: \"_gcl_dc\",\n\t\t}\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId])\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/)\n\t\t\treturn matches[2]\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\twpm.getUserAgent = function () {\n\t\treturn navigator.userAgent\n\t}\n\n\twpm.getViewPort = function () {\n\t\treturn {\n\t\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t\t}\n\t}\n\n\t/*\n\t* Handle Cookie Management Platforms\n\t* */\n\n\tlet getComplianzCookies = function () {\n\n\t\tlet cmplz_statistics = wpm.getCookie(\"cmplz_statistics\")\n\t\tlet cmplz_marketing = wpm.getCookie(\"cmplz_marketing\")\n\t\tlet cmplz_consent_status = wpm.getCookie(\"cmplz_consent_status\") || wpm.getCookie(\"cmplz_banner-status\")\n\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === \"allow\",\n\t\t\t\tads : cmplz_marketing === \"allow\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tlet getCookieLawInfoCookies = function () {\n\n\t\tlet analyticsCookie = wpm.getCookie(\"cookielawinfo-checkbox-analytics\") || wpm.getCookie(\"cookielawinfo-checkbox-analytiques\")\n\t\tlet adsCookie = wpm.getCookie(\"cookielawinfo-checkbox-advertisement\") || wpm.getCookie(\"cookielawinfo-checkbox-publicite\")\n\t\tlet visitorHasChosen = wpm.getCookie(\"CookieLawInfoConsent\")\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === \"yes\",\n\t\t\t\tads : adsCookie === \"yes\",\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = \"category\"\n\twpmConsentValues.visitorHasChosen = false\n\n\twpm.getConsentValues = function () {\n\t\treturn wpmConsentValues\n\t}\n\n\twpm.setConsentValueCategories = function (analytics = false, ads = false) {\n\t\twpmConsentValues.categories.analytics = analytics\n\t\twpmConsentValues.categories.ads = ads\n\t}\n\n\twpm.updateConsentCookieValues = function (explicitConsent = false) {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\t// console.log('exp cons: ' + explicitConsent)\n\n\t\tlet cookie\n\n\t\tif (cookie = wpm.getCookie(\"CookieConsent\")) {\n\t\t\t// Cookiebot\n\t\t\t// https://wordpress.org/plugins/cookiebot/\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\t// console.log(cookie.indexOf('statistics:true'))\n\t\t\t// console.log(cookie.indexOf('marketing:true'))\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf(\"statistics:true\") >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf(\"marketing:true\") >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"CookieScriptConsent\")) {\n\t\t\t// Cookie Script\n\t\t\t// https://wordpress.org/plugins/cookie-script-com/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// console.log(cookie)\n\t\t\t// console.log(cookie.action)\n\t\t\t// console.log('cat length: ' + cookie.categories.length)\n\t\t\t// console.log(cookie.categories.indexOf('performance'))\n\n\t\t\tif (cookie.action === \"reject\") {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (cookie.categories.length === 2) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf(\"performance\") >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf(\"targeting\") >= 0\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"borlabs-cookie\")) {\n\t\t\t// Borlabs Cookie\n\t\t\t// https://borlabs.io/borlabs-cookie/\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = \"pixel\"\n\n\t\t} else if (cookie = getComplianzCookies()) {\n\t\t\t// Complianz Cookie\n\t\t\t// https://wordpress.org/plugins/complianz-gdpr/\n\n\t\t\t// console.log(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie(\"cookie_notice_accepted\")) {\n\t\t\t// Cookie Compliance (free version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie(\"hu-consent\")) {\n\t\t\t// Cookie Compliance (pro version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories[\"3\"]\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories[\"4\"]\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = getCookieLawInfoCookies()) {\n\t\t\t// CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t\t// https://wordpress.org/plugins/cookie-law-info/\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t} else if (cookie = wpm.getCookie(\"moove_gdpr_popup\")) {\n\t\t\t// GDPR Cookie Compliance Plugin by Moove Agency\n\t\t\t// https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t\t// TODO write documentation on how to set up the plugin in order for this to work properly\n\n\t\t\tcookie = JSON.parse(cookie)\n\t\t\t// console.log('moove cookie thirdparty: ' + cookie.thirdparty)\n\t\t\t// console.log('moove cookie advanced: ' + cookie.advanced)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === \"1\"\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else {\n\t\t\t// consentValues.categories.analytics = true\n\t\t\t// consentValues.categories.ads = true\n\n\t\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\t\twpmConsentValues.categories.ads = !explicitConsent\n\t\t}\n\t}\n\n\twpm.updateConsentCookieValues()\n\n\twpm.setConsentDefaultValuesToExplicit = function () {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\twpm.canIFire = function (category, pixelName) {\n\n\t\tlet canIFireMode\n\n\t\tif (\"category\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = !!wpmConsentValues.categories[category]\n\t\t} else if (\"pixel\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(pixelName)\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid consent mode in wpmConsentValues\")\n\t\t\tcanIFireMode = false\n\t\t}\n\n\t\tif (canIFireMode) {\n\t\t\treturn true\n\t\t} else {\n\t\t\tif (true || wpm.urlHasParameter(\"debugConsentMode\")) {\n\t\t\t\twpm.logPreventedPixelLoading(pixelName, category)\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.logPreventedPixelLoading = function (pixelName, category) {\n\t\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have not given consent for it yet. (WPM is in explicit consent mode.)\")\n\t\t} else {\n\t\t\tconsole.log(\"WooCommerce Pixel Manager: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have removed consent for this pixel. (WPM is in implicit consent mode.)\")\n\t\t}\n\t}\n\n\t/**\n\t * Runs through each script in <head> and blocks / unblocks it according to the plugin settings\n\t * and user consent.\n\t */\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data(\"wpm-cookie-category\")) {\n\n\t\t\t\t\t\t// console.log(node)\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})\n\twindow.addEventListener(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\n\twpm.shouldScriptBeActive = function (node) {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === \"category\" && $(node).data(\"wpm-cookie-category\").split(\",\").some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && $(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data(\"wpm-pixel-name\") === \"google\") {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data(\"wpm-src\")\n\t\tif (wpmSrc) $(scriptNode).attr(\"src\", wpmSrc)\n\n\t\tscriptNode.type = \"text/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.blockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr(\"src\")) $(scriptNode).removeAttr(\"src\")\n\t\tscriptNode.type = \"blocked/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\t}\n\n\twpm.unblockAllScripts = function (analytics = true, ads = true) {\n\t\t// console.log('unblocking all scripts')\n\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, scriptNode) {\n\n\t\t\t\tif ($(scriptNode).data(\"wpm-cookie-category\").includes(\"analytics\") && analytics) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t} else if ($(scriptNode).data(\"wpm-cookie-category\").includes(\"ads\") && ads) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\twpm.unblockSelectedPixels = function () {\n\t\t$.each(\n\t\t\t$(\"script[type=\\\"blocked/javascript\\\"]\"), function (index, node) {\n\n\t\t\t\tif (wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t} else if ($(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t}\n\t\t\t})\n\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t}\n\n\n\t/**\n\t * Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t * by the visitor.\n\t */\n\n\t// Borlabs Cookie\n\t// If visitor accepts cookies in Borlabs Cookie unblock the scripts\n\twindow.addEventListener(\"borlabs-cookie-consent-saved\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\tif (wpmConsentValues.mode === \"pixel\") {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes(\"google-analytics\"), wpmConsentValues.pixels.includes(\"google-ads\"))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t})\n\n\t// Cookiebot\n\t// If visitor accepts cookies in Cookiebot unblock the scripts\n\t// https://www.cookiebot.com/en/developer/\n\twindow.addEventListener(\"CookiebotOnAccept\", function () {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false)\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/article/20-custom-events\n\t */\n\twindow.addEventListener(\"CookieScriptAccept\", function (e) {\n\t\tif (e.detail.categories.includes(\"performance\")) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes(\"targeting\")) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/\n\t */\n\twindow.addEventListener(\"CookieScriptAcceptAll\", function () {\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t// Complianz Cookie\n\t// If visitor accepts cookies in Complianz unblock the scripts\n\tdocument.addEventListener(\"cmplzStatusChange\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\tdocument.addEventListener(\"setCookieNotice\", function () {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Compliance by hu-manity.co (free and pro)\n\t * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t * Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t * we have to solve this by using a mutation observer.\n\t *\n\t * @type {MutationObserver}\n\t */\n\n\twpm.huObserver = new MutationObserver(function (mutations) {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === \"hu\") {\n\n\t\t\t\t\t\tjQuery(\".hu-cookies-save\").on(\"click\", function () {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues()\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t}\n\n\twpm.version = function () {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t// https://api.jquery.com/jquery.getscript/\n\twpm.loadScriptAndCacheIt = function (url, options) {\n\n\t\t// Allow user to set any option except for dataType, cache, and url\n\t\toptions = jQuery.extend(options || {}, {\n\t\t\tdataType: \"script\",\n\t\t\tcache : true,\n\t\t\turl : url,\n\t\t})\n\n\t\t// Use $.ajax() since it is more flexible than $.getScript\n\t\t// Return the jqXHR object so we can chain callbacks\n\t\treturn jQuery.ajax(options)\n\t}\n\n\twpm.getOrderItemPrice = function (orderItem) {\n\t\treturn (orderItem.total + orderItem.total_tax) / orderItem.quantity\n\t}\n\n\twpm.hasLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\treturn data?.loginEventFired\n\t}\n\n\twpm.setLoginEventFired = function () {\n\t\tlet data = wpm.getWpmSessionData()\n\t\tdata[\"loginEventFired\"] = true\n\t\twpm.setWpmSessionData(data)\n\t}\n\n\twpm.wpmDataLayerExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (typeof wpmDataLayer !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.jQueryExists = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForjQuery() {\n\t\t\t\tif (typeof jQuery !== \"undefined\") return resolve()\n\t\t\t\tsetTimeout(waitForjQuery, 100)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageLoaded = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.pageReady = function () {\n\t\treturn new Promise(function (resolve) {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"interactive\" === document.readyState || \"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.isMiniCartActive = function () {\n\t\tif (window.sessionStorage) {\n\t\t\tfor (const [key, value] of Object.entries(window.sessionStorage)) {\n\t\t\t\tif (key.includes(\"wc_fragments\")) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.doesWooCommerceCartExist = function () {\n\t\treturn document.cookie.includes(\"woocommerce_items_in_cart\")\n\t}\n\n\twpm.urlHasParameter = function (parameter) {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.has(parameter)\n\t}\n\n\t// wpm['load'] = {\n\t// base: true\n\t// };\n\n\twindow[\"wpmLoaded\"] = {}\n\n\t// return {\n\t// writeOrderIdToStorage : writeOrderIdToStorage,\n\t// isOrderIdStored : isOrderIdStored,\n\t// isEmail : isEmail,\n\t// removeProductFromCart : removeProductFromCart,\n\t// getViewItemProducts : getViewItemProducts,\n\t// addProductToCart : addProductToCart,\n\t// getCartItemsFromBackEnd: getCartItemsFromBackEnd,\n\t// fireCheckoutOption : fireCheckoutOption,\n\t// getCartItems : getCartItems\n\t// }\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load all WPM functions\n *\n * Ignore event listeners. They need to be loaded after\n * we made sure that jQuery has been loaded.\n */\n\nrequire(\"./functions\")\n\n// #if process.env.TIER === 'premium'\n// require(\"./functions_premium\")\n// #endif\n","/**\n * After wpm is loaded\n * we first check if wpmDataLayer is loaded,\n * and as soon as it is, we load the pixels,\n * and as soon as the page load is complete,\n * we fire the wpmLoad event.\n *\n * @param {{pro:bool}} wpmDataLayer.version\n *\n * https://stackoverflow.com/a/25868457/4688612\n * https://stackoverflow.com/a/44093516/4688612\n */\n\nwpm.wpmDataLayerExists()\n\t.then(function () {\n\t\tconsole.log(\"WooCommerce Pixel Manager: \" + (wpmDataLayer.version.pro ? \"Pro\" : \"Free\") +\" Version \" + wpmDataLayer.version.number + \" loaded\")\n\t\tjQuery(document).trigger(\"wpmPreLoadPixels\", {})\n\t})\n\t.then(function () {\n\t\twpm.pageLoaded().then(function () {\n\t\t\tjQuery(document).trigger(\"wpmLoad\", {})\n\t\t})\n\t})\n\n\n\n/**\n * Run when page is ready\n *\n */\n\nwpm.pageReady().then(function () {\n\n\t/**\n\t * Run as soon as wpm namespace is loaded\n\t */\n\n\twpm.wpmDataLayerExists()\n\t\t.then(function () {\n\t\t\t// watch for products visible in viewport\n\t\t\twpm.startIntersectionObserverToWatch()\n\n\t\t\t// watch for lazy loaded products\n\t\t\twpm.startProductsMutationObserverToWatch()\n\t\t})\n})\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Load all essential scripts first\n */\n\nrequire(\"./wpm/functions_loader\")\n\n// Only load the event listeners after jQuery has been loaded for sure\nwpm.jQueryExists().then(function () {\n\n\trequire(\"./wpm/event_listeners\")\n\n\trequire(\"./google/loader\")\n\trequire(\"./facebook/loader\")\n\trequire(\"./hotjar/loader\")\n\n\n\t/**\n\t * Load all premium scripts\n\t */\n\n\t// #if process.env.TIER === 'premium'\n// \trequire(\"./microsoft-ads/loader\")\n// \trequire(\"./pinterest/loader\")\n// \trequire(\"./snapchat/loader\")\n// \trequire(\"./tiktok/loader\")\n// \trequire(\"./twitter/loader\")\n\t// #endif\n\n\n\t/**\n\t * Initiate WPM.\n\t *\n\t * It makes sure that the script flow gets executed correctly,\n\t * no matter how JS \"optimizers\" shuffle the code.\n\t */\n\n\trequire(\"./wpm/init\")\n})\n\n"],"names":["jQuery","document","on","wpmDataLayer","pixels","facebook","pixel_id","loaded","wpm","canIFire","loadFacebookPixel","event","product","eventId","getRandomEventId","fbq","content_type","content_name","name","content_ids","dyn_r_ids","dynamic_remarketing","id_type","value","parseFloat","quantity","price","currency","eventID","shop","trigger","event_name","event_id","user_data","getFbUserData","product_data","product_id","event_source_url","window","location","href","e","console","error","fbViewContent","setFbUserData","order","value_filtered","facebookContentIds","id","$","undefined","fBUserData","f","b","n","callMethod","apply","arguments","queue","push","_fbq","version","t","createElement","async","src","s","getElementsByTagName","parentNode","insertBefore","Math","random","toString","substring","getFbUserDataFromBrowser","fbp","getCookie","fbc","client_user_agent","navigator","userAgent","prodIds","key","item","Object","entries","items","general","variationsOutput","variation_id","String","products","require","isEmptyObject","google","ads","conversionIds","status","googleConfigConditionsMet","isVariable","send_events_with_parent_ids","gtagLoaded","then","gtag","send_to","getGoogleAdsConversionIdentifiers","google_business_vertical","getGoogleAdsDynamicRemarketingOrderItems","data_basic","data_with_cart","getGoogleAdsConversionIdentifiersWithLabel","transaction_id","number","new_customer","aw_merchant_id","discount","aw_feed_country","aw_feed_language","getGoogleAdsRegularOrderItems","conversionIdentifiers","orderItems","orderItem","analytics","universal","property_id","mp_active","affiliation","value_regular","tax","shipping","coupon","getGAUAOrderItems","list_position","category","join","variant","variant_name","brand","ga4","measurement_id","getGA4OrderItems","item_name","item_category","item_id","item_variant","item_brand","state","canGoogleLoad","loadGoogle","logPreventedPixelLoading","type","consent_mode","active","getConsentValues","mode","categories","includes","getVisitorConsentStatusAndUpdateGoogleConsentSettings","google_consent_settings","analytics_storage","ad_storage","updateGoogleConsentMode","cookie_consent_mgmt","explicit_consent","fireGtagGoogleAds","enhanced_conversions","phone_conversion_label","phone_conversion_number","keys","page_type","enhanced_conversion_data","fireGtagGoogleAnalyticsUA","parameters","fireGtagGoogleAnalyticsGA4","isGoogleActive","getGoogleGtagId","loadScriptAndCacheIt","done","script","textStatus","dataLayer","wait_for_update","region","ads_data_redaction","url_passthrough","linker","settings","Date","Promise","resolve","reject","startTime","wait","setTimeout","optimize","container_id","load_google_optimize_pixel","hotjar","site_id","load_hotjar_pixel","h","o","hj","q","_hjSettings","hjid","hjsv","a","r","appendChild","url","URL","this","attr","productId","getProductIdByCartItemKeyUrl","removeProductFromCart","data","addProductToCart","product_type","Number","val","each","find","classes","getPostIdFromString","one","target","closest","matches","match","nextAll","getIdBasedOndVariationsOutputSetting","Error","getProductDetailsFormattedForEvent","isEmail","fireCheckoutProgress","emailSelected","paymentMethodSelected","fireCheckoutOption","cart","getCartItemsFromBackend","variation","doesWooCommerceCartExist","getCartItems","productIds","getAddToCartLinkProductIds","getProductsFromBackend","referrer","referrerHostname","hostname","host","setCookie","wpmLoadFired","getMainProductIdFromProductPage","getProductDataForViewItemEvent","isOrderIdStored","writeOrderIdToStorage","user","hasLoginEventFired","setLoginEventFired","updateConsentCookieValues","wpmDeduper","wpmRestSettings","checkCookie","useRestEndpoint","isSessionStorageAvailable","isRestEndpointAvailable","isBelowRestErrorThreshold","sessionStorage","getItem","JSON","parse","testEndpoint","protocol","cookieName","ajax","timeout","statusCode","response","setItem","stringify","isWpmRestEndpointAvailable","orderId","Storage","localStorage","ids","expiresDate","setDate","getDate","cookie","toUTCString","storeOrderIdOnServer","orderDeduplication","log","email","test","quantityToRemove","isVariation","parentId","saveCartObjectToDataLayer","action","dataType","ajax_url","success","cartItems","filter","hasOwnProperty","length","assign","cartObject","step","checkout_option","string","triggerViewItemList","indexOf","viewItemListTriggerTestMode","css","append","viewItemListTrigger","opacity","backgroundColor","getSearchTermFromUrl","URLSearchParams","search","get","io","ioTimeouts","observerCallback","observer","forEach","entry","elementId","next","isIntersecting","testMode","repeat","unobserve","clearTimeout","remove","allIoElementsToWatch","ioid","startIntersectionObserverToWatch","urlHasParameter","IntersectionObserver","threshold","map","i","elem","parent","hasClass","prev","observe","startProductsMutationObserverToWatch","productsNode","parents","has","first","productsMutationObserver","attributes","childList","characterData","MutationObserver","mutations","mutation","newNodes","addedNodes","hasWpmProductIdElement","siblings","cookieValue","expiryDays","d","setTime","getTime","expires","ca","decodeURIComponent","split","c","charAt","getWpmSessionData","setWpmSessionData","order_id","nonce","cartItemKey","cartItemKeys","list_name","position","parentId_dyn_r_ids","setReferrerToCookie","getReferrerFromCookie","getClidFromBrowser","clidCookieId","clidId","gclid","dclid","getUserAgent","getViewPort","width","max","documentElement","clientWidth","innerWidth","height","clientHeight","innerHeight","getComplianzCookies","cmplz_statistics","cmplz_marketing","visitorHasChosen","getCookieLawInfoCookies","analyticsCookie","adsCookie","wpmConsentValues","setConsentValueCategories","explicitConsent","decodeURI","consents","statistics","marketing","thirdparty","advanced","setConsentDefaultValuesToExplicit","pixelName","canIFireMode","scriptTagObserver","node","shouldScriptBeActive","unblockScript","blockScript","head","subtree","addEventListener","disconnect","some","element","scriptNode","removeAttach","wpmSrc","appendTo","removeAttr","unblockAllScripts","index","unblockSelectedPixels","Cookiebot","consent","detail","huObserver","hu","body","options","extend","cache","getOrderItemPrice","total","total_tax","loginEventFired","wpmDataLayerExists","waitForVar","jQueryExists","waitForjQuery","pageLoaded","readyState","pageReady","isMiniCartActive","parameter","pro","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-public.p1.min.js","mappings":"uBAAC,SAAUA,EAAKC,EAAGC,GAElB,IAAIC,EAEJH,EAAII,iBAAmB,WACtB,OAAQC,KAAKC,SAAW,GAAGC,SAAS,IAAIC,UAAU,IAGnDR,EAAIS,cAAgB,WASnB,OAAIN,GAGIH,EAAIU,4BAIbV,EAAIW,cAAgB,WACnBR,EAAaH,EAAIU,4BAGlBV,EAAIU,yBAA2B,WAC9B,MAAO,CACN,IAAqBV,EAAIY,UAAU,QACnC,IAAqBZ,EAAIY,UAAU,QACnC,kBAAqBC,UAAUC,YAIjCd,EAAIe,cAAgB,SAAUC,GAE7B,IAAKC,OAAOC,IAAK,OAEjB,IAAIC,EAAUnB,EAAII,mBAElBc,IAAI,QAAS,cAAe,CAC3B,aAAgB,UAChB,aAAgBF,EAAQI,KAExB,YAAeJ,EAAQK,UAAUC,aAAaC,OAAOC,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SAASgD,KACxCjF,IAAI8M,UAAU,cAAeoH,GAE7BlU,IAAI8M,UAAU,cAAe,SAI9B9M,IAAI8M,UAAU,cAAe,SC7tD5BsH,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBpU,IAAjBqU,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,IAOV,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,QCpBfH,EAAoBM,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAJ,EAAoBpH,EAAE2H,EAAQ,CAAEE,EAAGF,IAC5BA,GCLRP,EAAoBpH,EAAI,CAACuH,EAASO,KACjC,IAAI,IAAIhR,KAAOgR,EACXV,EAAoBW,EAAED,EAAYhR,KAASsQ,EAAoBW,EAAER,EAASzQ,IAC5EC,OAAOiR,eAAeT,EAASzQ,EAAK,CAAEmR,YAAY,EAAMnL,IAAKgL,EAAWhR,MCJ3EsQ,EAAoBW,EAAI,CAACG,EAAKC,IAAUpR,OAAOqR,UAAUhN,eAAeiN,KAAKH,EAAKC,G","sources":["webpack://wgact/./src/js/public/facebook.jsx","webpack://wgact/./src/js/public/google-ads.jsx","webpack://wgact/./src/js/public/wpm.jsx","webpack://wgact/webpack/bootstrap","webpack://wgact/webpack/runtime/compat get default export","webpack://wgact/webpack/runtime/define property getters","webpack://wgact/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["(function (wpm, $, undefined) {\n\n\tlet fBUserData;\n\n\twpm.getRandomEventId = function () {\n\t\treturn (Math.random() + 1).toString(36).substring(2);\n\t}\n\n\twpm.getFbUserData = function () {\n\t\t// We need the first one for InitiateCheckout\n\t\t// where getting the user_data from the browser is too slow\n\t\t// using wpm.getCookie(), so we cache the user_data earlier.\n\t\t// And we need the second one because the ViewContent hit happens too fast\n\t\t// after adding a variation to the cart because the function to cache\n\t\t// the user_data is too slow. But we can get the user_data using wpm.getCookie()\n\t\t// because we don't move away from the page and can wait for the browser\n\t\t// to get it.\n\t\tif (fBUserData) {\n\t\t\treturn fBUserData;\n\t\t} else {\n\t\t\treturn wpm.getFbUserDataFromBrowser();\n\t\t}\n\t}\n\n\twpm.setFbUserData = function () {\n\t\tfBUserData = wpm.getFbUserDataFromBrowser();\n\t}\n\n\twpm.getFbUserDataFromBrowser = function () {\n\t\treturn {\n\t\t\t\"fbp\" : wpm.getCookie('_fbp'),\n\t\t\t\"fbc\" : wpm.getCookie('_fbc'),\n\t\t\t\"client_user_agent\": navigator.userAgent\n\t\t}\n\t}\n\n\twpm.fbViewContent = function (product) {\n\n\t\tif (!window.fbq) return;\n\n\t\tlet eventId = wpm.getRandomEventId();\n\n\t\tfbq(\"track\", \"ViewContent\", {\n\t\t\t\"content_type\": \"product\",\n\t\t\t\"content_name\": product.name,\n\t\t\t// \"content_category\": product.category,\n\t\t\t\"content_ids\": product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\"currency\" : wpmDataLayer.shop.currency,\n\t\t\t\"value\" : product.price,\n\t\t}, {\n\t\t\t\"eventID\": eventId,\n\t\t});\n\n\t\tproduct['currency'] = wpmDataLayer.shop.currency;\n\n\t\tjQuery(document).trigger('wpmFbCapiEvent', {\n\t\t\t\"event_name\" : \"ViewContent\",\n\t\t\t\"event_id\" : eventId,\n\t\t\t\"user_data\" : wpm.getFbUserData(),\n\t\t\t\"product_data\" : product,\n\t\t\t\"product_id\" : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\"event_source_url\": window.location.href\n\t\t});\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\njQuery(function () {\n\n\tif (wpmDataLayer?.pixels?.facebook) {\n\n\t\t// AddToCart event\n\t\tjQuery(document).on('wpmAddToCart', function (event, product) {\n\n\t\t\t// console.log('firing facebook ads AddToCart event');\n\t\t\t// console.log(product);\n\t\t\t// console.log('value: ' + product.quantity * product.price);\n\n\t\t\tif (!window.fbq) return;\n\n\t\t\tlet eventId = wpm.getRandomEventId();\n\n\t\t\t// console.log('eventId: ' + eventId);\n\n\t\t\tfbq(\"track\", \"AddToCart\", {\n\t\t\t\t\"content_type\": \"product\",\n\t\t\t\t\"content_name\": product.name,\n\t\t\t\t\"content_ids\" : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\t\"value\" : parseFloat(product.quantity * product.price),\n\t\t\t\t\"currency\" : product.currency,\n\t\t\t}, {\n\t\t\t\t\"eventID\": eventId,\n\t\t\t});\n\n\t\t\tproduct['currency'] = wpmDataLayer.shop.currency;\n\n\t\t\tjQuery(document).trigger('wpmFbCapiEvent', {\n\t\t\t\t\"event_name\" : \"AddToCart\",\n\t\t\t\t\"event_id\" : eventId,\n\t\t\t\t\"user_data\" : wpm.getFbUserData(),\n\t\t\t\t\"product_data\" : product,\n\t\t\t\t\"product_id\" : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\t\"event_source_url\": window.location.href\n\t\t\t});\n\t\t});\n\n\t\t// InitiateCheckout event\n\t\tjQuery(document).on('wpmBeginCheckout', function (event) {\n\n\t\t\t// console.log('firing facebook ads InitiateCheckout event');\n\n\t\t\tif (!window.fbq) return;\n\n\t\t\tlet eventId = wpm.getRandomEventId();\n\n\t\t\tfbq(\"track\", \"InitiateCheckout\", {}, {\n\t\t\t\t\"eventID\": eventId,\n\t\t\t});\n\n\n\t\t\tjQuery(document).trigger('wpmFbCapiEvent', {\n\t\t\t\t\"event_name\" : \"InitiateCheckout\",\n\t\t\t\t\"event_id\" : eventId,\n\t\t\t\t\"user_data\" : wpm.getFbUserData(),\n\t\t\t\t\"event_source_url\": window.location.href\n\t\t\t});\n\t\t});\n\n\t\t// AddToWishlist event\n\t\tjQuery(document).on('wpmAddToWishlist', function (event, product) {\n\n\t\t\t// console.log('firing facebook ads AddToWishlist event');\n\t\t\t// console.log(product);\n\n\t\t\tif (!window.fbq) return;\n\n\t\t\tlet eventId = wpm.getRandomEventId();\n\n\t\t\tfbq(\"track\", \"AddToWishlist\", {\n\t\t\t\t\"content_type\": \"product\",\n\t\t\t\t\"content_name\": product.name,\n\t\t\t\t\"content_ids\" : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\t\"value\" : parseFloat(product.quantity * product.price),\n\t\t\t\t\"currency\" : product.currency,\n\t\t\t}, {\n\t\t\t\t\"eventID\": eventId,\n\t\t\t});\n\n\t\t\tproduct['currency'] = wpmDataLayer.shop.currency;\n\n\t\t\tjQuery(document).trigger('wpmFbCapiEvent', {\n\t\t\t\t\"event_name\" : \"AddToWishlist\",\n\t\t\t\t\"event_id\" : eventId,\n\t\t\t\t\"user_data\" : wpm.getFbUserData(),\n\t\t\t\t\"product_data\" : product,\n\t\t\t\t\"product_id\" : product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t\t\"event_source_url\": window.location.href\n\t\t\t});\n\t\t});\n\n\t\t// ViewContent event\n\t\tjQuery(document).on('wpmViewItem', function (event, product) {\n\n\t\t\t// console.log('firing facebook ads ViewContent event');\n\t\t\t// console.log(product);\n\n\t\t\tif (!window.fbq) return;\n\n\t\t\twpm.fbViewContent(product);\n\t\t});\n\t}\n})\n\njQuery(window).on('load', function () {\n\n\tif (wpmDataLayer?.pixels?.facebook) {\n\n\t\twpm.setFbUserData();\n\n\t\twpmExists().then(function () {\n\n\t\t\ttry {\n\t\t\t\tif (wpmDataLayer.shop.page_type === 'product' && wpmDataLayer.shop.product_type !== 'variable' && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());\n\n\t\t\t\t\t// console.log('fbq ViewContent');\n\t\t\t\t\t// console.log(product);\n\n\t\t\t\t\twpm.fbViewContent(product);\n\n\t\t\t\t} else if (wpmDataLayer.shop.page_type === 'search') {\n\n\t\t\t\t\tif (!window.fbq) return;\n\n\t\t\t\t\tlet eventId = wpm.getRandomEventId();\n\n\t\t\t\t\tfbq(\"track\", \"Search\", {}, {\n\t\t\t\t\t\t\"eventID\": eventId,\n\t\t\t\t\t});\n\n\t\t\t\t\tjQuery(document).trigger('wpmFbCapiEvent', {\n\t\t\t\t\t\t\"event_name\" : \"Search\",\n\t\t\t\t\t\t\"event_id\" : eventId,\n\t\t\t\t\t\t\"user_data\" : wpm.getFbUserData(),\n\t\t\t\t\t\t\"event_source_url\": window.location.href\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t}\n\t\t})\n\t}\n})\n","jQuery(function () {\n\n\tif (wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) {\n\n\t\t// view_item_list event\n\t\tjQuery(document).on('wpmViewItemList', function (event, product) {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer.general.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return;\n\n\t\t\t// try to prevent that WC sends cached hits to Google\n\t\t\tif (!product) return;\n\n\t\t\t// console.log('firing google view_item_list event');\n\t\t\t// console.log(product);\n\n\t\t\t// console.log('send to: ' + wpmDataLayer.pixels.google.ads.conversionIds);\n\n\t\t\tif (googleConfigConditionsMet('ads')) gtag('event', 'view_item_list', {\n\t\t\t\tsend_to: wpmDataLayer.pixels.google.ads.conversionIds,\n\t\t\t\titems : [{\n\t\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t\t}]\n\t\t\t});\n\t\t});\n\n\t\t// add_to_cart event\n\t\tjQuery(document).on('wpmAddToCart', function (event, product) {\n\n\t\t\t// console.log('firing google ads add_to_cart event');\n\t\t\t// console.log(product);\n\t\t\t// console.log(wpmDataLayer.pixels.google.ads.conversionIds);\n\t\t\t// console.log('dyn_r_id: ' + product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]);\n\t\t\t// console.log('dyn_r_id: ' + product.dyn_r_ids['gpf']);\n\n\t\t\tgtag(\"event\", \"add_to_cart\", {\n\t\t\t\t\"send_to\": wpmDataLayer.pixels.google.ads.conversionIds,\n\t\t\t\t\"value\" : product.quantity * product.price,\n\t\t\t\t\"items\" : [{\n\t\t\t\t\t\"id\" : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\t\"quantity\" : product.quantity,\n\t\t\t\t\t\"price\" : product.price,\n\t\t\t\t\t\"google_business_vertical\": wpmDataLayer.pixels.google.ads.google_business_vertical\n\t\t\t\t}]\n\t\t\t});\n\t\t});\n\n\t\t// view_item event\n\t\tjQuery(document).on('wpmViewItem', function (event, product) {\n\n\t\t\t// console.log('firing google ads view_item event');\n\t\t\t// console.log(product);\n\t\t\t// console.log(wpmDataLayer.pixels.google.ads.conversionIds);\n\t\t\t// console.log('dyn_r_id: ' + product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type]);\n\t\t\t// console.log('dyn_r_id: ' + product.dyn_r_ids['gpf']);\n\n\t\t\tgtag(\"event\", \"view_item\", {\n\t\t\t\t\"send_to\": wpmDataLayer.pixels.google.ads.conversionIds,\n\t\t\t\t\"value\" : product.quantity * product.price,\n\t\t\t\t\"items\" : [{\n\t\t\t\t\t\"id\" : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\t\"quantity\" : 1,\n\t\t\t\t\t\"price\" : product.price,\n\t\t\t\t\t\"google_business_vertical\": wpmDataLayer.pixels.google.ads.google_business_vertical\n\t\t\t\t}]\n\t\t\t});\n\t\t});\n\t}\n})\n\njQuery(window).on('load', function () {\n\n\twpmExists().then(function () {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.shop.page_type === 'product' && wpmDataLayer.shop.product_type !== 'variable' && wpm.getMainProductIdFromProductPage()) {\n\n\t\t\t\t// console.log('productId: ' + wpm.getMainProductIdFromProductPage());\n\n\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage());\n\n\t\t\t\tgtag(\"event\", \"view_item\", {\n\t\t\t\t\t\"send_to\": wpmDataLayer.pixels.google.ads.conversionIds,\n\t\t\t\t\t\"value\" : 1 * product.price,\n\t\t\t\t\t\"items\" : [{\n\t\t\t\t\t\t\"id\" : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\t\t\"google_business_vertical\": wpmDataLayer.pixels.google.ads.google_business_vertical\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else if (wpmDataLayer.shop.page_type === 'search') {\n\n\t\t\t\tlet products = [];\n\n\t\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n\n\t\t\t\t\tif (\n\t\t\t\t\t\twpmDataLayer.general.variationsOutput &&\n\t\t\t\t\t\tproduct.isVariable &&\n\t\t\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t\t\t) return;\n\n\t\t\t\t\tproducts.push({\n\t\t\t\t\t\t\"id\" : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\t\t\t\"google_business_vertical\": wpmDataLayer.pixels.google.ads.google_business_vertical\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// console.log(products);\n\n\t\t\t\tgtag(\"event\", \"view_search_results\", {\n\t\t\t\t\t\"send_to\": wpmDataLayer.pixels.google.ads.conversionIds,\n\t\t\t\t\t// \"value\" : 1 * product.price,\n\t\t\t\t\t\"items\": products\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t})\n})\n","// if (typeof varExists !== 'function') {\n// window.varExists = function (varName) {\n// return new Promise(function (resolve, reject) {\n// (function waitForVar() {\n// if (typeof window[varName] !== 'undefined') return resolve();\n// setTimeout(waitForVar, 30);\n// })();\n// });\n// }\n// }\n\n// Promise.allSettled(\n// [\n// varExists('jQuery'),\n// varExists('wpm')\n// ]).then(function () {\n// // do something\n//\n// }).catch(function (e) {\n// console.log(e);\n// })\n\n\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : '_wpm_order_ids',\n\t\tcookieExpiresDays: 365\n\t};\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookieWpmRestEndpointAvailable: '_wpm_endpoint_available',\n\t\trestEndpoint : '/wp-json/',\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = function () {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold();\n\t}\n\n\twpm.isBelowRestErrorThreshold = function () {\n\t\treturn window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold;\n\t}\n\n\twpm.isRestEndpointAvailable = function () {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookieWpmRestEndpointAvailable));\n\t\t} else {\n\t\t\t// return wpm.testEndpoint();\n\t\t\t// just set the value whenever possible in order not to wait or block the main thread\n\t\t\twpm.testEndpoint();\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = function () {\n\n\t\treturn !!window.sessionStorage;\n\t}\n\n\twpm.testEndpoint = function (\n\t\turl = location.protocol + '//' + location.host + wpmRestSettings.restEndpoint,\n\t\tcookieName = wpmRestSettings.cookieWpmRestEndpointAvailable\n\t) {\n\t\t// console.log('testing endpoint');\n\n\t\tjQuery.ajax(url, {\n\t\t\ttype : 'HEAD',\n\t\t\ttimeout: 1000,\n\t\t\t// async: false,\n\t\t\tstatusCode: {\n\t\t\t\t200: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, true);\n\t\t\t\t\t// console.log('endpoint works');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true));\n\t\t\t\t},\n\t\t\t\t404: function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false));\n\t\t\t\t},\n\t\t\t\t0 : function (response) {\n\t\t\t\t\t// Cookies.set(cookieName, false);\n\t\t\t\t\t// console.log('endpoint doesn\\'t work');\n\t\t\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false));\n\t\t\t\t}\n\t\t\t}\n\t\t}).then(r => {\n\t\t\t// console.log('test done')\n\t\t\t// console.log('result: ' + JSON.parse(window.sessionStorage.getItem(cookieName)));\n\t\t\t// return JSON.parse(window.sessionStorage.getItem(cookieName));\n\t\t});\n\t}\n\n\twpm.isWpmRestEndpointAvailable = function (cookieName = wpmRestSettings.cookieWpmRestEndpointAvailable) {\n\n\t\treturn !!wpm.getCookie(cookieName);\n\t}\n\n\twpm.writeOrderIdToStorage = function (orderId, expireDays = 365) {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date();\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays);\n\n\t\t\tlet ids = [];\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName));\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId);\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + '=' + JSON.stringify(ids) + ';expires=' + expiresDate.toUTCString();\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = [];\n\t\t\t\tids.push(orderId);\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids));\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName));\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId);\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === 'function' && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer(orderId);\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName);\n\t\treturn key !== '';\n\t}\n\n\twpm.isOrderIdStored = function (orderId) {\n\n\t\t// console.log('deduper: ' + wpmDataLayer.orderDeduplication);\n\t\tif (wpmDataLayer.orderDeduplication) {\n\t\t\t// console.log('order deduplication: on');\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName));\n\t\t\t\t\treturn ids.includes(orderId);\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName));\n\t\t\t\t\treturn ids.includes(orderId);\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log('order deduplication: off');\n\t\t\treturn false;\n\t\t}\n\t}\n\n\twpm.isEmail = function (email) {\n\t\t// https://emailregex.com/\n\t\tlet regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\treturn regex.test(email);\n\t}\n\n\twpm.removeProductFromCart = function (productId, quantityToRemove = null) {\n\t\t// console.log('product_id: ' + productId + ' | quantityToRemove: ' + quantityToRemove);\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId);\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tlet quantity;\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity;\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove;\n\t\t\t}\n\n\t\t\t// console.log('product_id: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log(productId);\n\t\t\t// console.log(wpmDataLayer.cart);\n\t\t\t// console.log(wpmDataLayer.cart[productId]);\n\n\t\t\tif (wpmDataLayer.cart[productId]) {\n\n\t\t\t\t// let product = {\n\t\t\t\t// id : productId.toString(),\n\t\t\t\t// dyn_r_ids: wpmDataLayer.cart[productId].dyn_r_ids,\n\t\t\t\t// name : wpmDataLayer.cart[productId].name,\n\t\t\t\t// // list_name: wpmDataLayer.shop.list_name, // doesn't make sense on mini_cart\n\t\t\t\t// brand : wpmDataLayer.cart[productId].brand,\n\t\t\t\t// category: wpmDataLayer.cart[productId].category,\n\t\t\t\t// variant : wpmDataLayer.cart[productId].variant,\n\t\t\t\t// // list_position: wpmDataLayer.cart[productId].position, // doesn't make sense on mini_cart\n\t\t\t\t// quantity : quantity,\n\t\t\t\t// price : wpmDataLayer.cart[productId].price,\n\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t// };\n\t\t\t\t//\n\t\t\t\t// if (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity);\n\n\t\t\t\t// console.log('removing');\n\t\t\t\t// console.log(data);\n\n\t\t\t\tjQuery(document).trigger('wpmRemoveFromCart', product);\n\n\t\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\t\t\t\t\tdelete wpmDataLayer.cart[productId];\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(wpmDataLayer.cart));\n\t\t\t\t} else {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity;\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(wpmDataLayer.cart));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\n\t\t}\n\t}\n\n\tgetIdBasedOndVariationsOutputSetting = function (productId) {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.general.variationsOutput) {\n\t\t\t\t// console.log('test');\n\t\t\t\treturn productId;\n\t\t\t} else {\n\t\t\t\tif (wpmDataLayer.products[productId].isVariation) {\n\t\t\t\t\treturn wpmDataLayer.products[productId].parentId;\n\t\t\t\t} else {\n\t\t\t\t\treturn productId;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = function (productId, quantity) {\n\n\t\ttry {\n\t\t\t// console.log('productId: ' + productId + ' | qty: ' + quantity);\n\t\t\t// console.log('productId: ' + productId + ' | variationId: ' + variationId + ' | qty: ' + quantity);\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId);\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity);\n\n\t\t\t\t// console.log(productId);\n\n\t\t\t\tjQuery(document).trigger('wpmAddToCart', product);\n\n\t\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\t\tif (wpmDataLayer.cart !== undefined && wpmDataLayer.cart[productId] !== undefined) {\n\t\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity;\n\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(wpmDataLayer.cart));\n\t\t\t\t} else {\n\n\t\t\t\t\tif (!wpmDataLayer.cart) {\n\n\t\t\t\t\t\t// wpmDataLayer['cart'] = {\n\t\t\t\t\t\t// [productId]: {\n\t\t\t\t\t\t// id : productId,\n\t\t\t\t\t\t// dyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\t\t\t\t// name : wpmDataLayer.products[productId].name,\n\t\t\t\t\t\t// brand : wpmDataLayer.products[productId].brand,\n\t\t\t\t\t\t// category : wpmDataLayer.products[productId].category,\n\t\t\t\t\t\t// variant : wpmDataLayer.products[productId].variant,\n\t\t\t\t\t\t// quantity : quantity,\n\t\t\t\t\t\t// price : wpmDataLayer.products[productId].price,\n\t\t\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t\t\t// parentId : wpmDataLayer.products[productId].parentId,\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// };\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// if (wpmDataLayer['cart'][productId].isVariation) wpmDataLayer['cart'][productId]['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\t\t\twpmDataLayer['cart'] = {\n\t\t\t\t\t\t\t[productId]: wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(wpmDataLayer.cart));\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// wpmDataLayer.cart[productId] = {\n\t\t\t\t\t\t// id : productId,\n\t\t\t\t\t\t// dyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\t\t\t\t// name : wpmDataLayer.products[productId].name,\n\t\t\t\t\t\t// brand : wpmDataLayer.products[productId].brand,\n\t\t\t\t\t\t// category : wpmDataLayer.products[productId].category,\n\t\t\t\t\t\t// variant : wpmDataLayer.products[productId].variant,\n\t\t\t\t\t\t// quantity : quantity,\n\t\t\t\t\t\t// price : wpmDataLayer.products[productId].price,\n\t\t\t\t\t\t// isVariation: wpmDataLayer.products[productId].isVariation,\n\t\t\t\t\t\t// parentId : wpmDataLayer.products[productId].parentId,\n\t\t\t\t\t\t// };\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// if (wpmDataLayer.cart[productId].isVariation) wpmDataLayer.cart[productId]['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\t\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity);\n\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(wpmDataLayer.cart));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend();\n\t\t}\n\t}\n\n\twpm.getCartItems = function () {\n\n\t\t// console.log('get cart items');\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem('wpmDataLayerCart') || wpmDataLayer.shop.page_type === 'order_received_page') {\n\t\t\t\tsessionStorage.setItem('wpmDataLayerCart', JSON.stringify({}));\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem('wpmDataLayerCart')));\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend();\n\t\t}\n\t}\n\n\twpm.getCartItemsFromBackend = function () {\n\t\t// get all cart items from the backend\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction: 'wpm_get_cart_items',\n\t\t\t};\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : 'get',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (cartItems) {\n\n\t\t\t\t\t\t// save all cart items into wpmDataLayer\n\n\t\t\t\t\t\tif (!cartItems['cart']) cartItems['cart'] = {};\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(cartItems['cart']);\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem('wpmDataLayerCart', JSON.stringify(cartItems['cart']));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\twpm.getProductsFromBackend = function (productIds) {\n\t\t// console.log('getting pids from back-end: ' + productIds)\n\t\t// get productIds from the backend\n\n\t\t// reduce productIds by products already in the dataLayer\n\t\tproductIds = productIds.filter(item => !wpmDataLayer.products.hasOwnProperty(item));\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return;\n\n\t\ttry {\n\t\t\tlet data = {\n\t\t\t\taction : 'wpm_get_product_ids',\n\t\t\t\tproductIds: productIds,\n\t\t\t};\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : 'get',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (products) {\n\n\t\t\t\t\t\t// merge products into wpmDataLayer.products\n\t\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, products);\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\twpm.saveCartObjectToDataLayer = function (cartObject) {\n\t\twpmDataLayer.cart = cartObject;\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject);\n\t}\n\n\twpm.fireCheckoutOption = function (step, checkout_option = null, value = null) {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value\n\t\t};\n\n\t\tjQuery(document).trigger('wpmFireCheckoutOption', data);\n\t}\n\n\twpm.fireCheckoutProgress = function (step) {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t};\n\n\t\tjQuery(document).trigger('wpmFireCheckoutProgress', data);\n\t}\n\n\twpm.getPostIdFromString = function (string) {\n\t\t// console.log(string);\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2];\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = function (productId) {\n\n\t\t// productId = null;\n\n\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\tproductId = getIdBasedOndVariationsOutputSetting(productId);\n\n\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\tjQuery(document).trigger('wpmViewItemList', wpm.getProductDataForViewItemEvent(productId));\n\t}\n\n\twpm.getProductDataForViewItemEvent = function (productId) {\n\n\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\twpm.getMainProductIdFromProductPage = function () {\n\t\ttry {\n\t\t\tif (['simple', 'variable', 'grouped', 'composite', 'bundle'].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery('.wpmProductId:first').data('id');\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = function (target) {\n\n\t\tjQuery(target).css({\"position\": \"relative\"});\n\t\tjQuery(target).append('<div id=\"viewItemListTriggerOverlay\"></div>')\n\t\tjQuery(target).find('#viewItemListTriggerOverlay').css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = function () {\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get('s');\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {};\n\n\twpm.observerCallback = function (entries, observer) {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId;\n\n\t\t\t\tlet elementId = jQuery(entry.target).data('ioid');\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next('.wpmProductId').length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next('.wpmProductId').data('id');\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find('.wpmProductId').data('id');\n\t\t\t\t}\n\n\t\t\t\t// productId = null;\n\n\t\t\t\tif (!productId) throw Error('wpmProductId element not found');\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\t\t\t\t\t\t// console.log('prodid: ' + productId);\n\t\t\t\t\t\twpm.triggerViewItemList(productId);\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target);\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target);\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find('#viewItemListTriggerOverlay').remove();\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t}\n\t\t});\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io;\n\tlet ioid = 0;\n\tlet allIoElementsToWatch;\n\n\tlet getAllElementsToWatch = function () {\n\n\t\tallIoElementsToWatch = jQuery('.wpmProductId')\n\t\t\t.map(function (i, elem) {\n\t\t\t\t// console.log(elem);\n\t\t\t\tif (\n\t\t\t\t\tjQuery(elem).parent().hasClass('type-product') ||\n\t\t\t\t\tjQuery(elem).parent().hasClass('product') ||\n\t\t\t\t\tjQuery(elem).parent().hasClass('product-item-inner')\n\t\t\t\t) {\n\t\t\t\t\t// console.log(elem);\n\t\t\t\t\treturn jQuery(elem).parent();\n\t\t\t\t} else if (\n\t\t\t\t\tjQuery(elem).prev().hasClass('wc-block-grid__product') ||\n\t\t\t\t\tjQuery(elem).prev().hasClass('product') ||\n\t\t\t\t\tjQuery(elem).prev().hasClass('product-small') ||\n\t\t\t\t\tjQuery(elem).prev().hasClass('woocommerce-LoopProduct-link')\n\t\t\t\t) {\n\t\t\t\t\treturn jQuery(this).prev();\n\t\t\t\t} else if (jQuery(elem).closest('.product').length) {\n\t\t\t\t\treturn jQuery(elem).closest('.product');\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\twpm.startIntersectionObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tlet urlParams = new URLSearchParams(window.location.search);\n\t\t\tif (urlParams.has('vildemomode')) wpmDataLayer.viewItemListTrigger.testMode = true;\n\n\t\t\t// set up intersection observer\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t});\n\n\t\t\tgetAllElementsToWatch();\n\n\t\t\t// console.log(allElementsToWatch);\n\n\t\t\tallIoElementsToWatch.each(function (i, elem) {\n\t\t\t\t// console.log(elem[0]);\n\t\t\t\t// jQuery(elem[0]).attr('data-ioid', ioid++);\n\t\t\t\tjQuery(elem[0]).data('ioid', ioid++);\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\t// watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = function () {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery('.wpmProductId:eq(0)').parents().has(jQuery('.wpmProductId:eq(1)').parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tlet productsMutationObserver = new MutationObserver(function (mutations) {\n\n\t\tmutations.forEach(function (mutation) {\n\t\t\tlet newNodes = mutation.addedNodes; // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes); // jQuery set\n\t\t\t\tnodes.each(function () {\n\t\t\t\t\tif (\n\t\t\t\t\t\tjQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\tjQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(this)) {\n\t\t\t\t\t\t\tjQuery(this).data('ioid', ioid++);\n\t\t\t\t\t\t\tio.observe(this)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\n\tlet hasWpmProductIdElement = function (elem) {\n\t\treturn !!(jQuery(elem).find('.wpmProductId').length ||\n\t\t\tjQuery(elem).siblings('.wpmProductId').length);\n\t}\n\n\twpm.setCookie = function (cookieName, cookieValue = '', expiryDays = null) {\n\t\tif (expiryDays) {\n\t\t\tlet d = new Date();\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000));\n\t\t\tlet expires = \"expires=\" + d.toUTCString();\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\";\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\";\n\t\t}\n\t}\n\n\twpm.getCookie = function (cookieName) {\n\t\tlet name = cookieName + \"=\";\n\t\tlet decodedCookie = decodeURIComponent(document.cookie);\n\t\tlet ca = decodedCookie.split(';');\n\t\tfor (let i = 0; i < ca.length; i++) {\n\t\t\tlet c = ca[i];\n\t\t\twhile (c.charAt(0) == ' ') {\n\t\t\t\tc = c.substring(1);\n\t\t\t}\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}\n\n\twpm.storeOrderIdOnServer = function (orderId) {\n\n\t\t// console.log('saving wpm_purchase_pixels_fired');\n\n\t\t// console.log('url: ' + wpm_premium_only_ajax_object.ajax_url);\n\t\t// console.log('nonce: ' + wpm_premium_only_ajax_object.nonce);\n\t\t// console.log('url: ' + wpm.ajax_url);\n\t\t// console.log('nonce: ' + wpm.nonce);\n\n\t\ttry {\n\t\t\t// save the state in the database\n\t\t\tlet data = {\n\t\t\t\taction : 'wpm_purchase_pixels_fired',\n\t\t\t\torder_id: orderId,\n\t\t\t\t// nonce : ajax_object.nonce,\n\t\t\t\tnonce: wpm.nonce,\n\t\t\t};\n\n\t\t\tjQuery.ajax(\n\t\t\t\t{\n\t\t\t\t\ttype : 'post',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t// url : ajax_object.ajax_url,\n\t\t\t\t\turl : wpm.ajax_url,\n\t\t\t\t\tdata : data,\n\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\tif (response.success === false) {\n\t\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (response) {\n\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = function (url) {\n\t\tlet searchParams = new URLSearchParams(url.search);\n\t\tlet cartItemKey = searchParams.get('remove_item');\n\n\t\tlet productId = null;\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey]['variation_id'] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey]['product_id'];\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey]['variation_id'];\n\t\t}\n\n\t\treturn productId;\n\t}\n\n\twpm.getAddToCartLinkProductIds = function () {\n\t\treturn jQuery('a').map(function () {\n\t\t\tlet href = jQuery(this).attr('href');\n\n\t\t\tif (href && href.includes('?add-to-cart=')) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/);\n\t\t\t\tif (matches) return matches[2];\n\t\t\t}\n\t\t}).get()\n\t}\n\n\twpm.getProductDetailsFormattedForEvent = function (productId, quantity = 1) {\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t};\n\n\t\tif (product.isVariation) product['parentId_dyn_r_ids'] = wpmDataLayer.products[productId].parentId_dyn_r_ids;\n\n\t\treturn product;\n\t}\n\n\twpm.setReferrerToCookie = function () {\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie('wpmReferrer')) {\n\t\t\twpm.setCookie('wpmReferrer', document.referrer);\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = function () {\n\t\tif (wpm.getCookie('wpmReferrer')) {\n\t\t\treturn wpm.getCookie('wpmReferrer');\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = function (clidId = 'gclid') {\n\n\t\tlet clidCookieId;\n\n\t\tclidCookieId = {\n\t\t\tgclid: '_gcl_aw',\n\t\t\tdclid: '_gcl_dc',\n\t\t};\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId]);\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/);\n\t\t\treturn matches[2];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\twpm.getUserAgent = function () {\n\t\treturn navigator.userAgent;\n\t}\n\n\twpm.getViewPort = function () {\n\t\treturn {\n\t\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t\t};\n\t}\n\n\t/*\n\t* Handle Cookie Management Platforms\n\t* */\n\n\tlet getComplianzCookies = function () {\n\n\t\tlet cmplz_statistics = wpm.getCookie('cmplz_statistics')\n\t\tlet cmplz_marketing = wpm.getCookie('cmplz_marketing')\n\t\tlet cmplz_consent_status = wpm.getCookie('cmplz_consent_status') || wpm.getCookie('cmplz_banner-status')\n\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === 'allow',\n\t\t\t\tads : cmplz_marketing === 'allow',\n\t\t\t\tvisitorHasChosen: true\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tlet getCookieLawInfoCookies = function () {\n\n\t\tlet analyticsCookie = wpm.getCookie('cookielawinfo-checkbox-analytics')\n\t\tlet adsCookie = wpm.getCookie('cookielawinfo-checkbox-advertisement')\n\t\tlet visitorHasChosen = wpm.getCookie('CookieLawInfoConsent')\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === 'yes',\n\t\t\t\tads : adsCookie === 'yes',\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = 'category'\n\twpmConsentValues.visitorHasChosen = false\n\n\twpm.getConsentValues = function () {\n\t\treturn wpmConsentValues\n\t}\n\n\twpm.updateConsentCookieValues = function (explicitConsent = false) {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\t// console.log('exp cons: ' + explicitConsent)\n\n\t\tlet cookie\n\n\t\tif (cookie = wpm.getCookie('CookieConsent')) {\n\t\t\t// Cookiebot\n\t\t\t// https://wordpress.org/plugins/cookiebot/\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\t// console.log(cookie.indexOf('statistics:true'))\n\t\t\t// console.log(cookie.indexOf('marketing:true'))\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf('statistics:true') >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf('marketing:true') >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie('CookieScriptConsent')) {\n\t\t\t// Cookie Script\n\t\t\t// https://wordpress.org/plugins/cookie-script-com/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// console.log(cookie)\n\t\t\t// console.log(cookie.action)\n\t\t\t// console.log('cat length: ' + cookie.categories.length)\n\t\t\t// console.log(cookie.categories.indexOf('performance'))\n\n\t\t\tif (cookie.action === 'reject') {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (cookie.categories.length === 2) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf('performance') >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf('targeting') >= 0\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie('borlabs-cookie')) {\n\t\t\t// Borlabs Cookie\n\t\t\t// https://borlabs.io/borlabs-cookie/\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = 'pixel'\n\n\t\t} else if (cookie = getComplianzCookies()) {\n\t\t\t// Complianz Cookie\n\t\t\t// https://wordpress.org/plugins/complianz-gdpr/\n\n\t\t\t// console.log(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else if (cookie = wpm.getCookie('cookie_notice_accepted')) {\n\t\t\t// Cookie Compliance (free version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = wpm.getCookie('hu-consent')) {\n\t\t\t// Cookie Compliance (pro version)\n\t\t\t// https://wordpress.org/plugins/cookie-notice/\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories['3']\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories['4']\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t} else if (cookie = getCookieLawInfoCookies()) {\n\t\t\t// CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t\t// https://wordpress.org/plugins/cookie-law-info/\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t} else if (cookie = wpm.getCookie('moove_gdpr_popup')) {\n\t\t\t// GDPR Cookie Compliance Plugin by Moove Agency\n\t\t\t// https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t\t// TODO write documentation on how to set up the plugin in order for this to work properly\n\n\t\t\tcookie = JSON.parse(cookie)\n\t\t\t// console.log('moove cookie thirdparty: ' + cookie.thirdparty)\n\t\t\t// console.log('moove cookie advanced: ' + cookie.advanced)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === '1'\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === '1'\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(wpmConsentValues)\n\n\t\t} else {\n\t\t\t// consentValues.categories.analytics = true\n\t\t\t// consentValues.categories.ads = true\n\n\t\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\t\twpmConsentValues.categories.ads = !explicitConsent\n\t\t}\n\t}\n\n\twpm.updateConsentCookieValues();\n\n\twpm.setConsentDefaultValuesToExplicit = function () {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\t/*\n\t* Runs through each script in <head> and blocks / unblocks it according to the plugin settings\n\t* and user consent.\n\t*/\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data('wpm-cookie-category')) {\n\n\t\t\t\t\t\t// console.log(node)\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true});\n\twindow.addEventListener('DOMContentLoaded', () => wpm.scriptTagObserver.disconnect());\n\n\twpm.shouldScriptBeActive = function (node) {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === 'category' && $(node).data('wpm-cookie-category').split(',').some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === 'pixel' && wpmConsentValues.pixels.includes($(node).data('wpm-pixel-name'))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === 'pixel' && $(node).data('wpm-pixel-name') === 'google' && ['google-analytics', 'google-ads'].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data('wpm-pixel-name') === 'google') {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data('wpm-src')\n\t\tif (wpmSrc) $(scriptNode).attr('src', wpmSrc)\n\n\t\tscriptNode.type = 'text/javascript'\n\n\t\tif (removeAttach) $(scriptNode).appendTo('head')\n\t}\n\n\twpm.blockScript = function (scriptNode, removeAttach = false) {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr('src')) $(scriptNode).removeAttr('src')\n\t\tscriptNode.type = 'blocked/javascript'\n\n\t\tif (removeAttach) $(scriptNode).appendTo('head')\n\t}\n\n\twpm.unblockAllScripts = function (analytics = true, ads = true) {\n\t\t// console.log('unblocking all scripts')\n\n\t\t$.each(\n\t\t\t$('script[type=\"blocked/javascript\"]'), function (index, scriptNode) {\n\n\t\t\t\tif ($(scriptNode).data('wpm-cookie-category').includes('analytics') && analytics) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t} else if ($(scriptNode).data('wpm-cookie-category').includes('ads') && ads) {\n\t\t\t\t\twpm.unblockScript(scriptNode, true)\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\twpm.unblockSelectedPixels = function () {\n\t\t$.each(\n\t\t\t$('script[type=\"blocked/javascript\"]'), function (index, node) {\n\n\t\t\t\tif (wpmConsentValues.pixels.includes($(node).data('wpm-pixel-name'))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t} else if ($(node).data('wpm-pixel-name') === 'google' && ['google-analytics', 'google-ads'].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\t\twpm.unblockScript(node, true)\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\twpm.googleConfigConditionsMet = function (type) {\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer.pixels.google.consent_mode.active) {\n\t\t\treturn true\n\t\t} else if (wpmConsentValues.mode === 'category') {\n\t\t\treturn wpmConsentValues.categories[type] === true\n\t\t} else if (wpmConsentValues.mode === 'pixel') {\n\t\t\treturn wpmConsentValues.pixels.includes('google-' + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = function (google_consent_settings) {\n\n\t\tif (wpmConsentValues.mode === 'category') {\n\t\t\tif (wpmConsentValues.categories.analytics) google_consent_settings.analytics_storage = 'granted'\n\t\t\tif (wpmConsentValues.categories.ads) google_consent_settings.ad_storage = 'granted'\n\t\t} else if ((wpmConsentValues.mode === 'pixel')) {\n\t\t\tgoogle_consent_settings.analytics_storage = wpmConsentValues.pixels.includes('google-analytics') ? 'granted' : 'denied'\n\t\t\tgoogle_consent_settings.ad_storage = wpmConsentValues.pixels.includes('google-ads') ? 'granted' : 'denied'\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.updateGoogleConsentMode = function (analytics = true, ads = true) {\n\n\t\tif (\n\t\t\t!window.gtag ||\n\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t) return\n\n\t\tgtag('consent', 'update', {\n\t\t\t'analytics_storage': analytics ? 'granted' : 'denied',\n\t\t\t'ad_storage' : ads ? 'granted' : 'denied'\n\t\t});\n\t}\n\n\n\t/*\n\t* Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t* by the visitor.\n\t */\n\n\t// Borlabs Cookie\n\t// If visitor accepts cookies in Borlabs Cookie unblock the scripts\n\twindow.addEventListener('borlabs-cookie-consent-saved', function (e) {\n\n\t\twpm.updateConsentCookieValues();\n\n\t\tif (wpmConsentValues.mode === 'pixel') {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes('google-analytics'), wpmConsentValues.pixels.includes('google-ads'))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t});\n\n\t// Cookiebot\n\t// If visitor accepts cookies in Cookiebot unblock the scripts\n\t// https://www.cookiebot.com/en/developer/\n\twindow.addEventListener('CookiebotOnAccept', function (e) {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false);\n\n\t// Cookie Script\n\t// If visitor accepts cookies in Cookie Script unblock the scripts\n\t// https://support.cookie-script.com/article/20-custom-events\n\twindow.addEventListener('CookieScriptAccept', function (e) {\n\t\tif (e.detail.categories.includes('performance')) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes('targeting')) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t// Cookie Script\n\t// If visitor accepts cookies in Cookie Script unblock the scripts\n\t// https://support.cookie-script.com/\n\twindow.addEventListener('CookieScriptAcceptAll', function (e) {\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t// Complianz Cookie\n\t// If visitor accepts cookies in Complianz unblock the scripts\n\tdocument.addEventListener(\"cmplzStatusChange\", function (e) {\n\n\t\twpm.updateConsentCookieValues();\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t});\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\tdocument.addEventListener(\"setCookieNotice\", function (e) {\n\n\t\twpm.updateConsentCookieValues();\n\n\t\t// console.log(wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t});\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t// Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t// we have to solve this by using a mutation observer.\n\twpm.huObserver = new MutationObserver(function (mutations) {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === 'hu') {\n\n\t\t\t\t\t\tjQuery('.hu-cookies-save').on('click', function (e) {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues();\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t});\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true});\n\t}\n\n\twpm.version = function () {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t// wpm['load'] = {\n\t// base: true\n\t// };\n\n\twindow['wpmLoaded'] = {};\n\n\t// return {\n\t// writeOrderIdToStorage : writeOrderIdToStorage,\n\t// isOrderIdStored : isOrderIdStored,\n\t// isEmail : isEmail,\n\t// removeProductFromCart : removeProductFromCart,\n\t// getViewItemProducts : getViewItemProducts,\n\t// addProductToCart : addProductToCart,\n\t// getCartItemsFromBackEnd: getCartItemsFromBackEnd,\n\t// fireCheckoutOption : fireCheckoutOption,\n\t// getCartItems : getCartItems\n\t// }\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n// run when window ready\njQuery(function () {\n// jQuery(window).on('load', function () {\n\n\t// watch for products visible in viewport\n\twpm.startIntersectionObserverToWatch();\n\n\t// watch for lazy loaded products\n\twpm.startProductsMutationObserverToWatch();\n\n\tlet body = jQuery('body');\n\tlet products = jQuery('.products, .product');\n\n\t// remove_from_cart event\n\t// body.on('click', '.remove_from_cart_button, .remove', function (e) {\n\tjQuery(document).on('click', '.remove_from_cart_button, .remove', function (e) {\n\t\t// jQuery('.remove_from_cart_button, .remove').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('remove_from_cart: ' + jQuery(this).data('product_id'));\n\n\t\t\tlet url = new URL(jQuery(this).attr('href'));\n\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url);\n\n\t\t\twpm.removeProductFromCart(productId);\n\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n\n\n\t// add_to_cart event\n\t// body.on('click', '.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button', function (e) {\n\tjQuery(document).on('click', '.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .single_add_to_cart_button', function (e) {\n\t\t// jQuery('.add_to_cart_button:not(.product_type_variable), .ajax_add_to_cart, .js-ajax-add-to-cart, .single_add_to_cart_button, .btn_color-2').on('click', function (e) {\n\n\t\ttry {\n\t\t\t// console.log('add_to_cart');\n\n\t\t\tif (wpmDataLayer.shop.page_type === 'product') {\n\n\t\t\t\t// first process related and upsell products\n\t\t\t\tif (typeof jQuery(this).attr('href') !== 'undefined' && jQuery(this).attr('href').includes('add-to-cart')) {\n\t\t\t\t\t// console.log('add-to-cart on upsell and related products');\n\t\t\t\t\tlet quantity = 1;\n\t\t\t\t\tlet productId = jQuery(this).data('product_id');\n\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\twpm.addProductToCart(productId, quantity);\n\t\t\t\t} else {\n\n\t\t\t\t\tif (wpmDataLayer.shop.product_type === 'simple') {\n\n\t\t\t\t\t\t// console.log('test');\n\t\t\t\t\t\tlet quantity = Number(jQuery('.input-text.qty').val());\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1;\n\n\t\t\t\t\t\tlet productId = jQuery(this).val();\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity);\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === 'variable') {\n\n\t\t\t\t\t\t// console.log('variable');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery('.input-text.qty').val());\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1;\n\n\t\t\t\t\t\tlet productId = jQuery(\"[name='variation_id']\").val();\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity);\n\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === 'grouped') {\n\n\t\t\t\t\t\t// console.log('grouped');\n\n\t\t\t\t\t\tjQuery('.woocommerce-grouped-product-list-item').each(function () {\n\n\t\t\t\t\t\t\tlet quantity = Number(jQuery(this).find('.input-text.qty').val());\n\n\t\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1;\n\n\t\t\t\t\t\t\tlet classes = jQuery(this).attr('class');\n\t\t\t\t\t\t\tlet productId = wpm.getPostIdFromString(classes);\n\n\t\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\t\twpm.addProductToCart(productId, quantity);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (wpmDataLayer.shop.product_type === 'bundle') {\n\n\t\t\t\t\t\t// console.log('bundle');\n\n\t\t\t\t\t\tlet quantity = Number(jQuery('.input-text.qty').val());\n\n\t\t\t\t\t\tif (!quantity && quantity !== 0) quantity = 1;\n\n\t\t\t\t\t\tlet productId = jQuery('input[name=add-to-cart]').val();\n\n\t\t\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\t\t\t// console.log('quantity: ' + quantity);\n\n\t\t\t\t\t\twpm.addProductToCart(productId, quantity);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// console.log('non product page');\n\n\t\t\t\tlet quantity = 1;\n\t\t\t\tlet productId = jQuery(this).data('product_id');\n\t\t\t\t// console.log('productId: ' + productId);\n\t\t\t\twpm.addProductToCart(productId, quantity);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n\n\t// if someone clicks anywhere on a custom /?add-to-cart=123 link\n\t// trigger the add to cart event\n\t// body.one('click', function (e) {\n\t//\n\t// try {\n\t// if (jQuery(this)[0].URL) {\n\t//\n\t// let href = new URL(jQuery(this)[0].URL);\n\t// let searchParams = new URLSearchParams(href.search);\n\t//\n\t// if (searchParams.has('add-to-cart')) {\n\t// // console.log('non product page, /?add-to-cart=123 link');\n\t//\n\t// let productId = searchParams.get('add-to-cart');\n\t// wpm.addProductToCart(productId, 1);\n\t// }\n\t// }\n\t// } catch (e) {\n\t// console.log(e);\n\t// }\n\t// });\n\n\t// if someone clicks anywhere on a custom /?add-to-cart=123 link\n\t// trigger the add to cart event\n\t// body.one('click', 'a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)', function (event) {\n\tjQuery(document).one('click', 'a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)', function (event) {\n\t\t// jQuery('a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)').one('click', function (event) {\n\n\t\ttry {\n\t\t\tif (jQuery(event.target).closest('a').attr('href')) {\n\n\t\t\t\tlet href = jQuery(event.target).closest('a').attr('href');\n\n\t\t\t\tif (href.includes('add-to-cart=')) {\n\t\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/);\n\t\t\t\t\t// console.log('pid: ' + matches[2])\n\t\t\t\t\tif (matches) wpm.addProductToCart(matches[2], 1);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n\n\t// select_content GA UA event\n\t// select_item GA 4 event\n\t// jQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product-small.box', function (e) {\n\t// body.on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product', function (e) {\n\tjQuery(document).on('click', '.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product', function (e) {\n\t\t// jQuery('.woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product').on('click', function (e) {\n\n\t\ttry {\n\n\t\t\t// On some pages the event fires multiple times, and on product pages\n\t\t\t// even on page load. Using e.stopPropagation helps to prevent this,\n\t\t\t// but I dont know why. We don't even have to use this, since only a real\n\t\t\t// product click yields a valid productId. So we filter the invalid click\n\t\t\t// events out later down the code. I'll keep it that way because this is\n\t\t\t// the most compatible way across shops.\n\t\t\t// e.stopPropagation();\n\n\t\t\t// console.log('select_content and select_item');\n\n\t\t\tlet productId = jQuery(this).nextAll('.wpmProductId:first').data('id');\n\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\n\t\t\t// On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t\t// In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t\t// related products, which are found below.\n\t\t\tif (productId) {\n\n\t\t\t\t// console.log('select_content and select_item: ' + productId);\n\n\t\t\t\tproductId = getIdBasedOndVariationsOutputSetting(productId);\n\n\t\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\t\t// console.log('prodid: ' + productId);\n\n\t\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId);\n\n\t\t\t\t\tjQuery(document).trigger('wpmSelectContentGaUa', product);\n\t\t\t\t\tjQuery(document).trigger('wpmSelectItem', product);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n\n\t// begin_checkout event\n\t// body.one('click', '.checkout-button, .cart-checkout-button, .button.checkout', function (e) {\n\tjQuery(document).one('click', '.checkout-button, .cart-checkout-button, .button.checkout', function (e) {\n\t\t// jQuery('.checkout-button, .cart-checkout-button, .button.checkout').one('click', function (e) {\n\t\t// console.log('begin_checkout');\n\n\t\tjQuery(document).trigger('wpmBeginCheckout');\n\t});\n\n\tlet emailSelected = false;\n\n\t// checkout_progress event\n\t// track checkout option event: entered valid billing email\n\t// body.on('input', '#billing_email', function () {\n\tjQuery(document).on('input', '#billing_email', function () {\n\t\t// jQuery('#billing_email').on('input', function () {\n\n\t\tif (wpm.isEmail(jQuery(this).val())) {\n\t\t\t// wpm.fireCheckoutOption(2);\n\t\t\twpm.fireCheckoutProgress(2);\n\t\t\temailSelected = true;\n\t\t}\n\t});\n\n\t// track checkout option event: purchase click\n\tlet paymentMethodSelected = false;\n\n\t// body.on('click', '.wc_payment_methods', function () {\n\tjQuery(document).on('click', '.wc_payment_methods', function () {\n\t\t// jQuery('.wc_payment_methods').on('click', function () {\n\n\t\tif (paymentMethodSelected === false) {\n\t\t\twpm.fireCheckoutProgress(3);\n\t\t}\n\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val());\n\t\tpaymentMethodSelected = true;\n\t});\n\n\t// track checkout option event: purchase click\n\t// body.one('click', '#place_order', function () {\n\tjQuery(document).one('click', '#place_order', function () {\n\t\t// jQuery('#place_order').one('click', function () {\n\n\t\tif (emailSelected === false) {\n\t\t\twpm.fireCheckoutProgress(2);\n\t\t}\n\n\t\tif (paymentMethodSelected === false) {\n\t\t\twpm.fireCheckoutProgress(3);\n\t\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val());\n\t\t}\n\n\t\twpm.fireCheckoutProgress(4);\n\t});\n\n\t// update cart event\n\t// body.on('click', \"[name='update_cart']\", function (e) {\n\tjQuery(document).on('click', \"[name='update_cart']\", function (e) {\n\t\t// jQuery(\"[name='update_cart']\").on('click', function (e) {\n\n\t\ttry {\n\t\t\tjQuery('.cart_item').each(function () {\n\n\t\t\t\t// let productId = jQuery(this).find('[data-product_id]').data('product_id');\n\n\t\t\t\tlet url = new URL(jQuery(this).find('.product-remove').find('a').attr('href'));\n\t\t\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url);\n\n\t\t\t\t// console.log(productId)\n\n\t\t\t\tlet quantity = jQuery(this).find('.qty').val();\n\n\t\t\t\tif (quantity === 0) {\n\t\t\t\t\twpm.removeProductFromCart(productId);\n\t\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity);\n\t\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t\twpm.getCartItemsFromBackend();\n\t\t}\n\t});\n\n\t// Fired when the user selects all the required dropdowns / attributes\n\t// https://stackoverflow.com/a/27849208/4688612\n\tjQuery(\".single_variation_wrap\").on('show_variation', function (event, variation) {\n\n\t\ttry {\n\t\t\t// Fired when the user selects all the required dropdowns / attributes\n\t\t\t// console.log('product selected');\n\t\t\t// console.log(variation);\n\n\t\t\tlet productId = getIdBasedOndVariationsOutputSetting(variation.variation_id);\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\t// console.log('productId: ' + productId);\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId);\n\n\t\t\t\tjQuery(document).trigger('wpmViewItem', product);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n\n\t// add_to_wishlist\n\t// body.on('click', '.add_to_wishlist, .wl-add-to', function () {\n\tjQuery(document).on('click', '.add_to_wishlist, .wl-add-to', function () {\n\t\t// jQuery('.add_to_wishlist, .wl-add-to').on('click', function () {\n\n\t\ttry {\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log('this:' + jQuery(this).data('product-id'));\n\n\t\t\tlet productId;\n\n\t\t\tif (jQuery(this).data('productid')) { // for the WooCommerce wishlist plugin\n\t\t\t\tproductId = jQuery(this).data('productid');\n\t\t\t} else if (jQuery(this).data('product-id')) { // for the YITH wishlist plugin\n\t\t\t\tproductId = jQuery(this).data('product-id');\n\t\t\t}\n\n\t\t\tif (!productId) throw Error('Wasn\\'t able to retrieve a productId');\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId);\n\n\t\t\t// console.log('add_to_wishlist');\n\t\t\t// console.log(product);\n\n\t\t\tjQuery(document).trigger('wpmAddToWishlist', product);\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t})\n\n\t// body.on('updated_cart_totals', function () {\n\tjQuery(document).on('updated_cart_totals', function () {\n\n\t\tjQuery(document).trigger('wpmViewCart');\n\t});\n});\n\njQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t// console.log('settings.url: ' + settings.url);\n\n\tif (settings.url.includes('get_refreshed_fragments') && sessionStorage) {\n\t\tif (!sessionStorage.getItem('wpmMiniCartActive')) {\n\t\t\tsessionStorage.setItem('wpmMiniCartActive', JSON.stringify(true));\n\t\t}\n\t}\n});\n\n// populate the wpmDataLayer with the cart items\njQuery(window).on('load', function () {\n\t// console.log('getting cart');\n\n\ttry {\n\t\t// console.log('wpmMiniCartActive: ' + JSON.parse(sessionStorage.getItem('wpmMiniCartActive')));\n\t\t// if ( wpmDataLayer.shop.page_type === 'cart' || wpmDataLayer.shop.mini_cart.track === true) {\n\n\t\tif (\n\t\t\tJSON.parse(sessionStorage.getItem('wpmMiniCartActive')) && // if we detected calls to get_refreshed_fragments\n\t\t\tJSON.parse(sessionStorage.getItem('wpmFirstPageLoad')) && // when a new session is initiated there are no items in the cart, so we can save that call\n\t\t\twpmDataLayer.shop.mini_cart.track === true // if shop owner generally allows the plugin to track the mini cart\n\t\t) {\n\t\t\t// console.log('getting cart');\n\t\t\twpm.getCartItems();\n\n\t\t} else {\n\t\t\tsessionStorage.setItem('wpmFirstPageLoad', JSON.stringify(true));\n\t\t}\n\t} catch (e) {\n\t\tconsole.log(e);\n\t}\n});\n\n// get all add-to-cart= products from backend\njQuery(window).on('load', function () {\n\n\twpmDataLayer.products = wpmDataLayer.products || {};\n\t// wpmDataLayer.products = {14: 'x', 31: 'x', 16: 'x', 22: 'x', 40: 'x'};\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds();\n\n\twpm.getProductsFromBackend(productIds);\n})\n\njQuery(window).on('load', function () {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie('wpmReferrer')) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer);\n\t\t\tlet referrerHostname = referrerUrl.hostname;\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie('wpmReferrer', referrerHostname);\n\t\t\t} else {\n\t\t\t\twpm.setCookie('wpmReferrer', '');\n\t\t\t}\n\n\t\t} else {\n\t\t\twpm.setCookie('wpmReferrer', '');\n\t\t}\n\t}\n})\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["wpm","$","undefined","fBUserData","getRandomEventId","Math","random","toString","substring","getFbUserData","getFbUserDataFromBrowser","setFbUserData","getCookie","navigator","userAgent","fbViewContent","product","window","fbq","eventId","name","dyn_r_ids","wpmDataLayer","pixels","facebook","dynamic_remarketing","id_type","shop","currency","price","jQuery","document","trigger","location","href","on","event","parseFloat","quantity","wpmExists","then","page_type","product_type","getMainProductIdFromProductPage","getProductDataForViewItemEvent","e","console","log","google","ads","status","general","variationsOutput","isVariable","send_events_with_parent_ids","googleConfigConditionsMet","gtag","send_to","conversionIds","items","id","google_business_vertical","products","key","Object","entries","push","wpmDeduper","wpmRestSettings","checkCookie","useRestEndpoint","isSessionStorageAvailable","isRestEndpointAvailable","isBelowRestErrorThreshold","sessionStorage","getItem","JSON","parse","testEndpoint","url","protocol","host","cookieName","ajax","type","timeout","statusCode","response","setItem","stringify","r","isWpmRestEndpointAvailable","writeOrderIdToStorage","orderId","Storage","localStorage","ids","includes","expiresDate","Date","setDate","getDate","cookie","toUTCString","storeOrderIdOnServer","orderDeduplication","isOrderIdStored","isEmail","email","test","removeProductFromCart","productId","quantityToRemove","Error","getIdBasedOndVariationsOutputSetting","cart","getProductDetailsFormattedForEvent","isVariation","parentId","addProductToCart","getCartItemsFromBackend","getCartItems","saveCartObjectToDataLayer","data","action","dataType","ajax_url","success","cartItems","getProductsFromBackend","productIds","filter","item","hasOwnProperty","length","assign","error","cartObject","fireCheckoutOption","step","checkout_option","value","fireCheckoutProgress","getPostIdFromString","string","match","triggerViewItemList","indexOf","viewItemListTriggerTestMode","target","css","append","find","viewItemListTrigger","opacity","backgroundColor","getSearchTermFromUrl","URLSearchParams","search","get","io","ioTimeouts","observerCallback","observer","forEach","entry","elementId","next","isIntersecting","setTimeout","testMode","repeat","unobserve","clearTimeout","remove","allIoElementsToWatch","ioid","startIntersectionObserverToWatch","has","IntersectionObserver","threshold","map","i","elem","parent","hasClass","prev","this","closest","each","observe","startProductsMutationObserverToWatch","productsNode","parents","first","productsMutationObserver","attributes","childList","characterData","MutationObserver","mutations","mutation","newNodes","addedNodes","hasWpmProductIdElement","siblings","setCookie","cookieValue","expiryDays","d","setTime","getTime","expires","ca","decodeURIComponent","split","c","charAt","order_id","nonce","getProductIdByCartItemKeyUrl","cartItemKey","cartItemKeys","getAddToCartLinkProductIds","attr","matches","list_name","brand","category","variant","list_position","position","parentId_dyn_r_ids","setReferrerToCookie","referrer","getReferrerFromCookie","getClidFromBrowser","clidCookieId","clidId","gclid","dclid","getUserAgent","getViewPort","width","max","documentElement","clientWidth","innerWidth","height","clientHeight","innerHeight","getComplianzCookies","cmplz_statistics","cmplz_marketing","analytics","visitorHasChosen","getCookieLawInfoCookies","analyticsCookie","adsCookie","wpmConsentValues","getConsentValues","updateConsentCookieValues","explicitConsent","decodeURI","categories","consents","statistics","marketing","mode","thirdparty","advanced","setConsentDefaultValuesToExplicit","scriptTagObserver","node","shouldScriptBeActive","unblockScript","blockScript","head","subtree","addEventListener","disconnect","cookie_consent_mgmt","explicit_consent","some","element","consent_mode","active","scriptNode","removeAttach","wpmSrc","appendTo","removeAttr","unblockAllScripts","index","unblockSelectedPixels","getVisitorConsentStatusAndUpdateGoogleConsentSettings","google_consent_settings","analytics_storage","ad_storage","updateGoogleConsentMode","Cookiebot","consent","detail","huObserver","hu","body","version","URL","Number","val","classes","one","nextAll","emailSelected","paymentMethodSelected","variation","variation_id","ajaxSend","jqxhr","settings","mini_cart","track","referrerHostname","hostname","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","n","getter","__esModule","a","definition","o","defineProperty","enumerable","obj","prop","prototype","call"],"sourceRoot":""}
languages/woocommerce-google-adwords-conversion-tracking-tag.pot CHANGED
@@ -2,21 +2,21 @@
2
  # This file is distributed under the GNU General Public License v3.0.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Pixel Manager 1.16.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/src\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-04-07T03:49:34+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: woocommerce-google-adwords-conversion-tracking-tag\n"
16
 
17
  #. Plugin Name of the plugin
18
- #: wgact.php:207
19
- #: wgact.php:208
20
  msgid "WooCommerce Pixel Manager"
21
  msgstr ""
22
 
@@ -33,225 +33,226 @@ msgid "SweetCode"
33
  msgstr ""
34
 
35
  #. Author URI of the plugin
36
- msgid "https://sweetcode.com"
37
  msgstr ""
38
 
39
- #: classes/admin/class-admin.php:226
40
- #: classes/admin/class-admin.php:227
41
  msgid "Pixel Manager"
42
  msgstr ""
43
 
44
- #: classes/admin/class-admin.php:257
45
  msgid "Main"
46
  msgstr ""
47
 
48
- #: classes/admin/class-admin.php:278
49
  msgid "Google"
50
  msgstr ""
51
 
52
- #: classes/admin/class-admin.php:301
53
  msgid "Google Ads Conversion ID"
54
  msgstr ""
55
 
56
- #: classes/admin/class-admin.php:313
57
- msgid "Google Ads Purchase Conversion Label"
58
  msgstr ""
59
 
60
- #: classes/admin/class-admin.php:324
61
  msgid "Google Analytics UA"
62
  msgstr ""
63
 
64
- #: classes/admin/class-admin.php:335
65
  msgid "Google Analytics 4"
66
  msgstr ""
67
 
68
- #: classes/admin/class-admin.php:346
69
  msgid "Google Optimize"
70
  msgstr ""
71
 
72
- #: classes/admin/class-admin.php:358
73
- msgid "Meta (Facebook)"
74
  msgstr ""
75
 
76
- #: classes/admin/class-admin.php:381
77
- msgid "Meta (Facebook) pixel ID"
78
  msgstr ""
79
 
80
- #: classes/admin/class-admin.php:393
81
  msgid "more pixels"
82
  msgstr ""
83
 
84
- #: classes/admin/class-admin.php:418
85
  msgid "Microsoft Advertising UET tag ID"
86
  msgstr ""
87
 
88
- #: classes/admin/class-admin.php:430
89
  msgid "Twitter pixel ID"
90
  msgstr ""
91
 
92
- #: classes/admin/class-admin.php:442
93
  msgid "Pinterest pixel ID"
94
  msgstr ""
95
 
96
- #: classes/admin/class-admin.php:454
97
  msgid "Snapchat pixel ID"
98
  msgstr ""
99
 
100
- #: classes/admin/class-admin.php:466
101
  msgid "TikTok pixel ID"
102
  msgstr ""
103
 
104
- #: classes/admin/class-admin.php:479
105
  msgid "Hotjar site ID"
106
  msgstr ""
107
 
108
- #: classes/admin/class-admin.php:491
109
  msgid "Advanced"
110
  msgstr ""
111
 
112
- #: classes/admin/class-admin.php:542
113
  msgid "Order Total Logic"
114
  msgstr ""
115
 
116
- #: classes/admin/class-admin.php:554
117
  msgid "Order Duplication Prevention"
118
  msgstr ""
119
 
120
- #: classes/admin/class-admin.php:566
121
  msgid "Maximum Compatibility Mode"
122
  msgstr ""
123
 
124
- #: classes/admin/class-admin.php:580
125
- msgid "Disable Tracking for User Roles"
126
  msgstr ""
127
 
128
- #: classes/admin/class-admin.php:614
129
  msgid "Conversion Cart Data"
130
  msgstr ""
131
 
132
- #: classes/admin/class-admin.php:627
133
  msgid "Enhanced E-Commerce"
134
  msgstr ""
135
 
136
- #: classes/admin/class-admin.php:639
137
  msgid "GA 4 API secret"
138
  msgstr ""
139
 
140
- #: classes/admin/class-admin.php:652
141
  msgid "Enhanced Link Attribution"
142
  msgstr ""
143
 
144
- #: classes/admin/class-admin.php:665
145
  msgid "Google User ID"
146
  msgstr ""
147
 
148
- #: classes/admin/class-admin.php:677
149
  msgid "Google Ads Enhanced Conversions"
150
  msgstr ""
151
 
152
- #: classes/admin/class-admin.php:691
153
  msgid "Google Ads Phone Conversion Number"
154
  msgstr ""
155
 
156
- #: classes/admin/class-admin.php:703
157
  msgid "Google Ads Phone Conversion Label"
158
  msgstr ""
159
 
160
- #: classes/admin/class-admin.php:716
161
  msgid "Cookie Consent Management"
162
  msgstr ""
163
 
164
- #: classes/admin/class-admin.php:739
165
  msgid "Google Consent Mode"
166
  msgstr ""
167
 
168
- #: classes/admin/class-admin.php:751
169
  msgid "Google Consent Regions"
170
  msgstr ""
171
 
172
- #: classes/admin/class-admin.php:763
173
  msgid "Explicit Consent Mode"
174
  msgstr ""
175
 
176
- #: classes/admin/class-admin.php:776
177
  msgid "Borlabs Cookie support"
178
  msgstr ""
179
 
180
- #: classes/admin/class-admin.php:790
 
181
  msgid "Cookiebot support"
182
  msgstr ""
183
 
184
- #: classes/admin/class-admin.php:804
185
  msgid "Complianz GDPR support"
186
  msgstr ""
187
 
188
- #: classes/admin/class-admin.php:818
189
  msgid "Cookie Notice support"
190
  msgstr ""
191
 
192
- #: classes/admin/class-admin.php:832
193
  msgid "Cookie Script support"
194
  msgstr ""
195
 
196
- #: classes/admin/class-admin.php:846
197
  msgid "GDPR Cookie Compliance support"
198
  msgstr ""
199
 
200
- #: classes/admin/class-admin.php:860
201
  msgid "GDPR Cookie Consent support"
202
  msgstr ""
203
 
204
- #: classes/admin/class-admin.php:893
205
- msgid "Meta (Facebook) CAPI: token"
206
  msgstr ""
207
 
208
- #: classes/admin/class-admin.php:905
209
- msgid "Meta (Facebook) CAPI: process anonymous hits"
210
  msgstr ""
211
 
212
- #: classes/admin/class-admin.php:917
213
- msgid "Meta (Facebook) CAPI: send additional visitor identifiers"
214
  msgstr ""
215
 
216
- #: classes/admin/class-admin.php:929
217
- msgid "Meta (Facebook) Microdata Tags for Catalogues"
218
  msgstr ""
219
 
220
- #: classes/admin/class-admin.php:941
221
- #: classes/admin/class-admin.php:954
222
- #: classes/admin/class-admin.php:965
223
  msgid "Dynamic Remarketing"
224
  msgstr ""
225
 
226
- #: classes/admin/class-admin.php:977
227
  msgid "Product Identifier"
228
  msgstr ""
229
 
230
- #: classes/admin/class-admin.php:989
231
  msgid "Variations output"
232
  msgstr ""
233
 
234
- #: classes/admin/class-admin.php:1002
235
  msgid "Google Business Vertical"
236
  msgstr ""
237
 
238
- #: classes/admin/class-admin.php:1015
239
- #: classes/admin/class-admin.php:1024
240
  msgid "Support"
241
  msgstr ""
242
 
243
- #: classes/admin/class-admin.php:1032
244
- #: classes/admin/class-admin.php:1042
245
  msgid "Author"
246
  msgstr ""
247
 
248
- #: classes/admin/class-admin.php:1078
249
  msgid ""
250
  "It looks like you are using some sort of ad or script blocker which is blocking the script and CSS files of this plugin.\n"
251
  " In order for the plugin to work properly you need to disable the script blocker."
252
  msgstr ""
253
 
254
- #: classes/admin/class-admin.php:1085
255
  #: classes/admin/class-notifications.php:31
256
  #: classes/admin/class-notifications.php:73
257
  #: classes/admin/class-notifications.php:114
@@ -259,413 +260,449 @@ msgstr ""
259
  msgid "Learn more"
260
  msgstr ""
261
 
262
- #: classes/admin/class-admin.php:1130
263
  msgid "Profit Driven Marketing by SweetCode"
264
  msgstr ""
265
 
266
- #: classes/admin/class-admin.php:1155
267
  msgid "Visit us here:"
268
  msgstr ""
269
 
270
- #: classes/admin/class-admin.php:1200
271
  msgid "Contacting Support"
272
  msgstr ""
273
 
274
- #: classes/admin/class-admin.php:1214
275
  msgid "Debug Information"
276
  msgstr ""
277
 
278
- #: classes/admin/class-admin.php:1223
279
  msgid "copy to clipboard"
280
  msgstr ""
281
 
282
- #: classes/admin/class-admin.php:1237
283
  msgid "Translations"
284
  msgstr ""
285
 
286
- #: classes/admin/class-admin.php:1238
287
  msgid "If you want to participate improving the translations of this plugin into your language, please follow this link:"
288
  msgstr ""
289
 
290
- #: classes/admin/class-admin.php:1256
291
  msgid "Post a support request in the WordPress support forum here: "
292
  msgstr ""
293
 
294
- #: classes/admin/class-admin.php:1259
295
  msgid "Support forum"
296
  msgstr ""
297
 
298
- #: classes/admin/class-admin.php:1263
299
  msgid "(Never post the debug or other sensitive information to the support forum. Instead send us the information by email.)"
300
  msgstr ""
301
 
302
- #: classes/admin/class-admin.php:1266
303
  msgid "Or send us an email to the following address: "
304
  msgstr ""
305
 
306
- #: classes/admin/class-admin.php:1282
307
  msgid "Send us your support request through the WooCommerce.com dashboard: "
308
  msgstr ""
309
 
310
- #: classes/admin/class-admin.php:1296
311
  msgid "More details about the developer of this plugin: "
312
  msgstr ""
313
 
314
- #: classes/admin/class-admin.php:1299
315
  msgid "Developer: SweetCode"
316
  msgstr ""
317
 
318
- #: classes/admin/class-admin.php:1301
319
  msgid "Website: "
320
  msgstr ""
321
 
322
- #: classes/admin/class-admin.php:1324
323
  msgid "The Google Analytics Universal property ID looks like this:"
324
  msgstr ""
325
 
326
- #: classes/admin/class-admin.php:1340
327
  msgid "The Google Analytics 4 measurement ID looks like this:"
328
  msgstr ""
329
 
330
- #: classes/admin/class-admin.php:1356
331
  msgid "The conversion ID looks similar to this:"
332
  msgstr ""
333
 
334
- #: classes/admin/class-admin.php:1372
335
- msgid "The purchase conversion label looks similar to this:"
336
  msgstr ""
337
 
338
- #: classes/admin/class-admin.php:1376
339
- #: classes/admin/class-admin.php:2103
340
  msgid "Requires an active Google Ads Conversion ID"
341
  msgstr ""
342
 
343
- #: classes/admin/class-admin.php:1394
344
  msgid "The Google Optimize container ID looks like this:"
345
  msgstr ""
346
 
347
- #: classes/admin/class-admin.php:1410
348
- msgid "The Meta (Facebook) pixel ID looks similar to this:"
349
  msgstr ""
350
 
351
- #: classes/admin/class-admin.php:1428
352
  msgid "The Microsoft Advertising UET tag ID looks similar to this:"
353
  msgstr ""
354
 
355
- #: classes/admin/class-admin.php:1447
356
  msgid "The Twitter pixel ID looks similar to this:"
357
  msgstr ""
358
 
359
- #: classes/admin/class-admin.php:1466
360
  msgid "The Pinterest pixel ID looks similar to this:"
361
  msgstr ""
362
 
363
- #: classes/admin/class-admin.php:1485
364
  msgid "The Snapchat pixel ID looks similar to this:"
365
  msgstr ""
366
 
367
- #: classes/admin/class-admin.php:1504
368
  msgid "The TikTok pixel ID looks similar to this:"
369
  msgstr ""
370
 
371
- #: classes/admin/class-admin.php:1516
372
  msgid "The Hotjar site ID looks similar to this:"
373
  msgstr ""
374
 
375
- #: classes/admin/class-admin.php:1526
376
  msgid "Use order_subtotal: Doesn't include tax and shipping (default)"
377
  msgstr ""
378
 
379
- #: classes/admin/class-admin.php:1533
380
  msgid "Use order_total: Includes tax and shipping"
381
  msgstr ""
382
 
383
- #: classes/admin/class-admin.php:1536
384
  msgid "This is the order total amount reported back to Google Ads"
385
  msgstr ""
386
 
387
- #: classes/admin/class-admin.php:1556
388
  msgid "open the documentation"
389
  msgstr ""
390
 
391
- #: classes/admin/class-admin.php:1576
 
 
 
 
 
 
 
 
 
 
 
 
392
  msgid "Enable Google consent mode with standard settings"
393
  msgstr ""
394
 
395
- #: classes/admin/class-admin.php:1614
396
  msgid "If no region is set, then the restrictions are enabled for all regions. If you specify one or more regions, then the restrictions only apply for the specified regions."
397
  msgstr ""
398
 
399
- #: classes/admin/class-admin.php:1635
400
  msgid "Enable Google Analytics enhanced e-commerce"
401
  msgstr ""
402
 
403
- #: classes/admin/class-admin.php:1646
404
- #: classes/admin/class-admin.php:1707
405
- #: classes/admin/class-admin.php:1737
406
  msgid "You need to activate at least Google Analytics UA or Google Analytics 4"
407
  msgstr ""
408
 
409
- #: classes/admin/class-admin.php:1668
410
  msgid "Google Analytics 4 activation required"
411
  msgstr ""
412
 
413
- #: classes/admin/class-admin.php:1673
414
  msgid "Enhanced E-Commerce activation required"
415
  msgstr ""
416
 
417
- #: classes/admin/class-admin.php:1676
418
  msgid "If enabled, purchase and refund events will be sent to Google through the measurement protocol for increased accuracy."
419
  msgstr ""
420
 
421
- #: classes/admin/class-admin.php:1691
422
  msgid "Enable Google Analytics enhanced link attribution"
423
  msgstr ""
424
 
425
- #: classes/admin/class-admin.php:1726
426
  msgid "Enable Google user ID"
427
  msgstr ""
428
 
429
- #: classes/admin/class-admin.php:1756
430
  msgid "Enable Google Ads Enhanced Conversions"
431
  msgstr ""
432
 
433
- #: classes/admin/class-admin.php:1767
434
  msgid "You need to activate Google Ads"
435
  msgstr ""
436
 
437
- #: classes/admin/class-admin.php:1787
438
  msgid "The Google Ads phone conversion number must be in the same format as on the website."
439
  msgstr ""
440
 
441
- #: classes/admin/class-admin.php:1809
442
  msgid "Borlabs Cookie detected. Automatic support is:"
443
  msgstr ""
444
 
445
- #: classes/admin/class-admin.php:1815
446
  msgid "Cookiebot detected. Automatic support is:"
447
  msgstr ""
448
 
449
- #: classes/admin/class-admin.php:1821
 
 
 
 
 
 
 
 
450
  msgid "Complianz GDPR detected. Automatic support is:"
451
  msgstr ""
452
 
453
- #: classes/admin/class-admin.php:1827
454
  msgid "Cookie Notice (by hu-manity.co) detected. Automatic support is:"
455
  msgstr ""
456
 
457
- #: classes/admin/class-admin.php:1833
458
  msgid "Cookie Script (by cookie-script.com) detected. Automatic support is:"
459
  msgstr ""
460
 
461
- #: classes/admin/class-admin.php:1839
462
  msgid "GDPR Cookie Compliance (by Moove Agency) detected. Automatic support is:"
463
  msgstr ""
464
 
465
- #: classes/admin/class-admin.php:1845
466
  msgid "GDPR Cookie Consent (by WebToffee) detected. Automatic support is:"
467
  msgstr ""
468
 
469
- #: classes/admin/class-admin.php:1864
470
  msgid "Enable Explicit Consent Mode"
471
  msgstr ""
472
 
473
- #: classes/admin/class-admin.php:1873
474
  msgid "Only activate the Explicit Consent Mode if you are also using a Cookie Management Platform (a cookie banner) that is compatible with this plugin. Find a list of compatible plugins in the documentation."
475
  msgstr ""
476
 
477
- #: classes/admin/class-admin.php:1892
478
- #: classes/admin/class-admin.php:1925
479
- #: classes/admin/class-admin.php:1954
480
- #: classes/admin/class-admin.php:1982
481
- msgid "You need to activate the Meta (Facebook) pixel"
482
  msgstr ""
483
 
484
- #: classes/admin/class-admin.php:1916
485
- msgid "Send CAPI hits for anonymous visitors who likely have blocked the Meta (Facebook) pixel."
486
  msgstr ""
487
 
488
- #: classes/admin/class-admin.php:1945
489
  msgid "Include additional visitor's identifiers, such as IP address, email and shop ID in the CAPI hit."
490
  msgstr ""
491
 
492
- #: classes/admin/class-admin.php:1973
493
- msgid "Enable Meta (Facebook) product microdata output"
 
 
 
 
 
 
 
 
494
  msgstr ""
495
 
496
- #: classes/admin/class-admin.php:2009
497
  msgid "Only disable order duplication prevention for testing. Remember to re-enable the setting once done."
498
  msgstr ""
499
 
500
- #: classes/admin/class-admin.php:2026
501
  msgid "Enable the maximum compatibility mode"
502
  msgstr ""
503
 
504
- #: classes/admin/class-admin.php:2062
505
  msgid "Advanced order duplication prevention is "
506
  msgstr ""
507
 
508
- #: classes/admin/class-admin.php:2064
509
  msgid "Basic order duplication prevention is "
510
  msgstr ""
511
 
512
- #: classes/admin/class-admin.php:2088
513
  msgid "Enable dynamic remarketing audience collection"
514
  msgstr ""
515
 
516
- #: classes/admin/class-admin.php:2109
517
  msgid "You need to choose the correct product identifier setting in order to match the product identifiers in the product feeds."
518
  msgstr ""
519
 
520
- #: classes/admin/class-admin.php:2127
521
  msgid "Enable variations output"
522
  msgstr ""
523
 
524
- #: classes/admin/class-admin.php:2138
525
  msgid "In order for this to work you need to upload your product feed including product variations and the item_group_id. Disable it, if you choose only to upload the parent product for variable products."
526
  msgstr ""
527
 
528
- #: classes/admin/class-admin.php:2153
529
  msgid "Retail"
530
  msgstr ""
531
 
532
- #: classes/admin/class-admin.php:2163
533
  msgid "Education"
534
  msgstr ""
535
 
536
- #: classes/admin/class-admin.php:2173
537
  msgid "Hotels and rentals"
538
  msgstr ""
539
 
540
- #: classes/admin/class-admin.php:2183
541
  msgid "Jobs"
542
  msgstr ""
543
 
544
- #: classes/admin/class-admin.php:2193
545
  msgid "Local deals"
546
  msgstr ""
547
 
548
- #: classes/admin/class-admin.php:2203
549
  msgid "Real estate"
550
  msgstr ""
551
 
552
- #: classes/admin/class-admin.php:2213
553
  msgid "Custom"
554
  msgstr ""
555
 
556
- #: classes/admin/class-admin.php:2232
557
  msgid "ID of your Google Merchant Center account. It looks like this: 12345678"
558
  msgstr ""
559
 
560
- #: classes/admin/class-admin.php:2241
 
 
 
 
 
 
 
 
561
  msgid "post ID (default)"
562
  msgstr ""
563
 
564
- #: classes/admin/class-admin.php:2247
565
  msgid "SKU"
566
  msgstr ""
567
 
568
- #: classes/admin/class-admin.php:2254
569
  msgid "ID for the WooCommerce Google Product Feed. Outputs the post ID with woocommerce_gpf_ prefix *"
570
  msgstr ""
571
 
572
- #: classes/admin/class-admin.php:2261
573
  msgid "ID for the WooCommerce Google Listings & Ads Plugin. Outputs the post ID with gla_ prefix **"
574
  msgstr ""
575
 
576
- #: classes/admin/class-admin.php:2265
577
  msgid "Choose a product identifier."
578
  msgstr ""
579
 
580
- #: classes/admin/class-admin.php:2268
581
  msgid "* This is for users of the WooCommerce Google Product Feed Plugin"
582
  msgstr ""
583
 
584
- #: classes/admin/class-admin.php:2272
585
  msgid "** This is for users of the WooCommerce Google Listings & Ads Plugin"
586
  msgstr ""
587
 
588
- #: classes/admin/class-admin.php:2281
589
  msgid "beta"
590
  msgstr ""
591
 
592
- #: classes/admin/class-admin.php:2285
593
- #: classes/admin/class-admin.php:2290
594
  msgid "active"
595
  msgstr ""
596
 
597
- #: classes/admin/class-admin.php:2295
598
- #: classes/admin/class-admin.php:2300
599
  msgid "inactive"
600
  msgstr ""
601
 
602
- #: classes/admin/class-admin.php:2305
603
- #: classes/admin/class-admin.php:2310
604
  msgid "partially active"
605
  msgstr ""
606
 
607
- #: classes/admin/class-admin.php:2321
608
  msgid "Pro Feature"
609
  msgstr ""
610
 
611
- #: classes/admin/class-admin.php:2365
612
  msgid "You have entered an invalid Google Analytics Universal property ID."
613
  msgstr ""
614
 
615
- #: classes/admin/class-admin.php:2373
616
  msgid "You have entered an invalid Google Analytics 4 measurement ID."
617
  msgstr ""
618
 
619
- #: classes/admin/class-admin.php:2381
620
  msgid "You have entered an invalid Google Analytics 4 API key."
621
  msgstr ""
622
 
623
- #: classes/admin/class-admin.php:2389
624
  msgid "You have entered an invalid conversion ID. It only contains 8 to 10 digits."
625
  msgstr ""
626
 
627
- #: classes/admin/class-admin.php:2397
628
- #: classes/admin/class-admin.php:2405
629
  msgid "You have entered an invalid conversion label."
630
  msgstr ""
631
 
632
- #: classes/admin/class-admin.php:2413
633
  msgid "You have entered an invalid merchant ID. It only contains 7 to 10 digits."
634
  msgstr ""
635
 
636
- #: classes/admin/class-admin.php:2421
637
  msgid "You have entered an invalid Google Optimize container ID."
638
  msgstr ""
639
 
640
- #: classes/admin/class-admin.php:2429
641
- msgid "You have entered an invalid Meta (Facebook) pixel ID. It only contains 14 to 16 digits."
642
  msgstr ""
643
 
644
- #: classes/admin/class-admin.php:2437
645
- msgid "You have entered an invalid Meta (Facebook) CAPI token."
646
  msgstr ""
647
 
648
- #: classes/admin/class-admin.php:2445
649
  msgid "You have entered an invalid Bing Ads UET tag ID. It only contains 7 to 9 digits."
650
  msgstr ""
651
 
652
- #: classes/admin/class-admin.php:2453
653
  msgid "You have entered an invalid Twitter pixel ID. It only contains 5 to 7 lowercase letters and numbers."
654
  msgstr ""
655
 
656
- #: classes/admin/class-admin.php:2461
657
  msgid "You have entered an invalid Pinterest pixel ID. It only contains 13 digits."
658
  msgstr ""
659
 
660
- #: classes/admin/class-admin.php:2469
661
  msgid "You have entered an invalid Snapchat pixel ID."
662
  msgstr ""
663
 
664
- #: classes/admin/class-admin.php:2477
665
  msgid "You have entered an invalid TikTok pixel ID."
666
  msgstr ""
667
 
668
- #: classes/admin/class-admin.php:2485
669
  msgid "You have entered an invalid Hotjar site ID. It only contains 6 to 9 digits."
670
  msgstr ""
671
 
@@ -762,14 +799,14 @@ msgstr ""
762
  msgid "Find more information about the the reason in our documentation: "
763
  msgstr ""
764
 
765
- #: wgact.php:223
766
  msgid "WooCommerce Pixel Manager error"
767
  msgstr ""
768
 
769
- #: wgact.php:225
770
  msgid "Your environment doesn't meet all the system requirements listed below."
771
  msgstr ""
772
 
773
- #: wgact.php:229
774
  msgid "The WooCommerce plugin needs to be activated"
775
  msgstr ""
2
  # This file is distributed under the GNU General Public License v3.0.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Pixel Manager 1.13.2-beta.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/src\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-02-09T10:32:00+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: woocommerce-google-adwords-conversion-tracking-tag\n"
16
 
17
  #. Plugin Name of the plugin
18
+ #: wgact.php:197
19
+ #: wgact.php:198
20
  msgid "WooCommerce Pixel Manager"
21
  msgstr ""
22
 
33
  msgstr ""
34
 
35
  #. Author URI of the plugin
36
+ msgid "https://sweetcode.co"
37
  msgstr ""
38
 
39
+ #: classes/admin/class-admin.php:189
40
+ #: classes/admin/class-admin.php:190
41
  msgid "Pixel Manager"
42
  msgstr ""
43
 
44
+ #: classes/admin/class-admin.php:214
45
  msgid "Main"
46
  msgstr ""
47
 
48
+ #: classes/admin/class-admin.php:235
49
  msgid "Google"
50
  msgstr ""
51
 
52
+ #: classes/admin/class-admin.php:258
53
  msgid "Google Ads Conversion ID"
54
  msgstr ""
55
 
56
+ #: classes/admin/class-admin.php:270
57
+ msgid "Google Ads Conversion Label"
58
  msgstr ""
59
 
60
+ #: classes/admin/class-admin.php:281
61
  msgid "Google Analytics UA"
62
  msgstr ""
63
 
64
+ #: classes/admin/class-admin.php:292
65
  msgid "Google Analytics 4"
66
  msgstr ""
67
 
68
+ #: classes/admin/class-admin.php:303
69
  msgid "Google Optimize"
70
  msgstr ""
71
 
72
+ #: classes/admin/class-admin.php:315
73
+ msgid "Facebook"
74
  msgstr ""
75
 
76
+ #: classes/admin/class-admin.php:338
77
+ msgid "Facebook pixel ID"
78
  msgstr ""
79
 
80
+ #: classes/admin/class-admin.php:350
81
  msgid "more pixels"
82
  msgstr ""
83
 
84
+ #: classes/admin/class-admin.php:375
85
  msgid "Microsoft Advertising UET tag ID"
86
  msgstr ""
87
 
88
+ #: classes/admin/class-admin.php:387
89
  msgid "Twitter pixel ID"
90
  msgstr ""
91
 
92
+ #: classes/admin/class-admin.php:399
93
  msgid "Pinterest pixel ID"
94
  msgstr ""
95
 
96
+ #: classes/admin/class-admin.php:411
97
  msgid "Snapchat pixel ID"
98
  msgstr ""
99
 
100
+ #: classes/admin/class-admin.php:423
101
  msgid "TikTok pixel ID"
102
  msgstr ""
103
 
104
+ #: classes/admin/class-admin.php:436
105
  msgid "Hotjar site ID"
106
  msgstr ""
107
 
108
+ #: classes/admin/class-admin.php:448
109
  msgid "Advanced"
110
  msgstr ""
111
 
112
+ #: classes/admin/class-admin.php:499
113
  msgid "Order Total Logic"
114
  msgstr ""
115
 
116
+ #: classes/admin/class-admin.php:511
117
  msgid "Order Duplication Prevention"
118
  msgstr ""
119
 
120
+ #: classes/admin/class-admin.php:523
121
  msgid "Maximum Compatibility Mode"
122
  msgstr ""
123
 
124
+ #: classes/admin/class-admin.php:556
125
+ msgid "gtag Deactivation"
126
  msgstr ""
127
 
128
+ #: classes/admin/class-admin.php:569
129
  msgid "Conversion Cart Data"
130
  msgstr ""
131
 
132
+ #: classes/admin/class-admin.php:582
133
  msgid "Enhanced E-Commerce"
134
  msgstr ""
135
 
136
+ #: classes/admin/class-admin.php:594
137
  msgid "GA 4 API secret"
138
  msgstr ""
139
 
140
+ #: classes/admin/class-admin.php:607
141
  msgid "Enhanced Link Attribution"
142
  msgstr ""
143
 
144
+ #: classes/admin/class-admin.php:620
145
  msgid "Google User ID"
146
  msgstr ""
147
 
148
+ #: classes/admin/class-admin.php:632
149
  msgid "Google Ads Enhanced Conversions"
150
  msgstr ""
151
 
152
+ #: classes/admin/class-admin.php:646
153
  msgid "Google Ads Phone Conversion Number"
154
  msgstr ""
155
 
156
+ #: classes/admin/class-admin.php:658
157
  msgid "Google Ads Phone Conversion Label"
158
  msgstr ""
159
 
160
+ #: classes/admin/class-admin.php:671
161
  msgid "Cookie Consent Management"
162
  msgstr ""
163
 
164
+ #: classes/admin/class-admin.php:694
165
  msgid "Google Consent Mode"
166
  msgstr ""
167
 
168
+ #: classes/admin/class-admin.php:706
169
  msgid "Google Consent Regions"
170
  msgstr ""
171
 
172
+ #: classes/admin/class-admin.php:718
173
  msgid "Explicit Consent Mode"
174
  msgstr ""
175
 
176
+ #: classes/admin/class-admin.php:731
177
  msgid "Borlabs Cookie support"
178
  msgstr ""
179
 
180
+ #: classes/admin/class-admin.php:745
181
+ #: classes/admin/class-admin.php:759
182
  msgid "Cookiebot support"
183
  msgstr ""
184
 
185
+ #: classes/admin/class-admin.php:773
186
  msgid "Complianz GDPR support"
187
  msgstr ""
188
 
189
+ #: classes/admin/class-admin.php:787
190
  msgid "Cookie Notice support"
191
  msgstr ""
192
 
193
+ #: classes/admin/class-admin.php:801
194
  msgid "Cookie Script support"
195
  msgstr ""
196
 
197
+ #: classes/admin/class-admin.php:815
198
  msgid "GDPR Cookie Compliance support"
199
  msgstr ""
200
 
201
+ #: classes/admin/class-admin.php:829
202
  msgid "GDPR Cookie Consent support"
203
  msgstr ""
204
 
205
+ #: classes/admin/class-admin.php:862
206
+ msgid "Facebook CAPI: token"
207
  msgstr ""
208
 
209
+ #: classes/admin/class-admin.php:874
210
+ msgid "Facebook CAPI: process anonymous hits"
211
  msgstr ""
212
 
213
+ #: classes/admin/class-admin.php:886
214
+ msgid "Facebook CAPI: send additional visitor identifiers"
215
  msgstr ""
216
 
217
+ #: classes/admin/class-admin.php:898
218
+ msgid "Facebook Microdata Tags for Catalogues"
219
  msgstr ""
220
 
221
+ #: classes/admin/class-admin.php:910
222
+ #: classes/admin/class-admin.php:923
223
+ #: classes/admin/class-admin.php:970
224
  msgid "Dynamic Remarketing"
225
  msgstr ""
226
 
227
+ #: classes/admin/class-admin.php:982
228
  msgid "Product Identifier"
229
  msgstr ""
230
 
231
+ #: classes/admin/class-admin.php:994
232
  msgid "Variations output"
233
  msgstr ""
234
 
235
+ #: classes/admin/class-admin.php:1007
236
  msgid "Google Business Vertical"
237
  msgstr ""
238
 
239
+ #: classes/admin/class-admin.php:1020
240
+ #: classes/admin/class-admin.php:1029
241
  msgid "Support"
242
  msgstr ""
243
 
244
+ #: classes/admin/class-admin.php:1037
245
+ #: classes/admin/class-admin.php:1047
246
  msgid "Author"
247
  msgstr ""
248
 
249
+ #: classes/admin/class-admin.php:1083
250
  msgid ""
251
  "It looks like you are using some sort of ad or script blocker which is blocking the script and CSS files of this plugin.\n"
252
  " In order for the plugin to work properly you need to disable the script blocker."
253
  msgstr ""
254
 
255
+ #: classes/admin/class-admin.php:1090
256
  #: classes/admin/class-notifications.php:31
257
  #: classes/admin/class-notifications.php:73
258
  #: classes/admin/class-notifications.php:114
260
  msgid "Learn more"
261
  msgstr ""
262
 
263
+ #: classes/admin/class-admin.php:1135
264
  msgid "Profit Driven Marketing by SweetCode"
265
  msgstr ""
266
 
267
+ #: classes/admin/class-admin.php:1160
268
  msgid "Visit us here:"
269
  msgstr ""
270
 
271
+ #: classes/admin/class-admin.php:1205
272
  msgid "Contacting Support"
273
  msgstr ""
274
 
275
+ #: classes/admin/class-admin.php:1219
276
  msgid "Debug Information"
277
  msgstr ""
278
 
279
+ #: classes/admin/class-admin.php:1228
280
  msgid "copy to clipboard"
281
  msgstr ""
282
 
283
+ #: classes/admin/class-admin.php:1242
284
  msgid "Translations"
285
  msgstr ""
286
 
287
+ #: classes/admin/class-admin.php:1243
288
  msgid "If you want to participate improving the translations of this plugin into your language, please follow this link:"
289
  msgstr ""
290
 
291
+ #: classes/admin/class-admin.php:1261
292
  msgid "Post a support request in the WordPress support forum here: "
293
  msgstr ""
294
 
295
+ #: classes/admin/class-admin.php:1264
296
  msgid "Support forum"
297
  msgstr ""
298
 
299
+ #: classes/admin/class-admin.php:1268
300
  msgid "(Never post the debug or other sensitive information to the support forum. Instead send us the information by email.)"
301
  msgstr ""
302
 
303
+ #: classes/admin/class-admin.php:1271
304
  msgid "Or send us an email to the following address: "
305
  msgstr ""
306
 
307
+ #: classes/admin/class-admin.php:1287
308
  msgid "Send us your support request through the WooCommerce.com dashboard: "
309
  msgstr ""
310
 
311
+ #: classes/admin/class-admin.php:1301
312
  msgid "More details about the developer of this plugin: "
313
  msgstr ""
314
 
315
+ #: classes/admin/class-admin.php:1304
316
  msgid "Developer: SweetCode"
317
  msgstr ""
318
 
319
+ #: classes/admin/class-admin.php:1306
320
  msgid "Website: "
321
  msgstr ""
322
 
323
+ #: classes/admin/class-admin.php:1329
324
  msgid "The Google Analytics Universal property ID looks like this:"
325
  msgstr ""
326
 
327
+ #: classes/admin/class-admin.php:1345
328
  msgid "The Google Analytics 4 measurement ID looks like this:"
329
  msgstr ""
330
 
331
+ #: classes/admin/class-admin.php:1361
332
  msgid "The conversion ID looks similar to this:"
333
  msgstr ""
334
 
335
+ #: classes/admin/class-admin.php:1377
336
+ msgid "The conversion Label looks similar to this:"
337
  msgstr ""
338
 
339
+ #: classes/admin/class-admin.php:1381
340
+ #: classes/admin/class-admin.php:2161
341
  msgid "Requires an active Google Ads Conversion ID"
342
  msgstr ""
343
 
344
+ #: classes/admin/class-admin.php:1399
345
  msgid "The Google Optimize container ID looks like this:"
346
  msgstr ""
347
 
348
+ #: classes/admin/class-admin.php:1415
349
+ msgid "The Facebook pixel ID looks similar to this:"
350
  msgstr ""
351
 
352
+ #: classes/admin/class-admin.php:1433
353
  msgid "The Microsoft Advertising UET tag ID looks similar to this:"
354
  msgstr ""
355
 
356
+ #: classes/admin/class-admin.php:1452
357
  msgid "The Twitter pixel ID looks similar to this:"
358
  msgstr ""
359
 
360
+ #: classes/admin/class-admin.php:1471
361
  msgid "The Pinterest pixel ID looks similar to this:"
362
  msgstr ""
363
 
364
+ #: classes/admin/class-admin.php:1490
365
  msgid "The Snapchat pixel ID looks similar to this:"
366
  msgstr ""
367
 
368
+ #: classes/admin/class-admin.php:1509
369
  msgid "The TikTok pixel ID looks similar to this:"
370
  msgstr ""
371
 
372
+ #: classes/admin/class-admin.php:1521
373
  msgid "The Hotjar site ID looks similar to this:"
374
  msgstr ""
375
 
376
+ #: classes/admin/class-admin.php:1531
377
  msgid "Use order_subtotal: Doesn't include tax and shipping (default)"
378
  msgstr ""
379
 
380
+ #: classes/admin/class-admin.php:1538
381
  msgid "Use order_total: Includes tax and shipping"
382
  msgstr ""
383
 
384
+ #: classes/admin/class-admin.php:1541
385
  msgid "This is the order total amount reported back to Google Ads"
386
  msgstr ""
387
 
388
+ #: classes/admin/class-admin.php:1561
389
  msgid "open the documentation"
390
  msgstr ""
391
 
392
+ #: classes/admin/class-admin.php:1577
393
+ msgid "Disable gtag.js insertion, if another plugin is inserting it already"
394
+ msgstr ""
395
+
396
+ #: classes/admin/class-admin.php:1583
397
+ msgid "Only do this, if the other plugin does insert the gtag above this pixel. If not, keep the gtag active."
398
+ msgstr ""
399
+
400
+ #: classes/admin/class-admin.php:1587
401
+ msgid "This setting is deprecated. It will be removed in future versions of the plugin. Read more about it in the documentation."
402
+ msgstr ""
403
+
404
+ #: classes/admin/class-admin.php:1605
405
  msgid "Enable Google consent mode with standard settings"
406
  msgstr ""
407
 
408
+ #: classes/admin/class-admin.php:1643
409
  msgid "If no region is set, then the restrictions are enabled for all regions. If you specify one or more regions, then the restrictions only apply for the specified regions."
410
  msgstr ""
411
 
412
+ #: classes/admin/class-admin.php:1664
413
  msgid "Enable Google Analytics enhanced e-commerce"
414
  msgstr ""
415
 
416
+ #: classes/admin/class-admin.php:1675
417
+ #: classes/admin/class-admin.php:1736
418
+ #: classes/admin/class-admin.php:1766
419
  msgid "You need to activate at least Google Analytics UA or Google Analytics 4"
420
  msgstr ""
421
 
422
+ #: classes/admin/class-admin.php:1697
423
  msgid "Google Analytics 4 activation required"
424
  msgstr ""
425
 
426
+ #: classes/admin/class-admin.php:1702
427
  msgid "Enhanced E-Commerce activation required"
428
  msgstr ""
429
 
430
+ #: classes/admin/class-admin.php:1705
431
  msgid "If enabled, purchase and refund events will be sent to Google through the measurement protocol for increased accuracy."
432
  msgstr ""
433
 
434
+ #: classes/admin/class-admin.php:1720
435
  msgid "Enable Google Analytics enhanced link attribution"
436
  msgstr ""
437
 
438
+ #: classes/admin/class-admin.php:1755
439
  msgid "Enable Google user ID"
440
  msgstr ""
441
 
442
+ #: classes/admin/class-admin.php:1785
443
  msgid "Enable Google Ads Enhanced Conversions"
444
  msgstr ""
445
 
446
+ #: classes/admin/class-admin.php:1796
447
  msgid "You need to activate Google Ads"
448
  msgstr ""
449
 
450
+ #: classes/admin/class-admin.php:1816
451
  msgid "The Google Ads phone conversion number must be in the same format as on the website."
452
  msgstr ""
453
 
454
+ #: classes/admin/class-admin.php:1838
455
  msgid "Borlabs Cookie detected. Automatic support is:"
456
  msgstr ""
457
 
458
+ #: classes/admin/class-admin.php:1844
459
  msgid "Cookiebot detected. Automatic support is:"
460
  msgstr ""
461
 
462
+ #: classes/admin/class-admin.php:1863
463
+ msgid "Enable Cookiebot settings"
464
+ msgstr ""
465
+
466
+ #: classes/admin/class-admin.php:1871
467
+ msgid "You need to activate the Google consent mode"
468
+ msgstr ""
469
+
470
+ #: classes/admin/class-admin.php:1877
471
  msgid "Complianz GDPR detected. Automatic support is:"
472
  msgstr ""
473
 
474
+ #: classes/admin/class-admin.php:1883
475
  msgid "Cookie Notice (by hu-manity.co) detected. Automatic support is:"
476
  msgstr ""
477
 
478
+ #: classes/admin/class-admin.php:1889
479
  msgid "Cookie Script (by cookie-script.com) detected. Automatic support is:"
480
  msgstr ""
481
 
482
+ #: classes/admin/class-admin.php:1895
483
  msgid "GDPR Cookie Compliance (by Moove Agency) detected. Automatic support is:"
484
  msgstr ""
485
 
486
+ #: classes/admin/class-admin.php:1901
487
  msgid "GDPR Cookie Consent (by WebToffee) detected. Automatic support is:"
488
  msgstr ""
489
 
490
+ #: classes/admin/class-admin.php:1920
491
  msgid "Enable Explicit Consent Mode"
492
  msgstr ""
493
 
494
+ #: classes/admin/class-admin.php:1929
495
  msgid "Only activate the Explicit Consent Mode if you are also using a Cookie Management Platform (a cookie banner) that is compatible with this plugin. Find a list of compatible plugins in the documentation."
496
  msgstr ""
497
 
498
+ #: classes/admin/class-admin.php:1948
499
+ #: classes/admin/class-admin.php:1981
500
+ #: classes/admin/class-admin.php:2010
501
+ #: classes/admin/class-admin.php:2038
502
+ msgid "You need to activate the Facebook pixel"
503
  msgstr ""
504
 
505
+ #: classes/admin/class-admin.php:1972
506
+ msgid "Send CAPI hits for anonymous visitors who likely have blocked the Facebook pixel."
507
  msgstr ""
508
 
509
+ #: classes/admin/class-admin.php:2001
510
  msgid "Include additional visitor's identifiers, such as IP address, email and shop ID in the CAPI hit."
511
  msgstr ""
512
 
513
+ #: classes/admin/class-admin.php:2029
514
+ msgid "Enable Facebook product microdata output"
515
+ msgstr ""
516
+
517
+ #: classes/admin/class-admin.php:2054
518
+ msgid "Add the cart data to the conversion event"
519
+ msgstr ""
520
+
521
+ #: classes/admin/class-admin.php:2063
522
+ msgid "Requires an active Google Ads Conversion ID, an active Conversion Label and an active Google Merchant Center ID (aw_merchant_id)"
523
  msgstr ""
524
 
525
+ #: classes/admin/class-admin.php:2092
526
  msgid "Only disable order duplication prevention for testing. Remember to re-enable the setting once done."
527
  msgstr ""
528
 
529
+ #: classes/admin/class-admin.php:2109
530
  msgid "Enable the maximum compatibility mode"
531
  msgstr ""
532
 
533
+ #: classes/admin/class-admin.php:2120
534
  msgid "Advanced order duplication prevention is "
535
  msgstr ""
536
 
537
+ #: classes/admin/class-admin.php:2122
538
  msgid "Basic order duplication prevention is "
539
  msgstr ""
540
 
541
+ #: classes/admin/class-admin.php:2146
542
  msgid "Enable dynamic remarketing audience collection"
543
  msgstr ""
544
 
545
+ #: classes/admin/class-admin.php:2167
546
  msgid "You need to choose the correct product identifier setting in order to match the product identifiers in the product feeds."
547
  msgstr ""
548
 
549
+ #: classes/admin/class-admin.php:2185
550
  msgid "Enable variations output"
551
  msgstr ""
552
 
553
+ #: classes/admin/class-admin.php:2196
554
  msgid "In order for this to work you need to upload your product feed including product variations and the item_group_id. Disable it, if you choose only to upload the parent product for variable products."
555
  msgstr ""
556
 
557
+ #: classes/admin/class-admin.php:2211
558
  msgid "Retail"
559
  msgstr ""
560
 
561
+ #: classes/admin/class-admin.php:2221
562
  msgid "Education"
563
  msgstr ""
564
 
565
+ #: classes/admin/class-admin.php:2231
566
  msgid "Hotels and rentals"
567
  msgstr ""
568
 
569
+ #: classes/admin/class-admin.php:2241
570
  msgid "Jobs"
571
  msgstr ""
572
 
573
+ #: classes/admin/class-admin.php:2251
574
  msgid "Local deals"
575
  msgstr ""
576
 
577
+ #: classes/admin/class-admin.php:2261
578
  msgid "Real estate"
579
  msgstr ""
580
 
581
+ #: classes/admin/class-admin.php:2271
582
  msgid "Custom"
583
  msgstr ""
584
 
585
+ #: classes/admin/class-admin.php:2290
586
  msgid "ID of your Google Merchant Center account. It looks like this: 12345678"
587
  msgstr ""
588
 
589
+ #: classes/admin/class-admin.php:2298
590
+ msgid "Currently the plugin automatically detects the location of the visitor for this setting. In most, if not all, cases this will work fine. Please let us know if you have a use case where you need another output:"
591
+ msgstr ""
592
+
593
+ #: classes/admin/class-admin.php:2336
594
+ msgid "The plugin will use the WordPress default language for this setting. If the shop uses translations, in theory we could also use the visitors locale. But, if that language is not set up in the Google Merchant Center we might run into issues. If you need more options here let us know:"
595
+ msgstr ""
596
+
597
+ #: classes/admin/class-admin.php:2354
598
  msgid "post ID (default)"
599
  msgstr ""
600
 
601
+ #: classes/admin/class-admin.php:2360
602
  msgid "SKU"
603
  msgstr ""
604
 
605
+ #: classes/admin/class-admin.php:2367
606
  msgid "ID for the WooCommerce Google Product Feed. Outputs the post ID with woocommerce_gpf_ prefix *"
607
  msgstr ""
608
 
609
+ #: classes/admin/class-admin.php:2374
610
  msgid "ID for the WooCommerce Google Listings & Ads Plugin. Outputs the post ID with gla_ prefix **"
611
  msgstr ""
612
 
613
+ #: classes/admin/class-admin.php:2378
614
  msgid "Choose a product identifier."
615
  msgstr ""
616
 
617
+ #: classes/admin/class-admin.php:2381
618
  msgid "* This is for users of the WooCommerce Google Product Feed Plugin"
619
  msgstr ""
620
 
621
+ #: classes/admin/class-admin.php:2385
622
  msgid "** This is for users of the WooCommerce Google Listings & Ads Plugin"
623
  msgstr ""
624
 
625
+ #: classes/admin/class-admin.php:2394
626
  msgid "beta"
627
  msgstr ""
628
 
629
+ #: classes/admin/class-admin.php:2398
630
+ #: classes/admin/class-admin.php:2403
631
  msgid "active"
632
  msgstr ""
633
 
634
+ #: classes/admin/class-admin.php:2408
635
+ #: classes/admin/class-admin.php:2413
636
  msgid "inactive"
637
  msgstr ""
638
 
639
+ #: classes/admin/class-admin.php:2418
640
+ #: classes/admin/class-admin.php:2423
641
  msgid "partially active"
642
  msgstr ""
643
 
644
+ #: classes/admin/class-admin.php:2434
645
  msgid "Pro Feature"
646
  msgstr ""
647
 
648
+ #: classes/admin/class-admin.php:2478
649
  msgid "You have entered an invalid Google Analytics Universal property ID."
650
  msgstr ""
651
 
652
+ #: classes/admin/class-admin.php:2486
653
  msgid "You have entered an invalid Google Analytics 4 measurement ID."
654
  msgstr ""
655
 
656
+ #: classes/admin/class-admin.php:2494
657
  msgid "You have entered an invalid Google Analytics 4 API key."
658
  msgstr ""
659
 
660
+ #: classes/admin/class-admin.php:2502
661
  msgid "You have entered an invalid conversion ID. It only contains 8 to 10 digits."
662
  msgstr ""
663
 
664
+ #: classes/admin/class-admin.php:2510
665
+ #: classes/admin/class-admin.php:2518
666
  msgid "You have entered an invalid conversion label."
667
  msgstr ""
668
 
669
+ #: classes/admin/class-admin.php:2526
670
  msgid "You have entered an invalid merchant ID. It only contains 7 to 10 digits."
671
  msgstr ""
672
 
673
+ #: classes/admin/class-admin.php:2534
674
  msgid "You have entered an invalid Google Optimize container ID."
675
  msgstr ""
676
 
677
+ #: classes/admin/class-admin.php:2542
678
+ msgid "You have entered an invalid Facebook pixel ID. It only contains 14 to 16 digits."
679
  msgstr ""
680
 
681
+ #: classes/admin/class-admin.php:2550
682
+ msgid "You have entered an invalid Facebook CAPI token."
683
  msgstr ""
684
 
685
+ #: classes/admin/class-admin.php:2558
686
  msgid "You have entered an invalid Bing Ads UET tag ID. It only contains 7 to 9 digits."
687
  msgstr ""
688
 
689
+ #: classes/admin/class-admin.php:2566
690
  msgid "You have entered an invalid Twitter pixel ID. It only contains 5 to 7 lowercase letters and numbers."
691
  msgstr ""
692
 
693
+ #: classes/admin/class-admin.php:2574
694
  msgid "You have entered an invalid Pinterest pixel ID. It only contains 13 digits."
695
  msgstr ""
696
 
697
+ #: classes/admin/class-admin.php:2582
698
  msgid "You have entered an invalid Snapchat pixel ID."
699
  msgstr ""
700
 
701
+ #: classes/admin/class-admin.php:2590
702
  msgid "You have entered an invalid TikTok pixel ID."
703
  msgstr ""
704
 
705
+ #: classes/admin/class-admin.php:2598
706
  msgid "You have entered an invalid Hotjar site ID. It only contains 6 to 9 digits."
707
  msgstr ""
708
 
799
  msgid "Find more information about the the reason in our documentation: "
800
  msgstr ""
801
 
802
+ #: wgact.php:213
803
  msgid "WooCommerce Pixel Manager error"
804
  msgstr ""
805
 
806
+ #: wgact.php:215
807
  msgid "Your environment doesn't meet all the system requirements listed below."
808
  msgstr ""
809
 
810
+ #: wgact.php:219
811
  msgid "The WooCommerce plugin needs to be activated"
812
  msgstr ""
readme.txt CHANGED
@@ -1,48 +1,48 @@
1
  === WooCommerce Pixel Manager ===
2
  Contributors: alekv, wolfbaer
3
- Tags: woocommerce, google ads, google analytics, facebook pixel, conversion tracking, dynamic retargeting, remarketing, meta pixel, facebook conversion api, woocommerce google, woocommerce facebook
4
  Requires at least: 3.7
5
  Tested up to: 5.9
6
  Requires PHP: 7.3
7
- Stable tag: 1.16.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
11
- Track visitors and conversions in Google Ads, Google Analytics, Meta Pixel (Facebook Pixel), and more !
12
 
13
  == Description ==
14
 
15
  This plugin <strong>tracks WooCommerce shop visitors and collects valuable data for conversion optimization, dynamic remarketing and reporting</strong>.
16
 
17
- While the setup is as simple as it can get, the pixel engine under the hood is very powerful. It tracks all e-commerce events and implements all advanced pixel features like Meta CAPI (Facebook CAPI) (Pro version), Google Enhanced E-Commerce, Google Shopping Cart Item Tracking and much more. For advanced users the plugin offers filters which allow to tweak the output flexibly and fine tune the behavior to each shop.
18
  <strong>What sets us apart from other, similar plugins?</strong>
19
 
20
  Out of many things, probably high tracking accuracy and a simple user interface are the most important properties that set our plugin apart from others.
21
 
22
  Additionally, to the standard features offered by the tracking pixels we've developed more functional layers into the plugin which help increase measurement accuracy. For instance, if the plugin detects problems in the shop setup that might lower or prevent accurate tracking, it either fixes them seamlessly, or shows warnings with guidance on how to fix the problems.
23
 
24
- Read more about the importance of tracking accuracy over [here](https://sweetcode.com/docs/wpm/faq/?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs&utm_content=tracking-accuracy#why-is-tracking-accuracy-so-important).
25
 
26
  <strong>The plugin comes with integrations for:</strong>
27
 
28
- * Google Ads Pixel
29
- * Google Analytics Pixel (Universal and Google Analytics 4)
30
- * Meta Ads Pixel (Facebook Ads Pixel)
31
- * Google Optimize Pixel
32
- * HotJar Pixel
33
- * Microsoft Ads Pixel (Pro version)
34
- * Twitter Ads Pixel (Pro version)
35
- * Pinterest Ads Pixel (Pro version)
36
- * Snapchat Ads Pixel (Pro version)
37
- * TikTok Ads Pixel (Pro version)
38
 
39
  <strong>Highlights</strong>
40
 
41
  * Google Ads Enhanced Conversions (Pro version)
42
- * Meta Conversion API (Facebook Conversion API) (Pro version)
43
  * Google Analytics Enhanced E-Commerce (Pro version)
44
  * Precise measurement by preventing duplicate reporting effectively, excluding admins and shop managers from tracking, and not counting failed payments.
45
- * Collects dynamic remarketing audiences for dynamic retargeting (Google Ads, Meta (Facebook), etc.)
46
  * Google Add Cart Data feature. [Google support page](https://support.google.com/google-ads/answer/9028254)
47
  * Support for various cookie consent management systems
48
 
@@ -52,22 +52,22 @@ Read more about the importance of tracking accuracy over [here](https://sweetcod
52
  * Google Ads Dynamic Remarketing
53
  * Google Ads Cart Item Tracking
54
  * Google Shopping New Customer Parameter
55
- * Google Analytics Universal Pixel (includes purchase tracking)
56
- * Google Analytics 4 Pixel (includes purchase tracking)
57
- * Google Optimize Pixel
58
- * Meta Pixel (Facebook Pixel)
59
- * Meta Remarketing Events (Facebook Remarketing Events)
60
  * Hotjar Pixel
61
  * Basic Order Duplication Prevention
62
  * Many useful filters that help tweak the plugin output
63
  * Works with lazy loaded product lists
64
 
65
- Have a look at the full feature list over [here](https://sweetcode.com/docs/wpm/features).
66
 
67
  <strong>Premium Features</strong>
68
 
69
- * Meta CAPI (Facebook CAPI)
70
- * Meta Microdata Output (Facebook Microdata Output)
71
  * Google Analytics Universal and Google Analytics 4 Enhanced E-Commerce
72
  * Google Consent Mode
73
  * Google Dynamic Remarketing Choice for all Business Verticals
@@ -79,7 +79,7 @@ Have a look at the full feature list over [here](https://sweetcode.com/docs/wpm/
79
  * TikTok Ads Pixel with Purchase and all Remarketing Events
80
  * Advanced Order Duplication Prevention
81
 
82
- Have a look at the full feature list over [here](https://sweetcode.com/docs/wpm/features).
83
 
84
  Are you interested in buying the [Pro version](https://sweetcode.com)? Come and visit us [here](https://sweetcode.com).
85
 
@@ -98,7 +98,7 @@ The plugin supports and works with following third party plugins.
98
 
99
  <strong>Documentation</strong>
100
 
101
- Link to the full documentation of the plugin: [Open the documentation](https://sweetcode.com/docs/wpm/?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs)
102
 
103
  <strong>Roadmap</strong>
104
 
@@ -110,25 +110,19 @@ The plugin uses data from several Cookie Consent Management plugins to manage ap
110
 
111
  It works with the following Cookie Consent Management plugins out of the box:
112
 
113
- * [Cookiebot](https://wordpress.org/plugins/cookiebot/)
114
- * [Cookie Script](https://wordpress.org/plugins/cookie-script-com/)
115
- * [Complianz GDPR/CCPA Cookie Consent](https://wordpress.org/plugins/complianz-gdpr/)
116
  * [Cookie Notice](https://wordpress.org/plugins/cookie-notice/)
117
- * [Cookie Notice & Compliance for GDPR / CCPA](https://wordpress.org/plugins/cookie-notice/)
118
  * [Cookie Law Info](https://wordpress.org/plugins/cookie-law-info/)
119
  * [GDPR Cookie Compliance](https://wordpress.org/plugins/gdpr-cookie-compliance/)
120
  * [Borlabs Cookie](https://borlabs.io/borlabs-cookie/) (from version 2.1.0)
121
- [Borlabs Cookie Setup](https://sweetcode.com/docs/wpm/consent-management/borlabs-cookie?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs&utm_content=borlabs-cookie)
122
-
123
- Please read the following for additional [setup information](https://sweetcode.com/docs/wpm/consent-management/platforms?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs&utm_content=cookie-consent-plugins)
124
 
125
  <strong>Requirements</strong>
126
 
127
- [List of requirements](https://sweetcode.com/docs/wpm/setup/requirements?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs&utm_content=requirements)
128
 
129
  == Installation ==
130
 
131
- 1. Upload the plugin directory into your plugin's directory `/wp-content/plugins/`
132
  2. Activate the plugin through the 'Plugins' menu in WordPress
133
  3. Get the Google Ads conversion ID and the conversion label. You will find both values in the Google Ads conversion tracking code. [Get the conversion ID and the conversion label](https://www.youtube.com/watch?v=p9gY3JSrNHU)
134
  4. In the WordPress admin panel go to WooCommerce and then into the 'Google Ads Conversion Tracking' menu. Please enter the conversion ID and the conversion label into their respective fields.
@@ -137,7 +131,7 @@ Please read the following for additional [setup information](https://sweetcode.c
137
 
138
  = Is there detailed documentation for the plugin? =
139
 
140
- Yes. Head over to this link: [Documentation](https://sweetcode.com/docs/wpm/?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs)
141
 
142
  = How do I check if the plugin is working properly? =
143
 
@@ -177,7 +171,7 @@ Therefore, we recommend admins of the shop to exclude their own shop from the bl
177
 
178
  = Where can I report a bug or suggest improvements? =
179
 
180
- Please post your problem in the WooCommerce Pixel Manager Support forum: http://wordpress.org/support/plugin/woocommerce-google-adwords-conversion-tracking-tag
181
  You can send the link to the front page of your shop too if you think it would be of help.
182
 
183
  == Screenshots ==
@@ -186,102 +180,6 @@ You can send the link to the front page of your shop too if you think it would b
186
 
187
  == Changelog ==
188
 
189
- = 1.16.6 = 11.04.2022
190
-
191
- * Tweak: Safeguard for JavaScript optimizers that ignore the jQuery dependency of WPM and load jQuery after WPM
192
- * Tweak: Refactored the WPM JavaScript library (split code logically and into folders)
193
-
194
- = 1.16.5 = 08.04.2022
195
-
196
- * Tweak: More verbose logging of WPM load and pixel consent status into the dev console
197
- * Tweak: Added new logic to retrieve categories for variations
198
-
199
- = 1.16.4 = 07.04.2022
200
-
201
- * Fix: Fixed a bug that prevented disabling user role tracking
202
-
203
- = 1.16.3 = 07.04.2022
204
-
205
- * Tweak: Remove the IPv6 to IPv4 mapping in case the the external user IP contains one
206
- * Tweak: Improved local IP detection
207
- * Tweak: Replaced deprecated FILTER_SANITIZE_STRING filter with FILTER_SANITIZE_FULL_SPECIAL_CHARS
208
-
209
- = 1.16.2 = 05.04.2022
210
-
211
-
212
- * Fix: Improved detection of users that are deactivated for tracking
213
-
214
- = 1.16.1 = 05.04.2022
215
-
216
- * Tweak: Removed data-cfasync=”false” to allow Cloudflare Rocket Loader to optimize scripts
217
- * Tweak: Removed unused functions
218
- * Tweak: Refactored some code and removed cruft
219
- * Tweak: Improved logic of when to load cart items into the wpm dataLayer
220
- * Tweak: For users, who have been disabled for tracking, prevent tracking entirely, not just for purchase events
221
- * Tweak: Renamed Facebook to Meta
222
- * Tweak: Add log entry when a purchase hit has been prevented because of a user role that has been opted out from tracking
223
-
224
- = 1.16.0 = 01.04.2022
225
-
226
-
227
- * Tweak: Removed a few deprecated and inactive settings
228
- * Tweak: Updated Enhanced Conversions output as per updated specs by Google
229
- * Tweak: Improved formatting for Facebook CAPI event parameters
230
-
231
- = 1.15.5 = 30.03.2022
232
-
233
- * Tweak: Removed an obsolete db cleanup function
234
- * Tweak: On variable products, with no preselection send the valid variation ID if variations output is enabled
235
- * Tweak: Added safeguard for debug info when URL redirect test fails to open the URL
236
- * Tweak: Syntax improvements in wpm.addProductToCart()
237
- * Tweak: Simplified logic when the wpm.getCartItems() function is called
238
- * Tweak: Deprecated the wpm_track_mini_cart filter
239
- * Tweak: Added cookie detection for Cookie Law CMP with French named cookies
240
- * Tweak: Added one more safeguard in case the main wpmDataLayer init is being blocked by some third party plugin and products need being loaded into the wpmDataLayer further down below
241
- * Tweak: Added console log output when pixels don't fire because of user consent choice
242
- * Tweak: Added a payload logger for Facebook CAPI events
243
- * Tweak: Initiate WC session later in the checkout funnel (if necessary at all) to improve caching conditions
244
- * Tweak: Added URL parameter debugConsentMode for verbose debug output in the browser console in relation to user cookie consent
245
-
246
- = 1.15.4 = 23.03.2022
247
-
248
- * Fix: Product name transmission for Google Analytics Universal purchases
249
-
250
- = 1.15.3 = 22.03.2022
251
-
252
- * Tweak: Attach click handlers later during loading in order to better deal with some side cases
253
- * Tweak: Fire viewItem event on variable product pages when no variation is selected yet, sending the ID of the parent product
254
-
255
- = 1.15.2 = 21.03.2022
256
-
257
- * Tweak: Silenced status icon on compatibility mode setting when disabled
258
- * Tweak: Made Autoptimize, FlyingPress, Async JavaScript, Optimocha and WP Optimize JavaScript optimization disabler optional through compatibility mode
259
- * Tweak: Made Litespeed Cache and SG Optimizer JavaScript optimization disabler mostly optional through compatibility mode. Some exclusion have been left permanent without which the tracking scripts would break.
260
- * Fix: Added safeguard if old version of FlyingPress is being used and compatibility mode is enabled
261
- * Fix: Added safeguard if old version of WP Rocket is being used and compatibility mode is enabled
262
- * Fix: Added safeguard if Yoast SEO is being used and compatibility mode is enabled
263
-
264
- = 1.15.1 = 18.03.2022
265
-
266
- * Tweak: Made WP Rocket JavaScript optimization disabler optional through compatibility mode
267
- * Tweak: Adjusted sourcemaps output to make them work with Firefox
268
- * Fix: Proper check for user id when logged in
269
-
270
- = 1.15.0 = 15.03.2022
271
-
272
- * Experiment: Added experimental filter which defers the WPM script. The filter may be removed without prior notice. If you like the filter vote it up over here: https://app.loopedin.io/woocommerce-pixel-manager?card=622f4ba9d0b938002e8378c0
273
- * Experiment: Added experimental filter which moves the WPM script to the footer. The filter may be removed without prior notice. If you like the filter vote it up over here: https://app.loopedin.io/woocommerce-pixel-manager?card=622f4bc2d0b938002e8378e2
274
- * Tweak: Moved sourcemaps into correct folder
275
- * Tweak: Moved parts of the back-end logic to the front-end in order to gain much more flexibility and better handle front-end script flow
276
- * Tweak: Bumped up WC version
277
-
278
-
279
- = 1.14.3 = 24.02.2022
280
-
281
- * Tweak: Adjusted all documentation links to point to new domain and sub-folder
282
- * Tweak: Improved handling with SG Optimizer
283
-
284
-
285
  = 1.14.2 = 17.02.2022
286
 
287
  * Tweak: Added items to Microsoft Ads purchase event
@@ -675,7 +573,7 @@ Fix: Deliver proper updated wpm.jsx
675
 
676
  = 1.8.14 =
677
 
678
- * Tweak: Make the noptimize tag only appear if Autoptimize is active
679
  * Tweak: Removed a duplicate filter
680
  * Fix: Moved get_cart() query into is_cart() condition
681
 
@@ -1015,7 +913,7 @@ Fix: Deliver proper updated wpm.jsx
1015
 
1016
  * Tweak: Switched on JavaScript tracking with a fix for the CDATA bug http://core.trac.wordpress.org/ticket/3670
1017
  * Tweak: The correct function is being used to get the currency depending on the WooCommerce version
1018
- * Fix: Added missing noscript tag
1019
 
1020
  = 1.4.3 =
1021
 
1
  === WooCommerce Pixel Manager ===
2
  Contributors: alekv, wolfbaer
3
+ Tags: woocommerce, google ads, google analytics, facebook pixel, conversion tracking, dynamic retargeting, remarketing, pixel, facebook conversion api, woocommerce google, woocommerce facebook
4
  Requires at least: 3.7
5
  Tested up to: 5.9
6
  Requires PHP: 7.3
7
+ Stable tag: 1.14.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
11
+ Track visitors and conversions in Google Ads, Google Analytics, Facebook Pixel (Conversion API) and more !
12
 
13
  == Description ==
14
 
15
  This plugin <strong>tracks WooCommerce shop visitors and collects valuable data for conversion optimization, dynamic remarketing and reporting</strong>.
16
 
17
+ While the setup is as simple as it can get, the pixel engine under the hood is very powerful. It tracks all e-commerce events and implements all advanced pixel features like Facebook CAPI (Pro version), Google Enhanced E-Commerce, Google Shopping Cart Item Tracking and much more. For advanced users the plugin offers filters which allow to tweak the output flexibly and fine tune the behavior to each shop.
18
  <strong>What sets us apart from other, similar plugins?</strong>
19
 
20
  Out of many things, probably high tracking accuracy and a simple user interface are the most important properties that set our plugin apart from others.
21
 
22
  Additionally, to the standard features offered by the tracking pixels we've developed more functional layers into the plugin which help increase measurement accuracy. For instance, if the plugin detects problems in the shop setup that might lower or prevent accurate tracking, it either fixes them seamlessly, or shows warnings with guidance on how to fix the problems.
23
 
24
+ Read more about the importance of tracking accuracy over [here](https://docs.sweetcode.com/wgact/?utm_source=wordpress.org&utm_medium=wpm-plugin-page&utm_campaign=woocommerce-pixel-manager-docs&utm_content=tracking-accuracy#/faq?id=why-is-tracking-accuracy-so-important).
25
 
26
  <strong>The plugin comes with integrations for:</strong>
27
 
28
+ * Google Ads
29
+ * Google Analytics (Universal and Google Analytics 4)
30
+ * Facebook Ads Pixel
31
+ * Google Optimize
32
+ * HotJar
33
+ * Microsoft Ads (Pro version)
34
+ * Twitter Ads (Pro version)
35
+ * Pinterest Ads (Pro version)
36
+ * Snapchat Ads (Pro version)
37
+ * TikTok Ads (Pro version)
38
 
39
  <strong>Highlights</strong>
40
 
41
  * Google Ads Enhanced Conversions (Pro version)
42
+ * Facebook Conversion API (CAPI) (Pro version)
43
  * Google Analytics Enhanced E-Commerce (Pro version)
44
  * Precise measurement by preventing duplicate reporting effectively, excluding admins and shop managers from tracking, and not counting failed payments.
45
+ * Collects dynamic remarketing audiences for dynamic retargeting (Google Ads, Facebook, etc.)
46
  * Google Add Cart Data feature. [Google support page](https://support.google.com/google-ads/answer/9028254)
47
  * Support for various cookie consent management systems
48
 
52
  * Google Ads Dynamic Remarketing
53
  * Google Ads Cart Item Tracking
54
  * Google Shopping New Customer Parameter
55
+ * Google Analytics Universal (includes purchase tracking)
56
+ * Google Analytics 4 (includes purchase tracking)
57
+ * Google Optimize
58
+ * Facebook Pixel
59
+ * Facebook Remarketing Events
60
  * Hotjar Pixel
61
  * Basic Order Duplication Prevention
62
  * Many useful filters that help tweak the plugin output
63
  * Works with lazy loaded product lists
64
 
65
+ Have a look at the full feature list over [here](https://docs.sweetcode.com/wgact/#/features?id=available-features).
66
 
67
  <strong>Premium Features</strong>
68
 
69
+ * Facebook CAPI
70
+ * Facebook Microdata Output
71
  * Google Analytics Universal and Google Analytics 4 Enhanced E-Commerce
72
  * Google Consent Mode
73
  * Google Dynamic Remarketing Choice for all Business Verticals
79
  * TikTok Ads Pixel with Purchase and all Remarketing Events
80
  * Advanced Order Duplication Prevention
81
 
82
+ Have a look at the full feature list over [here](https://docs.sweetcode.com/wgact/#/features?id=available-features).
83
 
84
  Are you interested in buying the [Pro version](https://sweetcode.com)? Come and visit us [here](https://sweetcode.com).
85
 
98
 
99
  <strong>Documentation</strong>
100
 
101
+ Link to the full documentation of the plugin: [Open the documentation](https://docs.sweetcode.com/wgact/?utm_source=wp-org&utm_medium=documentation-link&utm_campaign=wp-org-documentation-link#/)
102
 
103
  <strong>Roadmap</strong>
104
 
110
 
111
  It works with the following Cookie Consent Management plugins out of the box:
112
 
 
 
 
113
  * [Cookie Notice](https://wordpress.org/plugins/cookie-notice/)
 
114
  * [Cookie Law Info](https://wordpress.org/plugins/cookie-law-info/)
115
  * [GDPR Cookie Compliance](https://wordpress.org/plugins/gdpr-cookie-compliance/)
116
  * [Borlabs Cookie](https://borlabs.io/borlabs-cookie/) (from version 2.1.0)
117
+ [Borlabs Cookie Setup](https://docs.sweetcode.com/wgact/?utm_source=wp-org&utm_medium=documentation-link&utm_campaign=wp-org-documentation-link&utm_content=borlabs-cookie#/consent-mgmt/borlabs-cookie)
 
 
118
 
119
  <strong>Requirements</strong>
120
 
121
+ [List of requirements](https://docs.sweetcode.com/wgact/?utm_source=wp-org&utm_medium=documentation-link&utm_campaign=wp-org-documentation-link&utm_content=requirements#/requirements)
122
 
123
  == Installation ==
124
 
125
+ 1. Upload the plugin directory into your plugins directory `/wp-content/plugins/`
126
  2. Activate the plugin through the 'Plugins' menu in WordPress
127
  3. Get the Google Ads conversion ID and the conversion label. You will find both values in the Google Ads conversion tracking code. [Get the conversion ID and the conversion label](https://www.youtube.com/watch?v=p9gY3JSrNHU)
128
  4. In the WordPress admin panel go to WooCommerce and then into the 'Google Ads Conversion Tracking' menu. Please enter the conversion ID and the conversion label into their respective fields.
131
 
132
  = Is there detailed documentation for the plugin? =
133
 
134
+ Yes. Head over to this link: [Documentation](https://docs.sweetcode.com/wgact/?utm_source=wp-org&utm_medium=documentation-link&utm_campaign=wp-org-documentation-link#/)
135
 
136
  = How do I check if the plugin is working properly? =
137
 
171
 
172
  = Where can I report a bug or suggest improvements? =
173
 
174
+ Please post your problem in the WGACT Support forum: http://wordpress.org/support/plugin/woocommerce-google-adwords-conversion-tracking-tag
175
  You can send the link to the front page of your shop too if you think it would be of help.
176
 
177
  == Screenshots ==
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  = 1.14.2 = 17.02.2022
184
 
185
  * Tweak: Added items to Microsoft Ads purchase event
573
 
574
  = 1.8.14 =
575
 
576
+ * Tweak: Make the <noptimize> tag only appear if Autoptimize is active
577
  * Tweak: Removed a duplicate filter
578
  * Fix: Moved get_cart() query into is_cart() condition
579
 
913
 
914
  * Tweak: Switched on JavaScript tracking with a fix for the CDATA bug http://core.trac.wordpress.org/ticket/3670
915
  * Tweak: The correct function is being used to get the currency depending on the WooCommerce version
916
+ * Fix: Added missing </noscript> tag
917
 
918
  = 1.4.3 =
919
 
vendor/composer/autoload_psr4.php CHANGED
@@ -9,6 +9,5 @@ return array(
9
  'libphonenumber\\' => array($vendorDir . '/giggsey/libphonenumber-for-php/src'),
10
  'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
11
  'Swpm\\WoocommercePixelManager\\' => array($baseDir . '/src'),
12
- 'SweetcodeCom\\WpFlush\\' => array($vendorDir . '/sweetcode-com/wp-flush/src'),
13
  'Giggsey\\Locale\\' => array($vendorDir . '/giggsey/locale/src'),
14
  );
9
  'libphonenumber\\' => array($vendorDir . '/giggsey/libphonenumber-for-php/src'),
10
  'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
11
  'Swpm\\WoocommercePixelManager\\' => array($baseDir . '/src'),
 
12
  'Giggsey\\Locale\\' => array($vendorDir . '/giggsey/locale/src'),
13
  );
vendor/composer/autoload_static.php CHANGED
@@ -19,7 +19,6 @@ class ComposerStaticInitab770dc3559fd87d5167f1d33f2baf09
19
  array (
20
  'Symfony\\Polyfill\\Mbstring\\' => 26,
21
  'Swpm\\WoocommercePixelManager\\' => 29,
22
- 'SweetcodeCom\\WpFlush\\' => 21,
23
  ),
24
  'G' =>
25
  array (
@@ -40,10 +39,6 @@ class ComposerStaticInitab770dc3559fd87d5167f1d33f2baf09
40
  array (
41
  0 => __DIR__ . '/../..' . '/src',
42
  ),
43
- 'SweetcodeCom\\WpFlush\\' =>
44
- array (
45
- 0 => __DIR__ . '/..' . '/sweetcode-com/wp-flush/src',
46
- ),
47
  'Giggsey\\Locale\\' =>
48
  array (
49
  0 => __DIR__ . '/..' . '/giggsey/locale/src',
19
  array (
20
  'Symfony\\Polyfill\\Mbstring\\' => 26,
21
  'Swpm\\WoocommercePixelManager\\' => 29,
 
22
  ),
23
  'G' =>
24
  array (
39
  array (
40
  0 => __DIR__ . '/../..' . '/src',
41
  ),
 
 
 
 
42
  'Giggsey\\Locale\\' =>
43
  array (
44
  0 => __DIR__ . '/..' . '/giggsey/locale/src',
vendor/composer/installed.json CHANGED
@@ -44,17 +44,17 @@
44
  },
45
  {
46
  "name": "giggsey/libphonenumber-for-php",
47
- "version": "8.12.44",
48
- "version_normalized": "8.12.44.0",
49
  "source": {
50
  "type": "git",
51
  "url": "https://github.com/giggsey/libphonenumber-for-php.git",
52
- "reference": "a726990faf05bfffdd826f75d9b41a1580dad4a7"
53
  },
54
  "dist": {
55
  "type": "zip",
56
- "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/a726990faf05bfffdd826f75d9b41a1580dad4a7",
57
- "reference": "a726990faf05bfffdd826f75d9b41a1580dad4a7",
58
  "shasum": ""
59
  },
60
  "require": {
@@ -71,7 +71,7 @@
71
  "symfony/console": "^2.8|^3.0|^v4.4|^v5.2",
72
  "symfony/phpunit-bridge": "^4.2 || ^5"
73
  },
74
- "time": "2022-02-24T09:38:54+00:00",
75
  "type": "library",
76
  "extra": {
77
  "branch-alias": {
@@ -175,38 +175,6 @@
175
  },
176
  "install-path": "../giggsey/locale"
177
  },
178
- {
179
- "name": "sweetcode-com/wp-flush",
180
- "version": "dev-main",
181
- "version_normalized": "dev-main",
182
- "dist": {
183
- "type": "path",
184
- "url": "/Users/aleksandarvucenovic/dev/PhpStormProjects/wp-flush",
185
- "reference": "7ad47db369772a59685403ab4a80a0eeccc9e362"
186
- },
187
- "type": "library",
188
- "installation-source": "dist",
189
- "autoload": {
190
- "psr-4": {
191
- "SweetcodeCom\\WpFlush\\": "src/"
192
- }
193
- },
194
- "license": [
195
- "GPL3"
196
- ],
197
- "authors": [
198
- {
199
- "name": "Aleksandar Vucenovic",
200
- "email": "aleksandar@sweetcode.com"
201
- }
202
- ],
203
- "description": "Flush the cache of various cache systems from within WordPress plugins",
204
- "transport-options": {
205
- "symlink": true,
206
- "relative": false
207
- },
208
- "install-path": "../sweetcode-com/wp-flush"
209
- },
210
  {
211
  "name": "symfony/polyfill-mbstring",
212
  "version": "v1.20.0",
44
  },
45
  {
46
  "name": "giggsey/libphonenumber-for-php",
47
+ "version": "8.12.42",
48
+ "version_normalized": "8.12.42.0",
49
  "source": {
50
  "type": "git",
51
  "url": "https://github.com/giggsey/libphonenumber-for-php.git",
52
+ "reference": "33c8dc586ab0d430193dc721d597a3aa79803d06"
53
  },
54
  "dist": {
55
  "type": "zip",
56
+ "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/33c8dc586ab0d430193dc721d597a3aa79803d06",
57
+ "reference": "33c8dc586ab0d430193dc721d597a3aa79803d06",
58
  "shasum": ""
59
  },
60
  "require": {
71
  "symfony/console": "^2.8|^3.0|^v4.4|^v5.2",
72
  "symfony/phpunit-bridge": "^4.2 || ^5"
73
  },
74
+ "time": "2022-01-28T08:38:37+00:00",
75
  "type": "library",
76
  "extra": {
77
  "branch-alias": {
175
  },
176
  "install-path": "../giggsey/locale"
177
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  {
179
  "name": "symfony/polyfill-mbstring",
180
  "version": "v1.20.0",
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => 'e163072ee9e4635e1679efbb9f3ce470edb1a7db',
9
  'name' => 'sweetcode/woocommerce-pixel-manager',
10
  'dev' => true,
11
  ),
@@ -20,12 +20,12 @@
20
  'dev_requirement' => false,
21
  ),
22
  'giggsey/libphonenumber-for-php' => array(
23
- 'pretty_version' => '8.12.44',
24
- 'version' => '8.12.44.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../giggsey/libphonenumber-for-php',
27
  'aliases' => array(),
28
- 'reference' => 'a726990faf05bfffdd826f75d9b41a1580dad4a7',
29
  'dev_requirement' => false,
30
  ),
31
  'giggsey/locale' => array(
@@ -37,22 +37,13 @@
37
  'reference' => '8d324583b5899e6280a875c43bf1fc9658bc6962',
38
  'dev_requirement' => false,
39
  ),
40
- 'sweetcode-com/wp-flush' => array(
41
- 'pretty_version' => 'dev-main',
42
- 'version' => 'dev-main',
43
- 'type' => 'library',
44
- 'install_path' => __DIR__ . '/../sweetcode-com/wp-flush',
45
- 'aliases' => array(),
46
- 'reference' => '7ad47db369772a59685403ab4a80a0eeccc9e362',
47
- 'dev_requirement' => false,
48
- ),
49
  'sweetcode/woocommerce-pixel-manager' => array(
50
  'pretty_version' => 'dev-master',
51
  'version' => 'dev-master',
52
  'type' => 'wordpress-plugin',
53
  'install_path' => __DIR__ . '/../../',
54
  'aliases' => array(),
55
- 'reference' => 'e163072ee9e4635e1679efbb9f3ce470edb1a7db',
56
  'dev_requirement' => false,
57
  ),
58
  'symfony/polyfill-mbstring' => array(
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '15a6ab27c1e31fe00c458a0045a26466b6d33973',
9
  'name' => 'sweetcode/woocommerce-pixel-manager',
10
  'dev' => true,
11
  ),
20
  'dev_requirement' => false,
21
  ),
22
  'giggsey/libphonenumber-for-php' => array(
23
+ 'pretty_version' => '8.12.42',
24
+ 'version' => '8.12.42.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../giggsey/libphonenumber-for-php',
27
  'aliases' => array(),
28
+ 'reference' => '33c8dc586ab0d430193dc721d597a3aa79803d06',
29
  'dev_requirement' => false,
30
  ),
31
  'giggsey/locale' => array(
37
  'reference' => '8d324583b5899e6280a875c43bf1fc9658bc6962',
38
  'dev_requirement' => false,
39
  ),
 
 
 
 
 
 
 
 
 
40
  'sweetcode/woocommerce-pixel-manager' => array(
41
  'pretty_version' => 'dev-master',
42
  'version' => 'dev-master',
43
  'type' => 'wordpress-plugin',
44
  'install_path' => __DIR__ . '/../../',
45
  'aliases' => array(),
46
+ 'reference' => '15a6ab27c1e31fe00c458a0045a26466b6d33973',
47
  'dev_requirement' => false,
48
  ),
49
  'symfony/polyfill-mbstring' => array(
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png CHANGED
Binary file
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png CHANGED
Binary file
vendor/freemius/wordpress-sdk/assets/img/woocommerce-google-adwords-conversion-tracking-tag.png CHANGED
Binary file
vendor/freemius/wordpress-sdk/includes/class-freemius.php CHANGED
@@ -3550,8 +3550,6 @@
3550
  * @since 1.1.7.3
3551
  */
3552
  static function _toggle_debug_mode() {
3553
- check_admin_referer( 'fs_toggle_debug_mode' );
3554
-
3555
  if ( ! is_super_admin() ) {
3556
  return;
3557
  }
@@ -3573,19 +3571,10 @@
3573
  * @since 1.2.1.6
3574
  */
3575
  static function _get_debug_log() {
3576
- check_admin_referer( 'fs_get_debug_log' );
3577
-
3578
- if ( ! is_super_admin() ) {
3579
- return;
3580
- }
3581
-
3582
- $limit = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
3583
- $offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
3584
-
3585
  $logs = FS_Logger::load_db_logs(
3586
  fs_request_get( 'filters', false, 'post' ),
3587
- $limit,
3588
- $offset
3589
  );
3590
 
3591
  self::shoot_ajax_success( $logs );
@@ -4458,12 +4447,6 @@
4458
  * @since 1.0.9
4459
  */
4460
  function _email_about_firewall_issue() {
4461
- check_admin_referer( 'fs_resolve_firewall_issues' );
4462
-
4463
- if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
4464
- return;
4465
- }
4466
-
4467
  $this->_admin_notices->remove_sticky( 'failed_connect_api' );
4468
 
4469
  $pong = $this->ping();
@@ -4538,12 +4521,6 @@
4538
  * @since 1.1.7.4
4539
  */
4540
  function _retry_connectivity_test() {
4541
- check_admin_referer( 'fs_retry_connectivity_test' );
4542
-
4543
- if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
4544
- return;
4545
- }
4546
-
4547
  $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
4548
 
4549
  $pong = $this->ping();
3550
  * @since 1.1.7.3
3551
  */
3552
  static function _toggle_debug_mode() {
 
 
3553
  if ( ! is_super_admin() ) {
3554
  return;
3555
  }
3571
  * @since 1.2.1.6
3572
  */
3573
  static function _get_debug_log() {
 
 
 
 
 
 
 
 
 
3574
  $logs = FS_Logger::load_db_logs(
3575
  fs_request_get( 'filters', false, 'post' ),
3576
+ ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200,
3577
+ ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0
3578
  );
3579
 
3580
  self::shoot_ajax_success( $logs );
4447
  * @since 1.0.9
4448
  */
4449
  function _email_about_firewall_issue() {
 
 
 
 
 
 
4450
  $this->_admin_notices->remove_sticky( 'failed_connect_api' );
4451
 
4452
  $pong = $this->ping();
4521
  * @since 1.1.7.4
4522
  */
4523
  function _retry_connectivity_test() {
 
 
 
 
 
 
4524
  $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
4525
 
4526
  $pong = $this->ping();
vendor/freemius/wordpress-sdk/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -175,12 +175,7 @@
175
  *
176
  */
177
  function dismiss_notice_ajax_callback() {
178
- check_admin_referer( 'fs_dismiss_notice_action' );
179
-
180
- if ( ! is_numeric( $_POST['message_id'] ) ) {
181
- $this->_sticky_storage->remove( $_POST['message_id'] );
182
- }
183
-
184
  wp_die();
185
  }
186
 
@@ -474,4 +469,4 @@
474
  }
475
 
476
  #endregion
477
- }
175
  *
176
  */
177
  function dismiss_notice_ajax_callback() {
178
+ $this->_sticky_storage->remove( $_POST['message_id'] );
 
 
 
 
 
179
  wp_die();
180
  }
181
 
469
  }
470
 
471
  #endregion
472
+ }
vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/ArgumentNotExistException.php CHANGED
@@ -1,8 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  exit;
8
  }
@@ -10,4 +6,4 @@
10
  if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
11
  class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
12
  }
13
- }
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
  exit;
4
  }
6
  if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
7
  class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
  }
9
+ }
vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/EmptyArgumentException.php CHANGED
@@ -1,8 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  exit;
8
  }
@@ -10,4 +6,4 @@
10
  if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
11
  class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
12
  }
13
- }
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
  exit;
4
  }
6
  if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
7
  class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
  }
9
+ }
vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/Exception.php CHANGED
@@ -1,8 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  /**
8
  * Thrown when an API call returns an exception.
@@ -75,4 +71,4 @@
75
  return $str . $this->getMessage();
76
  }
77
  }
78
- }
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  /**
4
  * Thrown when an API call returns an exception.
71
  return $str . $this->getMessage();
72
  }
73
  }
74
+ }
vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/InvalidArgumentException.php CHANGED
@@ -1,12 +1,8 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  exit;
8
  }
9
 
10
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
11
  class Freemius_InvalidArgumentException extends Freemius_Exception { }
12
- }
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  exit;
4
  }
5
 
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  class Freemius_InvalidArgumentException extends Freemius_Exception { }
8
+ }
vendor/freemius/wordpress-sdk/includes/sdk/Exceptions/OAuthException.php CHANGED
@@ -1,8 +1,4 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  exit;
8
  }
@@ -13,4 +9,4 @@
13
  parent::__construct( $pResult );
14
  }
15
  }
16
- }
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  exit;
4
  }
9
  parent::__construct( $pResult );
10
  }
11
  }
12
+ }
vendor/freemius/wordpress-sdk/includes/sdk/FreemiusBase.php CHANGED
@@ -15,10 +15,6 @@
15
  * under the License.
16
  */
17
 
18
- if ( ! defined( 'ABSPATH' ) ) {
19
- exit;
20
- }
21
-
22
  if ( ! defined( 'FS_API__VERSION' ) ) {
23
  define( 'FS_API__VERSION', '1' );
24
  }
15
  * under the License.
16
  */
17
 
 
 
 
 
18
  if ( ! defined( 'FS_API__VERSION' ) ) {
19
  define( 'FS_API__VERSION', '1' );
20
  }
vendor/freemius/wordpress-sdk/includes/sdk/FreemiusWordPress.php CHANGED
@@ -14,9 +14,6 @@
14
  * License for the specific language governing permissions and limitations
15
  * under the License.
16
  */
17
- if ( ! defined( 'ABSPATH' ) ) {
18
- exit;
19
- }
20
 
21
  require_once dirname( __FILE__ ) . '/FreemiusBase.php';
22
 
@@ -712,4 +709,4 @@
712
  }
713
 
714
  #endregion
715
- }
14
  * License for the specific language governing permissions and limitations
15
  * under the License.
16
  */
 
 
 
17
 
18
  require_once dirname( __FILE__ ) . '/FreemiusBase.php';
19
 
709
  }
710
 
711
  #endregion
712
+ }
vendor/freemius/wordpress-sdk/require.php CHANGED
@@ -6,10 +6,6 @@
6
  * @since 1.1.9
7
  */
8
 
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
  // Configuration should be loaded first.
14
  require_once dirname( __FILE__ ) . '/config.php';
15
  require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
@@ -50,4 +46,4 @@
50
  require_once WP_FS__DIR_INCLUDES . '/class-fs-admin-notices.php';
51
  require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
52
  require_once WP_FS__DIR_INCLUDES . '/sdk/Exceptions/Exception.php';
53
- require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
6
  * @since 1.1.9
7
  */
8
 
 
 
 
 
9
  // Configuration should be loaded first.
10
  require_once dirname( __FILE__ ) . '/config.php';
11
  require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
46
  require_once WP_FS__DIR_INCLUDES . '/class-fs-admin-notices.php';
47
  require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
48
  require_once WP_FS__DIR_INCLUDES . '/sdk/Exceptions/Exception.php';
49
+ require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
vendor/freemius/wordpress-sdk/start.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @var string
17
  */
18
- $this_sdk_version = '2.4.3';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
15
  *
16
  * @var string
17
  */
18
+ $this_sdk_version = '2.4.2';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
vendor/freemius/wordpress-sdk/templates/account/partials/addon.php CHANGED
@@ -1,9 +1,4 @@
1
  <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
  /**
8
  * @var array $VARS
9
  * @var Freemius $fs
@@ -448,4 +443,4 @@
448
  </td>
449
  <!--/ Optional Delete Action -->
450
  <?php endif ?>
451
- </tr>
1
  <?php
 
 
 
 
 
2
  /**
3
  * @var array $VARS
4
  * @var Freemius $fs
443
  </td>
444
  <!--/ Optional Delete Action -->
445
  <?php endif ?>
446
+ </tr>
vendor/freemius/wordpress-sdk/templates/ajax-loader.php CHANGED
@@ -1,6 +1 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- ?>
6
- <div class="fs-ajax-loader" style="display: none"><?php for ( $i = 1; $i <= 8; $i ++ ) : ?><div class="fs-ajax-loader-bar fs-ajax-loader-bar-<?php echo $i ?>"></div><?php endfor ?></div>
1
+ <div class="fs-ajax-loader" style="display: none"><?php for ( $i = 1; $i <= 8; $i ++ ) : ?><div class="fs-ajax-loader-bar fs-ajax-loader-bar-<?php echo $i ?>"></div><?php endfor ?></div>
 
 
 
 
 
vendor/freemius/wordpress-sdk/templates/debug.php CHANGED
@@ -37,8 +37,6 @@
37
 
38
  $.post( ajaxurl, {
39
  action: 'fs_toggle_debug_mode',
40
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
41
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
42
  is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
43
  }, function ( response ) {
44
  if ( 1 == response ) {
@@ -113,8 +111,7 @@
113
  if (optionName) {
114
  $.post(ajaxurl, {
115
  action : 'fs_get_db_option',
116
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
117
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
118
  option_name: optionName
119
  }, function (response) {
120
  if (response.data.value)
@@ -134,8 +131,7 @@
134
  if (optionValue) {
135
  $.post(ajaxurl, {
136
  action : 'fs_set_db_option',
137
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
138
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
139
  option_name : optionName,
140
  option_value: optionValue
141
  }, function () {
@@ -728,8 +724,6 @@
728
 
729
  $.post(ajaxurl, {
730
  action : 'fs_get_debug_log',
731
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
732
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
733
  filters: filters,
734
  offset : offset,
735
  limit : limit
37
 
38
  $.post( ajaxurl, {
39
  action: 'fs_toggle_debug_mode',
 
 
40
  is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
41
  }, function ( response ) {
42
  if ( 1 == response ) {
111
  if (optionName) {
112
  $.post(ajaxurl, {
113
  action : 'fs_get_db_option',
114
+ _wpnonce : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
 
115
  option_name: optionName
116
  }, function (response) {
117
  if (response.data.value)
131
  if (optionValue) {
132
  $.post(ajaxurl, {
133
  action : 'fs_set_db_option',
134
+ _wpnonce : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
 
135
  option_name : optionName,
136
  option_value: optionValue
137
  }, function () {
724
 
725
  $.post(ajaxurl, {
726
  action : 'fs_get_debug_log',
 
 
727
  filters: filters,
728
  offset : offset,
729
  limit : limit
vendor/freemius/wordpress-sdk/templates/firewall-issues-js.php CHANGED
@@ -22,12 +22,10 @@
22
  notice = $( this ).parents( '.fs-notice' ),
23
  ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
24
 
25
- var data = {
26
- action : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
27
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
28
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_resolve_firewall_issues' ) ); ?>,
29
- error_type: error_type
30
- };
31
 
32
  if ( 'squid' === error_type ) {
33
  data.hosting_company = prompt( 'What is the name or URL of your hosting company?' );
@@ -41,9 +39,7 @@
41
  }
42
 
43
  if ( 'retry_ping' === error_type ) {
44
- data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
45
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
46
- data._wpnonce = <?php echo wp_json_encode( wp_create_nonce( 'fs_retry_connectivity_test' ) ); ?>;
47
  }
48
 
49
  $( this ).css({'cursor': 'wait'});
@@ -60,4 +56,4 @@
60
  });
61
  });
62
  });
63
- </script>
22
  notice = $( this ).parents( '.fs-notice' ),
23
  ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
24
 
25
+ var data = {
26
+ action : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
27
+ error_type: error_type
28
+ };
 
 
29
 
30
  if ( 'squid' === error_type ) {
31
  data.hosting_company = prompt( 'What is the name or URL of your hosting company?' );
39
  }
40
 
41
  if ( 'retry_ping' === error_type ) {
42
+ data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
 
 
43
  }
44
 
45
  $( this ).css({'cursor': 'wait'});
56
  });
57
  });
58
  });
59
+ </script>
vendor/freemius/wordpress-sdk/templates/partials/network-activation.php CHANGED
@@ -1,9 +1,4 @@
1
  <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
  /**
8
  * @var array $VARS
9
  * @var Freemius $fs
@@ -91,4 +86,4 @@
91
  </tbody>
92
  </table>
93
  </div>
94
- </div>
1
  <?php
 
 
 
 
 
2
  /**
3
  * @var array $VARS
4
  * @var Freemius $fs
86
  </tbody>
87
  </table>
88
  </div>
89
+ </div>
vendor/freemius/wordpress-sdk/templates/sticky-admin-notice-js.php CHANGED
@@ -23,9 +23,7 @@
23
 
24
  notice.fadeOut( 'fast', function() {
25
  var data = {
26
- action : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
27
- // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
28
- _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_dismiss_notice_action' ) ); ?>,
29
  message_id: id
30
  };
31
 
@@ -38,4 +36,4 @@
38
  });
39
  });
40
  });
41
- </script>
23
 
24
  notice.fadeOut( 'fast', function() {
25
  var data = {
26
+ action : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
 
 
27
  message_id: id
28
  };
29
 
36
  });
37
  });
38
  });
39
+ </script>
vendor/giggsey/libphonenumber-for-php/METADATA-VERSION.txt CHANGED
@@ -2,4 +2,4 @@
2
  # It can be a commit, branch or tag of the https://github.com/google/libphonenumber project
3
  #
4
  # For more information, look at the phing tasks in build.xml
5
- v8.12.44
2
  # It can be a commit, branch or tag of the https://github.com/google/libphonenumber project
3
  #
4
  # For more information, look at the phing tasks in build.xml
5
+ v8.12.42
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/229.php CHANGED
@@ -11,9 +11,13 @@
11
  */
12
 
13
  return array (
14
- 2295 => 'MTN',
 
 
15
  22955 => 'Moov',
16
  22956 => 'Moov',
 
 
17
  22960 => 'Moov',
18
  22961 => 'MTN',
19
  22962 => 'MTN',
11
  */
12
 
13
  return array (
14
+ 22951 => 'MTN',
15
+ 22952 => 'MTN',
16
+ 22953 => 'MTN',
17
  22955 => 'Moov',
18
  22956 => 'Moov',
19
+ 22957 => 'MTN',
20
+ 22958 => 'MTN',
21
  22960 => 'Moov',
22
  22961 => 'MTN',
23
  22962 => 'MTN',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/238.php CHANGED
@@ -11,7 +11,10 @@
11
  */
12
 
13
  return array (
 
14
  23836 => 'CVMOVEL',
 
 
15
  23851 => 'T+',
16
  23852 => 'T+',
17
  23853 => 'T+',
11
  */
12
 
13
  return array (
14
+ 23833 => 'T+',
15
  23836 => 'CVMOVEL',
16
+ 23843 => 'T+',
17
+ 23846 => 'CVMOVEL',
18
  23851 => 'T+',
19
  23852 => 'T+',
20
  23853 => 'T+',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/248.php CHANGED
@@ -11,8 +11,6 @@
11
  */
12
 
13
  return array (
14
- 24821 => 'Intelvision',
15
- 24822 => 'Intelvision',
16
  24825 => 'CWS',
17
  24826 => 'CWS',
18
  24827 => 'Airtel',
11
  */
12
 
13
  return array (
 
 
14
  24825 => 'CWS',
15
  24826 => 'CWS',
16
  24827 => 'Airtel',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/32.php CHANGED
@@ -51,7 +51,6 @@ return array (
51
  324689 => 'Febo Telecom',
52
  32469 => 'Telenet',
53
  3247 => 'Proximus',
54
- 324802 => 'TISMI BV',
55
  324805 => 'Voyacom SPRL',
56
  324807 => 'MessageBird BV',
57
  324809 => 'Ericsson NV',
51
  324689 => 'Febo Telecom',
52
  32469 => 'Telenet',
53
  3247 => 'Proximus',
 
54
  324805 => 'Voyacom SPRL',
55
  324807 => 'MessageBird BV',
56
  324809 => 'Ericsson NV',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/354.php CHANGED
@@ -18,7 +18,6 @@ return array (
18
  35462 => 'Vodafone',
19
  354630 => 'IMC',
20
  354632 => 'Tismi',
21
- 354636 => 'Öryggisfjarskipti',
22
  354637 => 'Öryggisfjarskipti',
23
  354638 => 'Öryggisfjarskipti',
24
  354639 => 'Öryggisfjarskipti',
18
  35462 => 'Vodafone',
19
  354630 => 'IMC',
20
  354632 => 'Tismi',
 
21
  354637 => 'Öryggisfjarskipti',
22
  354638 => 'Öryggisfjarskipti',
23
  354639 => 'Öryggisfjarskipti',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/502.php CHANGED
@@ -29,7 +29,6 @@ return array (
29
  502372 => 'Tigo',
30
  502373 => 'Tigo',
31
  502374 => 'Tigo',
32
- 502375 => 'Tigo',
33
  50239 => 'Telgua',
34
  502390 => 'Tigo',
35
  502391 => 'Tigo',
29
  502372 => 'Tigo',
30
  502373 => 'Tigo',
31
  502374 => 'Tigo',
 
32
  50239 => 'Telgua',
33
  502390 => 'Tigo',
34
  502391 => 'Tigo',
vendor/giggsey/libphonenumber-for-php/src/carrier/data/en/507.php CHANGED
@@ -20,7 +20,6 @@ return array (
20
  507616 => 'Telefónica Móviles',
21
  507617 => 'Claro',
22
  507618 => 'Claro',
23
- 507619 => 'Telefónica Móviles',
24
  50762 => 'Claro',
25
  507630 => 'Claro',
26
  507631 => 'Claro',
20
  507616 => 'Telefónica Móviles',
21
  507617 => 'Claro',
22
  507618 => 'Claro',
 
23
  50762 => 'Claro',
24
  507630 => 'Claro',
25
  507631 => 'Claro',
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AG.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AI.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_AS.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BB.php CHANGED
@@ -83,7 +83,7 @@ return array (
83
  ),
84
  'personalNumber' =>
85
  array (
86
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
87
  'ExampleNumber' => '5002345678',
88
  'PossibleLength' =>
89
  array (
83
  ),
84
  'personalNumber' =>
85
  array (
86
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
87
  'ExampleNumber' => '5002345678',
88
  'PossibleLength' =>
89
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BJ.php CHANGED
@@ -36,7 +36,7 @@ return array (
36
  ),
37
  'mobile' =>
38
  array (
39
- 'NationalNumberPattern' => '(?:5[1-8]|6\\d|9[013-9])\\d{6}',
40
  'ExampleNumber' => '90011234',
41
  'PossibleLength' =>
42
  array (
36
  ),
37
  'mobile' =>
38
  array (
39
+ 'NationalNumberPattern' => '(?:5[1-35-8]|6\\d|9[013-9])\\d{6}',
40
  'ExampleNumber' => '90011234',
41
  'PossibleLength' =>
42
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BM.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_BS.php CHANGED
@@ -83,7 +83,7 @@ return array (
83
  ),
84
  'personalNumber' =>
85
  array (
86
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
87
  'ExampleNumber' => '5002345678',
88
  'PossibleLength' =>
89
  array (
83
  ),
84
  'personalNumber' =>
85
  array (
86
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
87
  'ExampleNumber' => '5002345678',
88
  'PossibleLength' =>
89
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CA.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[1256]|33|44|66|77|88)|622)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CL.php CHANGED
@@ -27,7 +27,7 @@ return array (
27
  ),
28
  'fixedLine' =>
29
  array (
30
- 'NationalNumberPattern' => '2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[034]\\d|1[0-35-9]|2[1-9]|5[0-2])|600)|6469)|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}',
31
  'ExampleNumber' => '221234567',
32
  'PossibleLength' =>
33
  array (
@@ -39,7 +39,7 @@ return array (
39
  ),
40
  'mobile' =>
41
  array (
42
- 'NationalNumberPattern' => '2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[034]\\d|1[0-35-9]|2[1-9]|5[0-2])|600)|6469)|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}',
43
  'ExampleNumber' => '221234567',
44
  'PossibleLength' =>
45
  array (
@@ -198,7 +198,7 @@ return array (
198
  'format' => '$1 $2 $3',
199
  'leadingDigitsPatterns' =>
200
  array (
201
- 0 => '2[1-36]',
202
  ),
203
  'nationalPrefixFormattingRule' => '($1)',
204
  'domesticCarrierCodeFormattingRule' => '',
@@ -298,7 +298,7 @@ return array (
298
  'format' => '$1 $2 $3',
299
  'leadingDigitsPatterns' =>
300
  array (
301
- 0 => '2[1-36]',
302
  ),
303
  'nationalPrefixFormattingRule' => '($1)',
304
  'domesticCarrierCodeFormattingRule' => '',
27
  ),
28
  'fixedLine' =>
29
  array (
30
+ 'NationalNumberPattern' => '2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[034]\\d|1[0-35-9]|2[1-9]|5[0-2])|600))|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}',
31
  'ExampleNumber' => '221234567',
32
  'PossibleLength' =>
33
  array (
39
  ),
40
  'mobile' =>
41
  array (
42
+ 'NationalNumberPattern' => '2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[034]\\d|1[0-35-9]|2[1-9]|5[0-2])|600))|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}',
43
  'ExampleNumber' => '221234567',
44
  'PossibleLength' =>
45
  array (
198
  'format' => '$1 $2 $3',
199
  'leadingDigitsPatterns' =>
200
  array (
201
+ 0 => '2[1-3]',
202
  ),
203
  'nationalPrefixFormattingRule' => '($1)',
204
  'domesticCarrierCodeFormattingRule' => '',
298
  'format' => '$1 $2 $3',
299
  'leadingDigitsPatterns' =>
300
  array (
301
+ 0 => '2[1-3]',
302
  ),
303
  'nationalPrefixFormattingRule' => '($1)',
304
  'domesticCarrierCodeFormattingRule' => '',
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_CV.php CHANGED
@@ -36,7 +36,7 @@ return array (
36
  ),
37
  'mobile' =>
38
  array (
39
- 'NationalNumberPattern' => '(?:36|5[1-389]|9\\d)\\d{5}',
40
  'ExampleNumber' => '9911234',
41
  'PossibleLength' =>
42
  array (
@@ -88,10 +88,9 @@ return array (
88
  ),
89
  'voip' =>
90
  array (
91
- 'NationalNumberPattern' => '(?:3[3-5]|4[356])\\d{5}',
92
- 'ExampleNumber' => '3401234',
93
  'PossibleLength' =>
94
  array (
 
95
  ),
96
  'PossibleLengthLocalOnly' =>
97
  array (
36
  ),
37
  'mobile' =>
38
  array (
39
+ 'NationalNumberPattern' => '(?:[34][36]|5[1-389]|9\\d)\\d{5}',
40
  'ExampleNumber' => '9911234',
41
  'PossibleLength' =>
42
  array (
88
  ),
89
  'voip' =>
90
  array (
 
 
91
  'PossibleLength' =>
92
  array (
93
+ 0 => -1,
94
  ),
95
  'PossibleLengthLocalOnly' =>
96
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_DM.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_DO.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GA.php CHANGED
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}',
42
  'ExampleNumber' => '06031234',
43
  'PossibleLength' =>
44
  array (
@@ -140,7 +140,7 @@ return array (
140
  'id' => 'GA',
141
  'countryCode' => 241,
142
  'internationalPrefix' => '00',
143
- 'nationalPrefixForParsing' => '0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})',
144
  'nationalPrefixTransformRule' => '$1',
145
  'sameMobileAndFixedLinePattern' => false,
146
  'numberFormat' =>
@@ -163,9 +163,9 @@ return array (
163
  'format' => '$1 $2 $3 $4',
164
  'leadingDigitsPatterns' =>
165
  array (
166
- 0 => '0',
167
  ),
168
- 'nationalPrefixFormattingRule' => '',
169
  'domesticCarrierCodeFormattingRule' => '',
170
  'nationalPrefixOptionalWhenFormatting' => false,
171
  ),
@@ -175,9 +175,9 @@ return array (
175
  'format' => '$1 $2 $3 $4',
176
  'leadingDigitsPatterns' =>
177
  array (
178
- 0 => '11|[67]',
179
  ),
180
- 'nationalPrefixFormattingRule' => '0$1',
181
  'domesticCarrierCodeFormattingRule' => '',
182
  'nationalPrefixOptionalWhenFormatting' => false,
183
  ),
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '(?:(?:0[2-7]\\d|6(?:0[0-4]|10|[256]\\d))\\d|7(?:[47]\\d\\d|658))\\d{4}|[2-7]\\d{6}',
42
  'ExampleNumber' => '06031234',
43
  'PossibleLength' =>
44
  array (
140
  'id' => 'GA',
141
  'countryCode' => 241,
142
  'internationalPrefix' => '00',
143
+ 'nationalPrefixForParsing' => '0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[47]\\d{6}|76\\d{6})',
144
  'nationalPrefixTransformRule' => '$1',
145
  'sameMobileAndFixedLinePattern' => false,
146
  'numberFormat' =>
163
  'format' => '$1 $2 $3 $4',
164
  'leadingDigitsPatterns' =>
165
  array (
166
+ 0 => '11|[67]',
167
  ),
168
+ 'nationalPrefixFormattingRule' => '0$1',
169
  'domesticCarrierCodeFormattingRule' => '',
170
  'nationalPrefixOptionalWhenFormatting' => false,
171
  ),
175
  'format' => '$1 $2 $3 $4',
176
  'leadingDigitsPatterns' =>
177
  array (
178
+ 0 => '0',
179
  ),
180
+ 'nationalPrefixFormattingRule' => '',
181
  'domesticCarrierCodeFormattingRule' => '',
182
  'nationalPrefixOptionalWhenFormatting' => false,
183
  ),
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GD.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_GU.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_IS.php CHANGED
@@ -26,7 +26,7 @@ return array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
- 'NationalNumberPattern' => '(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}',
30
  'ExampleNumber' => '4101234',
31
  'PossibleLength' =>
32
  array (
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[28]))\\d{4}',
42
  'ExampleNumber' => '6111234',
43
  'PossibleLength' =>
44
  array (
@@ -49,7 +49,7 @@ return array (
49
  ),
50
  'tollFree' =>
51
  array (
52
- 'NationalNumberPattern' => '80[0-8]\\d{4}',
53
  'ExampleNumber' => '8001234',
54
  'PossibleLength' =>
55
  array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
+ 'NationalNumberPattern' => '(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-245]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}',
30
  'ExampleNumber' => '4101234',
31
  'PossibleLength' =>
32
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[027-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[28]))\\d{4}',
42
  'ExampleNumber' => '6111234',
43
  'PossibleLength' =>
44
  array (
49
  ),
50
  'tollFree' =>
51
  array (
52
+ 'NationalNumberPattern' => '80[08]\\d{4}',
53
  'ExampleNumber' => '8001234',
54
  'PossibleLength' =>
55
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_JM.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KN.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KR.php CHANGED
@@ -144,7 +144,7 @@ return array (
144
  ),
145
  'uan' =>
146
  array (
147
- 'NationalNumberPattern' => '1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[168]|88)|8(?:00|33|55|77|99))\\d{4}',
148
  'ExampleNumber' => '15441234',
149
  'PossibleLength' =>
150
  array (
144
  ),
145
  'uan' =>
146
  array (
147
+ 'NationalNumberPattern' => '1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[16]|88)|8(?:00|33|55|77|99))\\d{4}',
148
  'ExampleNumber' => '15441234',
149
  'PossibleLength' =>
150
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KW.php CHANGED
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|111|222|333|444|7(?:0[013-9]|[67]\\d)|888|9(?:[069]\\d|3[039]))|9(?:(?:0[09]|22|[4679]\\d|8[057-9])\\d|1(?:1[01]|99)|3(?:00|33)|5(?:00|5\\d)))\\d{4}',
42
  'ExampleNumber' => '50012345',
43
  'PossibleLength' =>
44
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|222|333|444|7(?:0[013-9]|[67]\\d)|888|9(?:[069]\\d|3[039]))|9(?:(?:0[09]|22|[4679]\\d|8[057-9])\\d|1(?:1[01]|99)|3(?:00|33)|5(?:00|5\\d)))\\d{4}',
42
  'ExampleNumber' => '50012345',
43
  'PossibleLength' =>
44
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_KY.php CHANGED
@@ -26,7 +26,7 @@ return array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
- 'NationalNumberPattern' => '345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|[48]8)|9(?:14|4[035-9]))\\d{4}',
30
  'ExampleNumber' => '3452221234',
31
  'PossibleLength' =>
32
  array (
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}',
42
  'ExampleNumber' => '3453231234',
43
  'PossibleLength' =>
44
  array (
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
+ 'NationalNumberPattern' => '345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}',
30
  'ExampleNumber' => '3452221234',
31
  'PossibleLength' =>
32
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}',
42
  'ExampleNumber' => '3453231234',
43
  'PossibleLength' =>
44
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_LC.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_LI.php CHANGED
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '(?:6(?:(?:4[5-9]|5[0-4])\\d|6(?:[0245]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}',
42
  'ExampleNumber' => '660234567',
43
  'PossibleLength' =>
44
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '(?:6(?:4(?:5[4-9]|[6-9]\\d)|5[0-4]\\d|6(?:[0245]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}',
42
  'ExampleNumber' => '660234567',
43
  'PossibleLength' =>
44
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_MP.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_MS.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_PA.php CHANGED
@@ -40,7 +40,7 @@ return array (
40
  ),
41
  'mobile' =>
42
  array (
43
- 'NationalNumberPattern' => '(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}',
44
  'ExampleNumber' => '61234567',
45
  'PossibleLength' =>
46
  array (
40
  ),
41
  'mobile' =>
42
  array (
43
+ 'NationalNumberPattern' => '(?:1[16]1|21[89]|6(?:[02-9]\\d|1[0-8])\\d|8(?:1[01]|7[23]))\\d{4}',
44
  'ExampleNumber' => '61234567',
45
  'PossibleLength' =>
46
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_PR.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SC.php CHANGED
@@ -14,7 +14,7 @@
14
  return array (
15
  'generalDesc' =>
16
  array (
17
- 'NationalNumberPattern' => '800\\d{4}|(?:[249]\\d|64)\\d{5}',
18
  'PossibleLength' =>
19
  array (
20
  0 => 7,
@@ -36,7 +36,7 @@ return array (
36
  ),
37
  'mobile' =>
38
  array (
39
- 'NationalNumberPattern' => '2[125-8]\\d{5}',
40
  'ExampleNumber' => '2510123',
41
  'PossibleLength' =>
42
  array (
@@ -47,7 +47,7 @@ return array (
47
  ),
48
  'tollFree' =>
49
  array (
50
- 'NationalNumberPattern' => '800[08]\\d{3}',
51
  'ExampleNumber' => '8000000',
52
  'PossibleLength' =>
53
  array (
14
  return array (
15
  'generalDesc' =>
16
  array (
17
+ 'NationalNumberPattern' => '8000\\d{3}|(?:[249]\\d|64)\\d{5}',
18
  'PossibleLength' =>
19
  array (
20
  0 => 7,
36
  ),
37
  'mobile' =>
38
  array (
39
+ 'NationalNumberPattern' => '2[5-8]\\d{5}',
40
  'ExampleNumber' => '2510123',
41
  'PossibleLength' =>
42
  array (
47
  ),
48
  'tollFree' =>
49
  array (
50
+ 'NationalNumberPattern' => '8000\\d{3}',
51
  'ExampleNumber' => '8000000',
52
  'PossibleLength' =>
53
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SG.php CHANGED
@@ -27,7 +27,7 @@ return array (
27
  ),
28
  'fixedLine' =>
29
  array (
30
- 'NationalNumberPattern' => '662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}',
31
  'ExampleNumber' => '61234567',
32
  'PossibleLength' =>
33
  array (
27
  ),
28
  'fixedLine' =>
29
  array (
30
+ 'NationalNumberPattern' => '662[0-24-9]\\d{4}|6(?:[1-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}',
31
  'ExampleNumber' => '61234567',
32
  'PossibleLength' =>
33
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SL.php CHANGED
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '(?:25|3[0-5]|66|7[2-9]|8[08]|9[09])\\d{6}',
42
  'ExampleNumber' => '25123456',
43
  'PossibleLength' =>
44
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '(?:25|3[0-5]|66|7[3-9]|8[08]|9[09])\\d{6}',
42
  'ExampleNumber' => '25123456',
43
  'PossibleLength' =>
44
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_SX.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_TC.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_TT.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_US.php CHANGED
@@ -26,7 +26,7 @@ return array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
- 'NationalNumberPattern' => '5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|22|33)|4(?:00|4[24]|65|82)|5(?:00|29|58|83)|6(?:00|66|82)|7(?:58|77)|8(?:00|42|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}',
30
  'ExampleNumber' => '2015550123',
31
  'PossibleLength' =>
32
  array (
@@ -38,7 +38,7 @@ return array (
38
  ),
39
  'mobile' =>
40
  array (
41
- 'NationalNumberPattern' => '5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|22|33)|4(?:00|4[24]|65|82)|5(?:00|29|58|83)|6(?:00|66|82)|7(?:58|77)|8(?:00|42|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}',
42
  'ExampleNumber' => '2015550123',
43
  'PossibleLength' =>
44
  array (
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
26
  ),
27
  'fixedLine' =>
28
  array (
29
+ 'NationalNumberPattern' => '5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|33)|4(?:00|4[24]|65|82)|5(?:00|29|83)|6(?:00|66|82)|777|8(?:00|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}',
30
  'ExampleNumber' => '2015550123',
31
  'PossibleLength' =>
32
  array (
38
  ),
39
  'mobile' =>
40
  array (
41
+ 'NationalNumberPattern' => '5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|33)|4(?:00|4[24]|65|82)|5(?:00|29|83)|6(?:00|66|82)|777|8(?:00|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}',
42
  'ExampleNumber' => '2015550123',
43
  'PossibleLength' =>
44
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VC.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VG.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/PhoneNumberMetadata_VI.php CHANGED
@@ -82,7 +82,7 @@ return array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
- 'NationalNumberPattern' => '52(?:355[0-46-9]|4(?:5(?:2[024-9]|5[0-46-9])|60[1-9]|9(?:2[0-5]|49)))\\d{4}|52(?:3(?:[2-46-9][02-9]|5[02-46-9])|4(?:[2-478][02-9]|5[034]|6[2-9]|9[05-9])|7[2-4]\\d)\\d{5}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[1256]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
82
  ),
83
  'personalNumber' =>
84
  array (
85
+ 'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}',
86
  'ExampleNumber' => '5002345678',
87
  'PossibleLength' =>
88
  array (
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_BE.php CHANGED
@@ -27,7 +27,7 @@ return array (
27
  ),
28
  'tollFree' =>
29
  array (
30
- 'NationalNumberPattern' => '1(?:0[0-35-8]|1[02]|7(?:12|77)|813)|(?:116|8)\\d{3}',
31
  'ExampleNumber' => '100',
32
  'PossibleLength' =>
33
  array (
27
  ),
28
  'tollFree' =>
29
  array (
30
+ 'NationalNumberPattern' => '1(?:0[0-25-8]|1[02]|7(?:12|77)|813)|(?:116|8)\\d{3}',
31
  'ExampleNumber' => '100',
32
  'PossibleLength' =>
33
  array (
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_MS.php CHANGED
@@ -14,7 +14,7 @@
14
  return array (
15
  'generalDesc' =>
16
  array (
17
- 'NationalNumberPattern' => '[29]\\d\\d',
18
  'PossibleLength' =>
19
  array (
20
  0 => 3,
@@ -57,8 +57,8 @@ return array (
57
  ),
58
  'shortCode' =>
59
  array (
60
- 'NationalNumberPattern' => '211|9(?:11|88|99)',
61
- 'ExampleNumber' => '211',
62
  'PossibleLength' =>
63
  array (
64
  ),
14
  return array (
15
  'generalDesc' =>
16
  array (
17
+ 'NationalNumberPattern' => '9\\d\\d',
18
  'PossibleLength' =>
19
  array (
20
  0 => 3,
57
  ),
58
  'shortCode' =>
59
  array (
60
+ 'NationalNumberPattern' => '9(?:11|88|99)',
61
+ 'ExampleNumber' => '911',
62
  'PossibleLength' =>
63
  array (
64
  ),
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_PT.php CHANGED
@@ -27,7 +27,7 @@ return array (
27
  ),
28
  'tollFree' =>
29
  array (
30
- 'NationalNumberPattern' => '11[257]|1(?:16\\d\\d|5[1589]|8[279])\\d',
31
  'ExampleNumber' => '112',
32
  'PossibleLength' =>
33
  array (
27
  ),
28
  'tollFree' =>
29
  array (
30
+ 'NationalNumberPattern' => '11[25]|1(?:16\\d\\d|5[1589]|8[279])\\d',
31
  'ExampleNumber' => '112',
32
  'PossibleLength' =>
33
  array (
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_SC.php CHANGED
@@ -26,8 +26,8 @@ return array (
26
  ),
27
  'tollFree' =>
28
  array (
29
- 'NationalNumberPattern' => '1(?:1[146]|60)|999',
30
- 'ExampleNumber' => '111',
31
  'PossibleLength' =>
32
  array (
33
  0 => 3,
@@ -60,7 +60,7 @@ return array (
60
  ),
61
  'shortCode' =>
62
  array (
63
- 'NationalNumberPattern' => '1(?:[06]\\d|1[0-2467]|2[0-8]|3[13]|4[0-2]|[59][15]|7[124-6]|8[158])|9(?:6\\d\\d|99)',
64
  'ExampleNumber' => '100',
65
  'PossibleLength' =>
66
  array (
26
  ),
27
  'tollFree' =>
28
  array (
29
+ 'NationalNumberPattern' => '999',
30
+ 'ExampleNumber' => '999',
31
  'PossibleLength' =>
32
  array (
33
  0 => 3,
60
  ),
61
  'shortCode' =>
62
  array (
63
+ 'NationalNumberPattern' => '1(?:0\\d|1[027]|2[0-8]|3[13]|4[0-2]|[59][15]|6[1-9]|7[124-6]|8[158])|9(?:6\\d\\d|99)',
64
  'ExampleNumber' => '100',
65
  'PossibleLength' =>
66
  array (
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_SE.php CHANGED
@@ -28,10 +28,13 @@ return array (
28
  ),
29
  'tollFree' =>
30
  array (
31
- 'NationalNumberPattern' => '11(?:2|(?:3|6\\d)\\d\\d|414|77)|900\\d\\d',
32
  'ExampleNumber' => '112',
33
  'PossibleLength' =>
34
  array (
 
 
 
35
  ),
36
  'PossibleLengthLocalOnly' =>
37
  array (
28
  ),
29
  'tollFree' =>
30
  array (
31
+ 'NationalNumberPattern' => '112|(?:116\\d|900)\\d\\d',
32
  'ExampleNumber' => '112',
33
  'PossibleLength' =>
34
  array (
35
+ 0 => 3,
36
+ 1 => 5,
37
+ 2 => 6,
38
  ),
39
  'PossibleLengthLocalOnly' =>
40
  array (
vendor/giggsey/libphonenumber-for-php/src/data/ShortNumberMetadata_US.php CHANGED
@@ -28,7 +28,7 @@ return array (
28
  ),
29
  'tollFree' =>
30
  array (
31
- 'NationalNumberPattern' => '112|611|9(?:11|33|88)',
32
  'ExampleNumber' => '112',
33
  'PossibleLength' =>
34
  array (
@@ -64,7 +64,7 @@ return array (
64
  ),
65
  'shortCode' =>
66
  array (
67
- 'NationalNumberPattern' => '11(?:2|5[1-47]|[68]\\d|7[0-57]|98)|[2-9]\\d{3,5}|[2-8]11|9(?:11|33|88)',
68
  'ExampleNumber' => '112',
69
  'PossibleLength' =>
70
  array (
28
  ),
29
  'tollFree' =>
30
  array (
31
+ 'NationalNumberPattern' => '112|988|[69]11',
32
  'ExampleNumber' => '112',
33
  'PossibleLength' =>
34
  array (
64
  ),
65
  'shortCode' =>
66
  array (
67
+ 'NationalNumberPattern' => '11(?:2|5[1-47]|[68]\\d|7[0-57]|98)|[2-9]\\d{3,5}|[2-8]11|9(?:11|88)',
68
  'ExampleNumber' => '112',
69
  'PossibleLength' =>
70
  array (
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/13.php CHANGED
@@ -3117,6 +3117,7 @@ return array (
3117
  13457 => 'Cayman Islands',
3118
  134580 => 'Cayman Islands',
3119
  134581 => 'Cayman Islands',
 
3120
  1345848 => 'Cayman Islands',
3121
  134588 => 'Cayman Islands',
3122
  1345914 => 'Cayman Islands',
3117
  13457 => 'Cayman Islands',
3118
  134580 => 'Cayman Islands',
3119
  134581 => 'Cayman Islands',
3120
+ 134582 => 'Cayman Islands',
3121
  1345848 => 'Cayman Islands',
3122
  134588 => 'Cayman Islands',
3123
  1345914 => 'Cayman Islands',
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/238.php CHANGED
@@ -16,8 +16,8 @@ return array (
16
  238223 => 'Paúl, Santo Antão',
17
  238224 => 'Cocoli, Santo Antão',
18
  238225 => 'Ponta do Sol, Santo Antão',
19
- 238226 => 'Manta Velha/Chã de Igreja (Santo Antão Island)',
20
- 238227 => 'Lajedos/Alto Mira (Santo Antão Island)',
21
  238230 => 'Mindelo, São Vicente',
22
  238231 => 'Mindelo, São Vicente',
23
  238232 => 'Mindelo, São Vicente',
@@ -41,7 +41,7 @@ return array (
41
  238267 => 'Cidade Velha, Santiago',
42
  238268 => 'São Domingos, Santiago',
43
  238269 => 'Pedra Badejo, Santiago',
44
- 238271 => 'Orgão/São Jorge (Santiago Island)',
45
  238272 => 'Picos, Santiago',
46
  238273 => 'Calheta de São Miguel, Santiago',
47
  238281 => 'São Filipe, Fogo',
16
  238223 => 'Paúl, Santo Antão',
17
  238224 => 'Cocoli, Santo Antão',
18
  238225 => 'Ponta do Sol, Santo Antão',
19
+ 238226 => 'Chã da Igreja, Santo Antão',
20
+ 238227 => 'Ribeira das Patas, Santo Antão',
21
  238230 => 'Mindelo, São Vicente',
22
  238231 => 'Mindelo, São Vicente',
23
  238232 => 'Mindelo, São Vicente',
41
  238267 => 'Cidade Velha, Santiago',
42
  238268 => 'São Domingos, Santiago',
43
  238269 => 'Pedra Badejo, Santiago',
44
+ 238271 => 'São Lourenço dos Órgãos/São Jorge, Santiago',
45
  238272 => 'Picos, Santiago',
46
  238273 => 'Calheta de São Miguel, Santiago',
47
  238281 => 'São Filipe, Fogo',
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/56.php CHANGED
@@ -15,7 +15,6 @@ return array (
15
  562198 => 'Santiago, Metropolitan Region',
16
  5622 => 'Santiago, Metropolitan Region',
17
  5623 => 'Santiago, Metropolitan Region',
18
- 5626 => 'Santiago, Metropolitan Region',
19
  5632 => 'Valparaíso',
20
  5633 => 'Quillota, Valparaíso',
21
  5634 => 'San Felipe, Valparaíso',
15
  562198 => 'Santiago, Metropolitan Region',
16
  5622 => 'Santiago, Metropolitan Region',
17
  5623 => 'Santiago, Metropolitan Region',
 
18
  5632 => 'Valparaíso',
19
  5633 => 'Quillota, Valparaíso',
20
  5634 => 'San Felipe, Valparaíso',
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/en/61.php CHANGED
@@ -4480,7 +4480,7 @@ return array (
4480
  61255616 => 'Telegraph Point',
4481
  61255617 => 'Toorooka',
4482
  61255618 => 'Widden Valley',
4483
- 61255619 => 'Taree',
4484
  61255620 => 'Bowraville',
4485
  61255621 => 'Broke',
4486
  61255622 => 'Bunnan',
@@ -31586,7 +31586,7 @@ return array (
31586
  61740636 => 'Euramo',
31587
  61740637 => 'Euramo',
31588
  61740638 => 'Georgetown',
31589
- 61740639 => 'Mareeba',
31590
  6174064 => 'South Johnstone',
31591
  61740649 => 'Herberton',
31592
  6174065 => 'Silkwood',
@@ -31648,7 +31648,7 @@ return array (
31648
  61740741 => 'Mutchilba',
31649
  61740742 => 'Peninsula',
31650
  61740743 => 'Ravenshoe',
31651
- 61740744 => 'Ravenshoe',
31652
  61740745 => 'South Johnstone',
31653
  61740746 => 'Thursday Island',
31654
  61740747 => 'Torres',
@@ -33779,7 +33779,7 @@ return array (
33779
  61743480 => 'Boondooma',
33780
  61743481 => 'Booyal',
33781
  61743482 => 'Brooklands',
33782
- 61743483 => 'Bundaberg',
33783
  61743484 => 'Bundaberg',
33784
  61743485 => 'Bunker',
33785
  61743486 => 'Burnett',
@@ -40461,7 +40461,7 @@ return array (
40461
  61752290 => 'Imbil',
40462
  61752291 => 'Jimna',
40463
  61752292 => 'Kalbar',
40464
- 61752293 => 'Laidley',
40465
  61752294 => 'Kia Ora',
40466
  61752295 => 'Kilcoy',
40467
  61752296 => 'Kilkivan',
4480
  61255616 => 'Telegraph Point',
4481
  61255617 => 'Toorooka',
4482
  61255618 => 'Widden Valley',
4483
+ 61255619 => 'Baerami',
4484
  61255620 => 'Bowraville',
4485
  61255621 => 'Broke',
4486
  61255622 => 'Bunnan',
31586
  61740636 => 'Euramo',
31587
  61740637 => 'Euramo',
31588
  61740638 => 'Georgetown',
31589
+ 61740639 => 'Gordonvale',
31590
  6174064 => 'South Johnstone',
31591
  61740649 => 'Herberton',
31592
  6174065 => 'Silkwood',
31648
  61740741 => 'Mutchilba',
31649
  61740742 => 'Peninsula',
31650
  61740743 => 'Ravenshoe',
31651
+ 61740744 => 'Silkwood',
31652
  61740745 => 'South Johnstone',
31653
  61740746 => 'Thursday Island',
31654
  61740747 => 'Torres',
33779
  61743480 => 'Boondooma',
33780
  61743481 => 'Booyal',
33781
  61743482 => 'Brooklands',
33782
+ 61743483 => 'Brooweena',
33783
  61743484 => 'Bundaberg',
33784
  61743485 => 'Bunker',
33785
  61743486 => 'Burnett',
40461
  61752290 => 'Imbil',
40462
  61752291 => 'Jimna',
40463
  61752292 => 'Kalbar',
40464
+ 61752293 => 'Kenilworth',
40465
  61752294 => 'Kia Ora',
40466
  61752295 => 'Kilcoy',
40467
  61752296 => 'Kilkivan',
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/es/56.php CHANGED
@@ -15,7 +15,6 @@ return array (
15
  562198 => 'Santiago, Región Metropolitana',
16
  5622 => 'Santiago, Región Metropolitana',
17
  5623 => 'Santiago, Región Metropolitana',
18
- 5626 => 'Santiago, Región Metropolitana',
19
  5658 => 'Arica, Arica y Parinacota',
20
  5661 => 'Punta Arenas, Magallanes',
21
  5667 => 'Coihaique, Aysén',
15
  562198 => 'Santiago, Región Metropolitana',
16
  5622 => 'Santiago, Región Metropolitana',
17
  5623 => 'Santiago, Región Metropolitana',
 
18
  5658 => 'Arica, Arica y Parinacota',
19
  5661 => 'Punta Arenas, Magallanes',
20
  5667 => 'Coihaique, Aysén',
vendor/giggsey/libphonenumber-for-php/src/geocoding/data/pt/238.php CHANGED
@@ -16,8 +16,8 @@ return array (
16
  238223 => 'Paúl, Santo Antão',
17
  238224 => 'Cocoli, Santo Antão',
18
  238225 => 'Ponta do Sol, Santo Antão',
19
- 238226 => 'Manta Velha/Chã de Igreja (Santo Antão Island)',
20
- 238227 => 'Lajedos/Alto Mira (Santo Antão Island)',
21
  238230 => 'Mindelo, São Vicente',
22
  238231 => 'Mindelo, São Vicente',
23
  238232 => 'Mindelo, São Vicente',
@@ -41,7 +41,7 @@ return array (
41
  238267 => 'Cidade Velha, Santiago',
42
  238268 => 'São Domingos, Santiago',
43
  238269 => 'Pedra Badejo, Santiago',
44
- 238271 => 'Orgão/São Jorge (Santiago Island)',
45
  238272 => 'Picos, Santiago',
46
  238273 => 'Calheta de São Miguel, Santiago',
47
  238281 => 'São Filipe, Fogo',
16
  238223 => 'Paúl, Santo Antão',
17
  238224 => 'Cocoli, Santo Antão',
18
  238225 => 'Ponta do Sol, Santo Antão',
19
+ 238226 => 'Chã da Igreja, Santo Antão',
20
+ 238227 => 'Ribeira das Patas, Santo Antão',
21
  238230 => 'Mindelo, São Vicente',
22
  238231 => 'Mindelo, São Vicente',
23
  238232 => 'Mindelo, São Vicente',
41
  238267 => 'Cidade Velha, Santiago',
42
  238268 => 'São Domingos, Santiago',
43
  238269 => 'Pedra Badejo, Santiago',
44
+ 238271 => 'São Lourenço dos Órgãos/São Jorge, Santiago',
45
  238272 => 'Picos, Santiago',
46
  238273 => 'Calheta de São Miguel, Santiago',
47
  238281 => 'São Filipe, Fogo',
wgact.php CHANGED
@@ -10,19 +10,21 @@
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
- * * Version: 1.16.6
14
  *
15
  * WC requires at least: 3.7
16
- * WC tested up to: 6.3
17
  *
18
  * License: GNU General Public License v3.0
19
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
  *
22
  **/
23
- const WPM_CURRENT_VERSION = '1.16.6' ;
24
  // TODO export settings function
25
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
 
 
26
 
27
  if ( !defined( 'ABSPATH' ) ) {
28
  exit;
@@ -125,13 +127,13 @@ if ( function_exists( 'wpm_fs' ) ) {
125
  require __DIR__ . '/vendor/autoload.php';
126
  }
127
  $this->setup_freemius_environment();
 
128
  // running the DB updater
129
  if ( get_option( WPM_DB_OPTIONS_NAME ) ) {
130
  ( new Db_Upgrade() )->run_options_db_upgrade();
131
  }
132
  // load the options
133
  $this->wpm_options_init();
134
- $this->environment_check = new Environment_Check( $this->options );
135
  if ( isset( $this->options['google']['gads']['dynamic_remarketing'] ) && $this->options['google']['gads']['dynamic_remarketing'] ) {
136
  // make sure to disable the WGDR plugin in case we use dynamic remarketing in this plugin
137
  add_filter( 'wgdr_third_party_cookie_prevention', '__return_true' );
@@ -142,19 +144,16 @@ if ( function_exists( 'wpm_fs' ) ) {
142
  add_action( 'admin_notices', function () {
143
  $this->environment_check->run_incompatible_plugins_checks();
144
  } );
145
- $this->environment_check->disable_third_party_js_optimization();
146
- if ( $this->options['general']['maximum_compatibility_mode'] ) {
147
- $this->environment_check->enable_compatibility_mode();
148
- }
149
  $this->environment_check->flush_cache_on_plugin_changes();
150
  register_activation_hook( __FILE__, [ $this, 'plugin_activated' ] );
151
  register_deactivation_hook( __FILE__, [ $this, 'plugin_deactivated' ] );
152
- // $this->init();
153
- add_action( 'woocommerce_init', [ $this, 'init' ] );
154
  } else {
155
  add_action( 'admin_menu', [ $this, 'add_empty_admin_page' ], 99 );
156
  add_action( 'admin_notices', [ $this, 'requirements_error' ] );
157
- // error_log('The WooCommerce Pixel Manager requires the WooCommerce plugin to be active.');
158
  }
159
 
160
  }
@@ -227,6 +226,10 @@ if ( function_exists( 'wpm_fs' ) ) {
227
 
228
  public function environment_check_admin_notices()
229
  {
 
 
 
 
230
  if ( apply_filters( 'wpm_show_admin_alerts', apply_filters_deprecated(
231
  'wooptpm_show_admin_alerts',
232
  [ true ],
@@ -237,6 +240,19 @@ if ( function_exists( 'wpm_fs' ) ) {
237
  }
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  // startup all functions
241
  public function init()
242
  {
@@ -251,8 +267,7 @@ if ( function_exists( 'wpm_fs' ) ) {
251
  }
252
 
253
  // inject pixels into front end
254
- // add_action('after_setup_theme', [$this, 'inject_pixels']);
255
- $this->inject_pixels();
256
  }
257
 
258
  public function inject_pixels()
@@ -298,6 +313,11 @@ if ( function_exists( 'wpm_fs' ) ) {
298
  $this->options = ( new Default_Options() )->get_default_options();
299
  } else {
300
  // Check if each single option has been set. If not, set them. That is necessary when new options are introduced.
 
 
 
 
 
301
  // add new default options to the options db array
302
  $this->options = ( new Default_Options() )->update_with_defaults( $this->options, ( new Default_Options() )->get_default_options() );
303
  }
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
+ * Version: 1.14.2
14
  *
15
  * WC requires at least: 3.7
16
+ * WC tested up to: 6.1
17
  *
18
  * License: GNU General Public License v3.0
19
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
  *
22
  **/
23
+ const WPM_CURRENT_VERSION = '1.14.2' ;
24
  // TODO export settings function
25
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
26
+ // TODO ask inverse cookie approval. Only of cookies have been allowed, fire the pixels.
27
+ // TODO remove google_business_vertical cleanup
28
 
29
  if ( !defined( 'ABSPATH' ) ) {
30
  exit;
127
  require __DIR__ . '/vendor/autoload.php';
128
  }
129
  $this->setup_freemius_environment();
130
+ $this->environment_check = new Environment_Check();
131
  // running the DB updater
132
  if ( get_option( WPM_DB_OPTIONS_NAME ) ) {
133
  ( new Db_Upgrade() )->run_options_db_upgrade();
134
  }
135
  // load the options
136
  $this->wpm_options_init();
 
137
  if ( isset( $this->options['google']['gads']['dynamic_remarketing'] ) && $this->options['google']['gads']['dynamic_remarketing'] ) {
138
  // make sure to disable the WGDR plugin in case we use dynamic remarketing in this plugin
139
  add_filter( 'wgdr_third_party_cookie_prevention', '__return_true' );
144
  add_action( 'admin_notices', function () {
145
  $this->environment_check->run_incompatible_plugins_checks();
146
  } );
147
+ $this->environment_check->permanent_compatibility_mode();
148
+ $this->run_compatibility_modes();
 
 
149
  $this->environment_check->flush_cache_on_plugin_changes();
150
  register_activation_hook( __FILE__, [ $this, 'plugin_activated' ] );
151
  register_deactivation_hook( __FILE__, [ $this, 'plugin_deactivated' ] );
152
+ $this->init();
 
153
  } else {
154
  add_action( 'admin_menu', [ $this, 'add_empty_admin_page' ], 99 );
155
  add_action( 'admin_notices', [ $this, 'requirements_error' ] );
156
+ error_log( 'The WooCommerce Pixel Manager requires the WooCommerce plugin to be active.' );
157
  }
158
 
159
  }
226
 
227
  public function environment_check_admin_notices()
228
  {
229
+ // if (apply_filters('wpm_show_admin_notifications', true))
230
+ // {
231
+ //
232
+ // }
233
  if ( apply_filters( 'wpm_show_admin_alerts', apply_filters_deprecated(
234
  'wooptpm_show_admin_alerts',
235
  [ true ],
240
  }
241
  }
242
 
243
+ private function run_compatibility_modes()
244
+ {
245
+ /*
246
+ * Compatibility modes
247
+ */
248
+ if ( $this->options['general']['maximum_compatibility_mode'] ) {
249
+ $this->environment_check->enable_maximum_compatibility_mode();
250
+ }
251
+ if ( $this->options['general']['maximum_compatibility_mode'] && $this->options['facebook']['microdata'] ) {
252
+ $this->environment_check->enable_maximum_compatibility_mode_yoast_seo();
253
+ }
254
+ }
255
+
256
  // startup all functions
257
  public function init()
258
  {
267
  }
268
 
269
  // inject pixels into front end
270
+ add_action( 'after_setup_theme', [ $this, 'inject_pixels' ] );
 
271
  }
272
 
273
  public function inject_pixels()
313
  $this->options = ( new Default_Options() )->get_default_options();
314
  } else {
315
  // Check if each single option has been set. If not, set them. That is necessary when new options are introduced.
316
+ // cleanup the db of this setting
317
+ // remove by end of 2021 latest
318
+ if ( array_key_exists( 'google_business_vertical', $this->options ) ) {
319
+ unset( $this->options['google_business_vertical'] );
320
+ }
321
  // add new default options to the options db array
322
  $this->options = ( new Default_Options() )->update_with_defaults( $this->options, ( new Default_Options() )->get_default_options() );
323
  }