woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
210 stars 137 forks source link

ViewContent triggered on all pages #2777

Closed HonzaKopecky closed 1 month ago

HonzaKopecky commented 1 month ago

🔎 Isolate the bug

✍️ Describe the bug

On our website, https://jagaia.cz we are experencing strange behaviour where the ViewContent event is fired on every page load. No matter whether the page is a static page, category page or product, the ViewContent event is fired. The event has only one parameter and that's currency.

On a product page though, the event above is fired and then another ViewContent event is fired. This second event then contains all parameters expected.

I tried to search all the source files for fbq, ViewContent and so on but I can't find where is the ViewContent triggered.

✔️ Expected behavior

I would expect the ViewContent event to only be fired on a product page and to contain all the expected parameters.

🗃 Logs

System Status Report ``` ### WordPress Environment ### WordPress address (URL): [Redacted] Site address (URL): [Redacted] WC Version: 9.1.4 Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site. Action Scheduler Version: ✔ 3.7.4 Log Directory Writable: ✔ WP Version: 6.6.1 WP Multisite: – WP Memory Limit: 1 GB WP Debug Mode: ✔ WP Cron: ✔ Language: cs_CZ External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 8.2.21 PHP Post Max Size: 100 MB PHP Time Limit: 30 PHP Max Input Vars: 1000000 cURL Version: 7.87.0 OpenSSL/1.1.1w SUHOSIN Installed: – MySQL Version: 8.0.36 Max Upload Size: 100 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### [REDACTED] ### Post Type Counts ### attachment: 2304 customize_changeset: 12 elementor_library: 17 iwp_log: 116 ml-slide: 1 ml-slider: 1 nav_menu_item: 17 oembed_cache: 1 page: 66 popupbuilder: 31 post: 6 product: 229 product_variation: 332 revision: 549 shopmagic_automation: 1 shop_coupon: 99 shop_order: 4277 shop_order_refund: 47 um_directory: 1 um_form: 3 wc_order_email: 1 wc_order_status: 7 wp_global_styles: 1 wp_navigation: 1 wp_template: 2 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (44) ### weLaunch Framework: Autor: weLaunch.io – 1.1.1 WPML Multilingual CMS: Autor: OnTheGoSystems – 4.6.12 Admin Menu Editor: Autor: Janis Elsts – 1.12.4 Free Shipping Bar: Amount Left for Free Shipping for WooCommerce: Autor: WPFactory – 2.3.10 Complianz | GDPR/CCPA Cookie Souhlas: Autor: Really Simple Plugins – 7.1.0 Elementor Pro: Autor: Elementor.com – 3.23.2 Elementor: Autor: Elementor.com – 3.23.4 Facebook pro WooCommerce: Autor: Facebook – 3.2.6 Flexible Checkout Fields PRO: Autor: WP Desk – 4.0.10 Flexible Checkout Fields: Autor: WP Desk – 4.1.12 Smash Balloon Instagram Feed: Autor: Smash Balloon – 6.5.0 Kadence WooCommerce Email Designer: Autor: Kadence WP – 1.5.13 WooCommerce Load More Products: Autor: BeRocket – 1.2 Mailchimp for WooCommerce: Autor: Mailchimp – 4.2.1 Mergado marketing pack: Autor: Mergado technologies s. r. o. – 3.7.3 WooCommerce Order Emails Log: Autor: RaiserWeb – 1.4 Popup Builder: Autor: Looking Forward Software Incorporated. – 4.3.3 Smart Slider 3: Autor: Další – 3.5.1.23 Toret Fio: Autor: toret.cz – 1.2.11 Toret Zásilkovna: Autor: Toret.cz – 6.6.2 Ultimate Member: Autor: Ultimate Member – 2.8.6 Editor uživatelských rolí: Autor: Vladimir Garagulya – 4.64.2 User Switching: Autor: John Blackbourn – 1.8.0 WooCommerce Weight Based Shipping: Autor: weightbasedshipping.com – 5.9.3 Discount Rules PRO 2.0: Autor: Flycart – 2.6.4 Discount Rules Core: Autor: Flycart – 2.6.4 Woo GoPay Inline: Autor: Toret.cz – 2.5.2 MultiStep Checkout for WooCommerce: Autor: ThemeHigh – 2.2.7 Product Feed PRO for WooCommerce: Autor: AdTribes.io – 13.3.4 Woo Sledování: Autor: toret.cz – 1.4.2 Variation Swatches for WooCommerce: Autor: Emran Ahmed – 2.1.1 WooCommerce Multilingual & Multicurrency: Autor: OnTheGoSystems – 5.3.6 PDF Invoices & Packing Slips for WooCommerce: Autor: WP Overnight – 3.8.6 PDF Invoices & Packing Slips for WooCommerce - Professional: Autor: WP Overnight – 2.15.10 WooCommerce Product Batch Numbers: Autor: WP Overnight – 3.2.2 WooCommerce Single Variations: Autor: weLaunch – 1.3.18 Skladový manažer pro WooCommerce: Autor: StoreApps – 3.1.0 WooCommerce: Autor: Automattic – 9.1.4 Wordfence Security: Autor: Wordfence – 7.11.7 WP Super Cache: Autor: Automattic – 1.12.4 WPFront Notification Bar: Autor: Syam Mohan – 3.4.2 WPML String Translation: Autor: OnTheGoSystems – 3.2.14 WP Overnight Sidekick: Autor: WP Overnight – 2.5.1 YIKES Custom Product Tabs pro WooCommerce: Autor: Code Parrots – 1.8.5 ### Inactive Plugins (19) ### Advanced Database Cleaner: Autor: Younes JFR. – 3.1.4 Checkout Field Editor for WooCommerce: Autor: ThemeHigh – 2.0.3 Checkout Field Editor for WooCommerce (Pro): Autor: ThemeHigh – 3.6.0 Code Profiler: Autor: Jerome Bruandet ~ NinTechNet Ltd. – 1.6.10 Duplicator: Autor: Duplicator – 1.5.10.2 Lightweight Grid Columns: Autor: Tom Usborne – 1.0 Maintenance: Autor: WebFactory Ltd – 4.12 Query Monitor: Autor: John Blackbourn – 3.16.4 UpdraftPlus - Backup/Restore: Autor: UpdraftPlus.Com DavidAnderson – 1.24.4 WooCommerce platiti.cz adapter: Autor: platiti.cz – 1.00 WooCommerce Twisto: Autor: platiti.cz – 1.00 WP-Optimize - Clean, Compress, Cache: Autor: David Anderson Ruhani Rabin Team Updraft – 3.4.2 WP-Sweep: Autor: Lester 'GaMerZ' Chan – 1.1.8 WP Activity Log: Autor: Melapress – 5.1.0 WP Activity Log for WooCommerce: Autor: Melapress – 1.5.2 WP All Export: Autor: Soflyy – 1.4.8 WP All Export - WooCommerce Order Export Add-On: Autor: Soflyy – 1.0.4 WPML Media Translation: Autor: OnTheGoSystems – 2.7.4 WPML SEO: Autor: OnTheGoSystems – 2.1.0 ### Dropin Plugins () ### advanced-cache.php: advanced-cache.php ### Must Use Plugins (1) ### CDN Cache Plugin: Autor: – 1.1.3 ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: CZK (Kč) Currency Position: right_space Thousand Separator: Decimal Separator: . Number of Decimals: 0 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: – ### Logging ### Enabled: ✔ Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2 Retention period: 30 dnů Level threshold: – Log directory size: 7 MB ### WC Pages ### Obchod: #3168 - /obchod/ Košík: #5 - /kosik/ - Contains the [woocommerce_cart] shortcode Pokladna: #3170 - /pokladna/ - Contains the [woocommerce_checkout] shortcode Můj účet: #3171 - /muj-ucet/ Obchodní podmínky: #484 - /obchodni-podminky/ ### Theme ### Name: Weston JAGAIA.CZ Version: 2.0.13 Author URL: https://www.linkedin.com/in/honzakopecky Child Theme: ✔ Parent Theme Name: Weston Parent Theme Version: 2.1.6 Parent Theme Author URL: http://themetrust.com WooCommerce Support: ✔ ### Templates ### Overrides: themetrust-weston-child/woocommerce/archive-product.php verze 4.0 je neaktuální. Verze jádra je 8.6.0 themetrust-weston-child/woocommerce/cart/cart-totals.php themetrust-weston-child/woocommerce/cart/cart.php verze 7.0.1 je neaktuální. Verze jádra je 7.9.0 themetrust-weston-child/woocommerce/cart/mini-cart.php verze 5.2.0 je neaktuální. Verze jádra je 7.9.0 themetrust-weston-child/woocommerce/checkout/form-pay.php verze 7.0.1 je neaktuální. Verze jádra je 8.2.0 themetrust-weston-child/woocommerce/checkout/payment.php verze 7.0.1 je neaktuální. Verze jádra je 8.1.0 themetrust-weston-child/woocommerce/checkout/review-order.php themetrust-weston-child/woocommerce/checkout/thankyou.php verze 3.7.0 je neaktuální. Verze jádra je 8.1.0 themetrust-weston-child/woocommerce/content-product.php themetrust-weston-child/woocommerce/content-single-product.php themetrust-weston-child/woocommerce/emails/customer-completed-order.php themetrust-weston-child/woocommerce/emails/customer-new-account.php themetrust-weston-child/woocommerce/emails/customer-on-hold-order.php themetrust-weston-child/woocommerce/emails/email-header.php verze 4.0.0 je neaktuální. Verze jádra je 7.4.0 themetrust-weston/woocommerce/global/form-login.php themetrust-weston/woocommerce/global/sidebar.php themetrust-weston-child/woocommerce/loop/add-to-cart.php verze 3.3.0 je neaktuální. Verze jádra je 9.0.0 themetrust-weston-child/woocommerce/myaccount/dashboard.php themetrust-weston-child/woocommerce/myaccount/form-edit-account.php verze 7.0.1 je neaktuální. Verze jádra je 8.7.0 themetrust-weston-child/woocommerce/myaccount/my-address.php verze 2.6.0 je neaktuální. Verze jádra je 8.7.0 themetrust-weston-child/woocommerce/single-product/add-to-cart/variable.php themetrust-weston-child/woocommerce/single-product/meta.php themetrust-weston-child/woocommerce/single-product/rating.php themetrust-weston-child/woocommerce/single-product/related.php themetrust-weston-child/woocommerce/single-product/tabs/additional-information.php themetrust-weston-child/woocommerce/single-product/tabs/description.php themetrust-weston-child/woocommerce/single-product/tabs/tabs.php themetrust-weston-child/woocommerce/single-product-reviews.php themetrust-weston-child/woocommerce/single-product.php Outdated Templates: ❌ Zjistěte jak aktualizovat ### Admin ### Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customize-store customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks product-custom-fields remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page launch-your-store Disabled Features: experimental-blocks minified-js pattern-toolkit-full-composability product-pre-publish-modal printful settings async-product-editor-category-field product-editor-template-system Daily Cron: ✔ Next scheduled: 2024-08-07 12:07:53 +02:00 Options: ✔ Notes: 4 Onboarding: completed ### Action Scheduler ### Zrušeno: 84 Oldest: 2024-07-07 16:50:20 +0200 Newest: 2024-08-07 10:23:13 +0200 Dokončeno: 1 388 Oldest: 2024-07-07 14:06:33 +0200 Newest: 2024-08-07 13:58:03 +0200 Selhalo: 417 Oldest: 2022-10-08 10:26:41 +0200 Newest: 2024-08-07 08:50:51 +0200 Čekající: 5 Oldest: 2024-08-07 14:12:27 +0200 Newest: 2025-01-01 00:00:01 +0100 ### Status report information ### Generated at: 2024-08-07 14:01:14 +02:00 ```
rawdreeg commented 1 month ago

Hi there,

I haven't been able to reproduce the issue. ViewContent is specifically added to the woocommerce_after_single_product action hook, and we check that the page is a product before pushing the event. I suggest running a conflict check on a staging site. If the issue persists, please open a support ticket on woocommerce.com or the wordpress.org forums if you need further assistance.