Title: CAPI issues
Last modified: January 8, 2023

---

# CAPI issues

 *  Resolved [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/)
 * This has been probably the most frustrating debuggging in years. I’ve been trying
   to get CAPI to work for days now, but still have unresolved issues:
    1. Not all Woocommerce orders are sent as Purchase CAPI event by the plugin Facebook
       for Woocommerce. In the Woocommerce status server logs I count only 5 CAPI calls
       for yesterdays Purchase events while I have 8 orders.
    2. The 3 orders that did not fire, were exactly the orders that originate from 
       a FB ad. I can tell because of a coupon that is only used for FB.
    3. In Meta’s Event Manager, all 5 CAPI calls are registered. However, the Total
       browser events received from Pixel is only 3 (out of 8). I can’t see if these
       were people coming from FB ads (can’t see whether fbc-variable was set).
    4. AddToCart does show 14 browser / 14 server events out of 14 CAPI calls in the
       server logs. Including 8 originating from Facebook ads (fbc variable is set 
       in 8 out of 14 cases). If browser calls would have been blocked, this would 
       also show in other events, not only in Purchase events.
    5. InitiateCheckout event was called 13 times by CAPI, with 5 cases having a fbc-
       variable set. Assuming someone has to addToCart at least once before InitiatingCheckout,
       it is strange there are more calls with empty fbc-variable than in the previous
       case (AddToCart). This means fbc-variable gets unset in 1 click after addToCart?
       Strange…
 * Already checked:
    1. No fatal errors in the Woocommerce status logs that would indicate any issues.
       No errors in the FBfW-logs, no mention of these missing orders in the FBfW-logs.
    2. Most people order 1 product, so it is normal AddToCart and InitiateCheckout 
       are almost the same
 * Please help me with the following questions:
    - How do I further debug this?
    - Does the CAPI Purchase event fire on the thank-you-page, or does it fire on
      the call-back of the payment provider when order is set to “processing”? (
      in a major unlucky case it could be that all 3 orders closed their browser
      before returning from the payment provider and all other 5 orders didn’t prematurely
      close their browser 🤨)
    - One possible cause of these issues: FB Ads show inside Instagram (on iOS).
      When clicked, Instagram opens an in-app Safari window, it does not offload
      the user to the native Safari browser. For payment, the user is sent to a 
      payment app on mobile phone. After payment, the payment app returns user to
      native Safari app (not back to Instagram app). How can I pass along the Facebook
      session / cookie / id’s from the Instagram in-app safari window with the return-
      url of the payment provider? And how do I fix this for the events fired by
      the pixel?
    - If the above is indeed the issue: Then why doesn’t Facebook for Woocommerce
      fire a CAPI call without fbc or other session info, sending userdata like 
      email and name? Or why doesn’t FBfW log an error in the logs? The orders that“
      failed” don’t appear anywhere…
    - Is there any way to trigger FBfW to send a CAPI call for a given order, for
      example with AutomateWoo? If External ID is supplied, FB should be able to
      dedupe, even is session info is missing?
 * Thanks for your help!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcapi-issues%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16353823)
 * After some further digging, it seems it is indeed caused by the visitor being
   sent to his/her payment app and being returned not to Instagram in-app browser,
   but to Safari.
 * Then the big question arises:
 * If you take the trouble to make a server-to-server solution to track conversions,
   why do you still rely on a session cookie to make this work? Why not store all
   necessary information in the order meta, so a CAPI purchase event can be sent
   without user interaction? All payment providers know you can’t rely on user interaction,
   so they have all implemented this with a decent callback… FB should do the same…
 *  [Igor H](https://wordpress.org/support/users/ihereira/)
 * (@ihereira)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16354466)
 * Hello,
 * As a first step, please share a copy of your site’s **System Status Report** 
   to get a better idea about the site’s configuration, you can find it via **WooCommerce
   > Status**. Select “Get system report” and then “Copy for support”. 
 * We’ll look forward to hearing from you.
 *  Thread Starter [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16355836)
 *     ```wp-block-code
       ### WordPress Environment ###
   
       WordPress address (URL): https://brutebonen.nl
       Site address (URL): https://brutebonen.nl
       WC Version: 7.2.2
       REST API Version: ✔</img> 7.2.2
       WC Blocks Version: ✔</img> 8.9.2
       Action Scheduler Version: ✔</img> 3.5.3
       Log Directory Writable: ✔</img>
       WP Version: 6.1.1
       WP Multisite: –
       WP Memory Limit: 1 GB
       WP Debug Mode: –
       WP Cron: –
       Language: nl_NL
       External object cache: –
   
       ### Server Environment ###
   
       Server Info: LiteSpeed
       PHP Version: 7.4.30
       PHP Post Max Size: 512 MB
       PHP Time Limit: 120
       PHP Max Input Vars: 8000
       cURL Version: 7.84.0
       OpenSSL/1.1.1p
   
       SUHOSIN Installed: –
       MySQL Version: 10.5.16-MariaDB-cll-lve
       Max Upload Size: 512 MB
       Default Timezone is UTC: ✔</img>
       fsockopen/cURL: ✔</img>
       SoapClient: ✔</img>
       DOMDocument: ✔</img>
       GZip: ✔</img>
       Multibyte String: ✔</img>
       Remote Post: ✔</img>
       Remote Get: ✔</img>
   
       ### Database ###
   
       WC Database Version: 7.2.2
       WC Database Prefix: wp_
       Totale database grootte: 469.82MB
       Database gegevens grootte: 259.76MB
       Database index grootte: 210.06MB
       wp_woocommerce_sessions: Data: 1.02MB + Index: 0.02MB + Engine InnoDB
       wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
       wp_woocommerce_order_items: Data: 3.52MB + Index: 2.52MB + Engine InnoDB
       wp_woocommerce_order_itemmeta: Data: 35.56MB + Index: 23.06MB + Engine InnoDB
       wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
       wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_actionscheduler_actions: Data: 12.52MB + Index: 10.52MB + Engine InnoDB
       wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_actionscheduler_logs: Data: 6.52MB + Index: 5.03MB + Engine InnoDB
       wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
       wp_automatewoo_customers: Data: 0.23MB + Index: 0.64MB + Engine InnoDB
       wp_automatewoo_customer_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_automatewoo_events: Data: 0.06MB + Index: 0.05MB + Engine InnoDB
       wp_automatewoo_guests: Data: 0.14MB + Index: 0.28MB + Engine InnoDB
       wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_automatewoo_logs: Data: 1.52MB + Index: 1.05MB + Engine InnoDB
       wp_automatewoo_log_meta: Data: 5.52MB + Index: 3.03MB + Engine InnoDB
       wp_automatewoo_queue: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
       wp_automatewoo_queue_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_bb_klant: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_bb_klant_afname: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_bb_wachtlijst: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_bv_activities_store: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_bv_ip_store: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_comments: Data: 18.55MB + Index: 17.09MB + Engine InnoDB
       wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_e_notes: Data: 0.02MB + Index: 0.17MB + Engine InnoDB
       wp_e_notes_users_relations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
       wp_e_submissions: Data: 0.02MB + Index: 0.27MB + Engine InnoDB
       wp_e_submissions_actions_log: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
       wp_e_submissions_values: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_feedmanager_channel: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_feedmanager_country: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_feedmanager_feed_status: Data: 0.02MB + Index: 0.13MB + Engine InnoDB
       wp_feedmanager_field_categories: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_feedmanager_product_feed: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_feedmanager_product_feedmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_feedmanager_source: Data: 0.02MB + Index: 0.13MB + Engine InnoDB
       wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_litespeed_url: Data: 0.06MB + Index: 0.06MB + Engine InnoDB
       wp_litespeed_url_file: Data: 0.06MB + Index: 0.14MB + Engine InnoDB
       wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_mollie_pending_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_options: Data: 6.23MB + Index: 0.28MB + Engine InnoDB
       wp_postmeta: Data: 141.69MB + Index: 117.38MB + Engine InnoDB
       wp_posts: Data: 9.52MB + Index: 8.06MB + Engine InnoDB
       wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_rank_math_404_logs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_rank_math_analytics_gsc: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
       wp_rank_math_analytics_objects: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
       wp_rank_math_internal_links: Data: 0.06MB + Index: 0.02MB + Engine InnoDB
       wp_rank_math_internal_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_rank_math_redirections: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_rank_math_redirections_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_sib_model_contact: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_termmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
       wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_usermeta: Data: 4.52MB + Index: 6.03MB + Engine InnoDB
       wp_users: Data: 0.27MB + Index: 0.23MB + Engine InnoDB
       wp_wcpdf_credit_note_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wcpdf_invoice_number_2021: Data: 0.28MB + Index: 0.00MB + Engine InnoDB
       wp_wcpdf_invoice_number_2022: Data: 0.25MB + Index: 0.00MB + Engine InnoDB
       wp_wcpdf_packing_slip_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wcpdf_proforma_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wcs_payment_retries: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
       wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
       wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wc_customer_lookup: Data: 0.31MB + Index: 0.25MB + Engine InnoDB
       wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_wc_order_bundle_lookup: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
       wp_wc_order_coupon_lookup: Data: 0.08MB + Index: 0.11MB + Engine InnoDB
       wp_wc_order_product_lookup: Data: 3.52MB + Index: 6.06MB + Engine InnoDB
       wp_wc_order_stats: Data: 2.52MB + Index: 3.53MB + Engine InnoDB
       wp_wc_order_tax_lookup: Data: 1.52MB + Index: 2.02MB + Engine InnoDB
       wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
       wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
       wp_woocommerce_bundled_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
       wp_wpforms_db: Data: 1.52MB + Index: 0.00MB + Engine InnoDB
       wp_wpforms_entries: Data: 0.31MB + Index: 0.02MB + Engine InnoDB
       wp_wpforms_entry_fields: Data: 0.13MB + Index: 0.19MB + Engine InnoDB
       wp_wpforms_entry_meta: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
       wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
       wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
   
       ### Post Type Counts ###
   
       acf-field: 17
       acf-field-group: 4
       attachment: 250
       aw_workflow: 6
       customize_changeset: 1
       elementor_library: 9
       faq: 17
       fpf_fields: 3
       jetpack_migration: 2
       jp_img_sitemap: 1
       jp_sitemap: 1
       jp_sitemap_master: 1
       nav_menu_item: 37
       nova_menu_item: 28
       ocean_modal_window: 5
       oembed_cache: 3
       page: 59
       post: 54
       product: 36
       product_variation: 64
       revision: 13
       shop_coupon: 4909
       shop_order: 25395
       shop_order_refund: 23
       shop_subscription: 91
       ufaq: 1
       wp_global_styles: 1
       wpforms: 7
   
       ### Security ###
   
       Secure connection (HTTPS): ✔</img>
       Hide errors from visitors: ✔</img>
   
       ### Active Plugins (35) ###
   
       Query Monitor: door John Blackbourn – 3.11.0
       Advanced Custom Fields: door WP Engine – 6.0.6
       Akismet Anti-Spam: door Automattic – 5.0.2
       Arconix FAQ: door Tyche Softwares – 1.9.2
       AutomateWoo: door WooCommerce – 5.6.2
       Brute Bonen Core plugin: door Jop Brocker – 1.0.0
       Database for WPforms: door wpdebuglog – 1.0.4
       Yoast Duplicate Post: door Enrico Battocchi & Team Yoast – 4.5
       GTM4WP: door Thomas Geiger – 1.16.2
       Elementor Pro: door Elementor.com – 3.9.2
       Elementor: door Elementor.com – 3.9.2
       Facebook for WooCommerce: door Facebook – 3.0.7
       Flexible Product Fields: door WP Desk – 2.3.4
       Health Check & Troubleshooting: door De WordPress.org community – 1.5.1
       Klaviyo: door Klaviyo
       Inc. – 3.0.6
   
       LiteSpeed Cache: door LiteSpeed Technologies – 5.3.1
       Mollie-betalingen voor WooCommerce: door Mollie – 7.1.0
       Ocean Extra: door OceanWP – 2.0.6
       Ocean Modal Window: door OceanWP – 2.0.8
       Ocean Sticky Header: door OceanWP – 2.0.5
       Perfect Brands for WooCommerce: door QuadLayers – 2.5.4
       Rank Math SEO: door Rank Math – 1.0.105
       Tribe - Klaviyo WooCommerce Subscription Events: door Tribe Interactive
       LLC – 1.5
   
       WooCommerce NL Postcode Checker: door WP Overnight – 2.9.1
       WooCommerce Quick Manual Products: door WP Overnight – 1.4.3
       PDF Invoices & Packing Slips for WooCommerce: door WP Overnight – 3.2.6
       PDF Invoices & Packing Slips for WooCommerce - Professional: door WP Overnight – 2.13.7
       WooCommerce Product Bundles: door WooCommerce – 6.17.3
       WooCommerce Smart Coupons: door StoreApps – 7.0.0
       WooCommerce: door Automattic – 7.2.2
       WP Crontrol: door John Blackbourn & crontributors – 1.15.1
       WP Mail SMTP: door WPForms – 3.7.0
       WP Product Feed Manager: door Michel Jongbloed – 1.46.0
       WPForms: door WPForms – 1.7.9
       WP Overnight Sidekick: door WP Overnight – 2.5.1
   
       ### Inactive Plugins (10) ###
   
       Backup Duplicator & Migration - WP STAGING: door WP-STAGING
       WPStagingBackup – 2.12.0
   
       Disable Bloat for WordPress & WooCommerce: door Disable Bloat – 3.1.11
       Fietskoeriers.nl: door Fietskoeriers.nl – 1.2.6
       Git Updater: door Andy Fragen – 10.0.0
       Limit Login Attempts Reloaded: door Limit Login Attempts Reloaded – 2.25.10
       Ocean Popup Login: door OceanWP – 2.1.2
       Temporary Login Without Password: door StoreApps – 1.8.1.1
       WooCommerce Email Testing: door ThemesEmail – 1.3
       WP-Sweep: door Lester 'GaMerZ' Chan – 1.1.5
       YITH Pre-Order for WooCommerce: door YITH – 2.8.0
   
       ### Dropin Plugins (1) ###
   
       db.php: Query Monitor Database Class (Drop-in)
   
       ### Must Use Plugins (2) ###
   
       Health Check Troubleshooting Mode: door  – 1.7.2
       installatron_hide_status_test.php: door  –
   
       ### Settings ###
   
       API Enabled: –
       Force SSL: –
       Currency: EUR (€)
       Currency Position: left
       Thousand Separator: ,
       Decimal Separator: .
       Number of Decimals: 2
       Taxonomies: Product Types: bundle (bundle)
       external (external)
       grouped (grouped)
       simple (simple)
       variable (variable)
       variable-subscription (variable-subscription)
   
       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: ✔</img>
       Enforce Approved Product Download Directories: –
       Order datastore: WC_Order_Data_Store_CPT
   
       ### WC Pages ###
   
       Winkelbasis: #1057 - /winkel/
       Winkelwagen: #1058 - /winkel/winkelmand/
       Afrekenen: #1059 - /winkel/afrekenen/
       Mijn account: #1060 - /mijn-account/
       Algemene voorwaarden: #1041 - /algemene-voorwaarden/
   
       ### Theme ###
   
       Name: OceanWP Child
       Version: 1.0
       Author URL: https://oceanwp.org/
       Child Theme: ✔</img>
       Parent Theme Name: OceanWP
       Parent Theme Version: 3.3.6
       Parent Theme Author URL: https://oceanwp.org/about-oceanwp/
       WooCommerce Support: ✔</img>
   
       ### Templates ###
   
       Overrides: oceanwp/woocommerce/cart/mini-cart.php
       oceanwp/woocommerce/content-single-product.php
       oceanwp-child-brute-bonen/woocommerce/emails/customer-invoice.php
       oceanwp-child-brute-bonen/woocommerce/emails/customer-processing-order.php
       oceanwp-child-brute-bonen/woocommerce/emails/customer-reset-password.php
       oceanwp-child-brute-bonen/woocommerce/emails/email-footer.php
       oceanwp-child-brute-bonen/woocommerce/emails/email-header.php
       oceanwp-child-brute-bonen/woocommerce/emails/email-styles.php
       oceanwp/woocommerce/loop/loop-start.php
       oceanwp-child-brute-bonen/woocommerce/myaccount/dashboard.php
       oceanwp-child-brute-bonen/woocommerce/single-product/add-to-cart/variable.php versie 3.5.5 is verouderd. De hoofdversie is 6.1.0
       oceanwp/woocommerce/single-product/title.php
   
       Outdated Templates: ❌</img>
   
   
       						Leer hoe te updaten
   
       ### Product Bundles ###
   
       Database Version: 6.17.3
       Loopback Test: ✔</img>
       Template Overrides: –
   
       ### Admin ###
   
       Enabled Features: activity-panels
       analytics
       coupons
       customer-effort-score-tracks
       experimental-products-task
       experimental-import-products-task
       experimental-fashion-sample-products
       shipping-smart-defaults
       shipping-setting-tour
       homescreen
       marketing
       multichannel-marketing
       mobile-app-banner
       navigation
       onboarding
       onboarding-tasks
       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
   
       Disabled Features: minified-js
       new-product-management-experience
       settings
   
       Daily Cron: ✔</img> Next scheduled: 2023-01-10 12:59:57 +01:00
       Options: ✔</img>
       Notes: 93
       Onboarding: completed
   
       ### Action Scheduler ###
   
       Complete: 20.172
       Oldest: 2022-12-10 13:39:02 +0100
       Newest: 2023-01-09 20:15:03 +0100
   
       Failed: 2.523
       Oldest: 2020-09-16 16:28:24 +0200
       Newest: 2023-01-06 10:30:04 +0100
   
       Pending: 10
       Oldest: -0001-11-30 00:19:32 +0019
       Newest: 2023-01-13 12:40:04 +0100
   
   
       ### Smart Coupons related settings ###
   
       Number of coupons to show: 5
       Number of characters in auto-generated coupon code: 10
       Valid order status for auto-generating coupon: processing
       completed
   
       Include tax in the amount of the generated gift card: no
       Deduct credit/gift before doing tax calculations: no
       Gift Card discount is inclusive of tax: no
       Automatic deletion: no
       Coupon emails: yes
       Printing coupons: yes
       Sell gift cards at less price?: no
       Use gift card applied in first subscription order for subsequent renewals until credit reaches zero: yes
       Renewal orders should not generate coupons even when they include a product that issues coupons: no
       Allow sending of coupons to others: yes
       Allow schedule sending of coupons?: no
       Combine emails: no
       Auto generated coupon email: yes
       Combined auto generated coupons email: no
       Acknowledgement email: yes
       Enable taxes: yes
       Prices entered with tax: yes
       Rounding: yes
       Display prices in the shop: incl
       Display prices during cart and checkout: incl
       Display tax totals: itemized
       Enable the use of coupon codes: yes
       Calculate coupon discounts sequentially: no
       Account endpoints > Coupons: wc-smart-coupons
   
       ### Status report information ###
   
       Generated at: 2023-01-09 20:21:42 +01:00
       ```
   
 *  [Igor H](https://wordpress.org/support/users/ihereira/)
 * (@ihereira)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16355984)
 * Hi,
 * The system status report does not show any relevant issue. Thanks for sending
   it.
 * For the conversions API to work properly, I’d suggest to check out this article
   below:
 * [How can I implement Conversions API?](https://woocommerce.com/posts/adapt-for-the-future-with-facebook-conversions-api/#:~:text=How%20can%20I%20implement%20Conversions%20API%3F)
 * I hope this points you in the right direction.
 *  Thread Starter [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16356070)
 * Hi Igor, Thanks for taking the time to check my server logs. As you can see, 
   the CAPI has been successfully implemented, it tracks AddToCart and InitiateCheckout
   flawlessly.
 * ![](https://i0.wp.com/brutebonen.nl/Screenshot%202023-01-09%20at%2021.38.23.png?
   ssl=1)
 * And even orders that follow the happy flow trigger a Purchase event. So far so
   good…
 * Only when I compared the order count from Woocommerce and the CAPI purchase events
   for specific days, I noticed not all Purchases made from FB Ads on iOS are tracked
   by CAPI. And **I think** this is because the FBfW plugin uses a cookie instead
   of the DB to store the fbcid with the order. In The Netherlands, 95% of transactions
   are made using iDeal, sending the user from the FB/Insta app to a bank app for
   payment. The return-url is then loaded in Native Safari app, not in FB or Insta,
   thus having no cookies or session vars. FBfW doesn’t understand where this purchase
   comes from, has no session data, no fbcid no prior InitiateCheckout and decides
   not to fire a CAPI call.
 * To confirm this analysis, please help me by answering these questions:
    - Is it correct FBfW relies on a cookie or session var (_fbc or likewise) to
      track a user making a **purchase**?
    - Is it correct the CAPI purchase event is triggered on the thank-you page, 
      not on the order-processing-hook?
    - Is there any way to trigger FBfW to send a CAPI call for a given order, for
      example with AutomateWoo? If External ID is supplied, FB should be able to
      dedupe, even is session info is missing?
    - As a workaround, can I just add the fbclid of the incoming Ad-click to the
      query string of the return-url?
 * So again, this only happens when you
    1. Advertise on FB, user clicks on the advertisement,
    2. users buys a product from within FB/Insta app,
    3. we send the user to an external payment provider (like the Paypal app, in NL
       its mostly iDeal) and
    4. he is returned, **not to FB/Insta**, but to the default browser (Safari in most
       cases), with a completely new and fresh session (and the bank url as referrer).
 *  Thread Starter [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16356122)
 * So the answer is in the code: Yes, FBfW relies only on cookies, this is the source
   for plugin > Includes > Event.php line 241.
 *     ```wp-block-code
       /**
       	 * Gets the click ID from the cookie or the query parameter.
       	 *
       	 * @see https://developers.facebook.com/docs/marketing-api/server-side-api/parameters/fbp-and-fbc#fbp-and-fbc-parameters
       	 *
       	 * @since 2.0.0
       	 *
       	 * @return string
       	 */
       	protected function get_click_id() {
       		$click_id = '';
       		if ( ! empty( $_COOKIE['_fbc'] ) ) {
       			$click_id = $_COOKIE['_fbc'];
       		} elseif ( ! empty( $_REQUEST['fbclid'] ) ) {
       			// generate the click ID based on the query parameter
       			$version         = 'fb';
       			$subdomain_index = 1;
       			$creation_time   = time();
       			$fbclid          = $_REQUEST['fbclid'];
       			$click_id        = "{$version}.{$subdomain_index}.{$creation_time}.{$fbclid}";
       		}
       		return $click_id;
       	}
       ```
   
 * So no fallback whatsoever.
 * When I click my own FB ad, pay for the order, etc, this is all that shows up 
   in the FBfW server logs:
 *     ```wp-block-code
       01-09-2023 @ 22:14:24 - Request
       method: POST
       uri: https://graph.facebook.com/v13.0/151625036263774/events
       user-agent: Facebook-for-WooCommerce/3.0.7 (WooCommerce/7.2.2; WordPress/6.1.1)
       body: {"data":[{"action_source":"website","event_time":1673298864,"event_id":"088f605b-4dbe-4182-93ea-155108f56bbd","event_source_url":"https:\/\/brutebonen.nl\/product\/proefpakket\/?code=PROBEER50&utm_source=ig&utm_medium=%20cpc&utm_campaign=Proefpakket%20%20Sales%20%202023-01-04&utm_content=Home%20Baristas--FB+INSTA%20Story&utm_term=Story%20video&fbclid=PAAabFYVTfrjvJBN9k_yZgs5pd37YEJSf6KLqbeLzJRTHvq_9f5vl2PPZHc4U_aem_AZ-MXlPOnf1BUQeitjq8TJQyiqu59Ij4OGxjSbjfUcGHanznNcSWVGH-NRG5MU8RNS1NmfsB9cK1lioVMNTplNCdN8C1m6wmwIXNxd9kSjenmvh2gkq-M1JlD5bk3DIMdhU","custom_data":{"content_name":"Brute Bonen Proefpakket","content_ids":"[\"PPXXXY_2297\"]","content_type":"product_group","contents":"[{\"id\":\"PPXXXY_2297\",\"quantity\":1}]","content_category":"Proefpakketten","value":"9.95","currency":"EUR"},"user_data":{"client_ip_address":"84.104.133.55","client_user_agent":"Mozilla\/5.0 (iPhone; CPU iPhone OS 16_0_2 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/15E148 Instagram 264.3.0.19.104 (iPhone15,2; iOS 16_0_2; en_NL; en-NL; scale=3.00; 1179x2556; 432065435) NW\/3","fbc":"fb.1.1672145758852.PAAabFVMgO7MWHPPYk0LvsMvZGjePoeNf2T_pwXuE59kjdgGZ-rXqz-RrKTww_aem_AbI2Ip6ud2Yy6IV4ASHJPODnQRg-b4Eu8P2lhjVu2XLtFd4Ur58bGOJNrig_s1FpeW85szy6Q8GfXyMDfbH8bLgfT1imXp0lv5Y5akWOh93prYOgC20VfTh1UkgM-xHBPpY","fbp":"fb.1.1672145758853.1318592254"},"event_name":"ViewContent"}],"partner_agent":"woocommerce-7.2.2-3.0.7"}
       duration: 0.11777s
   
       01-09-2023 @ 22:14:24 - Response
       code: 200
       message: OK
       body: {"events_received":1,"messages":[],"fbtrace_id":"ACTXVM_8SkNtt9VuORqVMoL"}
   
       01-09-2023 @ 22:14:33 - Request
       method: POST
       uri: https://graph.facebook.com/v13.0/151625036263774/events
       user-agent: Facebook-for-WooCommerce/3.0.7 (WooCommerce/7.2.2; WordPress/6.1.1)
       body: {"data":[{"action_source":"website","event_time":1673298872,"event_id":"e8e435d1-d60d-466a-b40a-67e242dbcc58","event_source_url":"https:\/\/brutebonen.nl\/product\/proefpakket\/","custom_data":{"content_ids":"[\"PP250H_2672\"]","content_name":"Brute Bonen Proefpakket - Halfautomaat \/ Pistonmachine met losse bonenmaler, 250 gram","content_type":"product","contents":"[{\"id\":\"PP250H_2672\",\"quantity\":1}]","value":9.95,"currency":"EUR"},"user_data":{"client_ip_address":"84.104.133.55","client_user_agent":"Mozilla\/5.0 (iPhone; CPU iPhone OS 16_0_2 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/15E148 Instagram 264.3.0.19.104 (iPhone15,2; iOS 16_0_2; en_NL; en-NL; scale=3.00; 1179x2556; 432065435)","fbc":"fb.1.1673298864870.PAAabFYVTfrjvJBN9k_yZgs5pd37YEJSf6KLqbeLzJRTHvq_9f5vl2PPZHc4U_aem_AZ-MXlPOnf1BUQeitjq8TJQyiqu59Ij4OGxjSbjfUcGHanznNcSWVGH-NRG5MU8RNS1NmfsB9cK1lioVMNTplNCdN8C1m6wmwIXNxd9kSjenmvh2gkq-M1JlD5bk3DIMdhU","fbp":"fb.1.1672145758853.1318592254"},"event_name":"AddToCart"}],"partner_agent":"woocommerce-7.2.2-3.0.7"}
       duration: 0.11269s
   
       01-09-2023 @ 22:14:33 - Response
       code: 200
       message: OK
       body: {"events_received":1,"messages":[],"fbtrace_id":"A-SaL1IG41CXyFTpzDfOlxJ"}
   
       01-09-2023 @ 22:14:34 - Request
       method: POST
       uri: https://graph.facebook.com/v13.0/151625036263774/events
       user-agent: Facebook-for-WooCommerce/3.0.7 (WooCommerce/7.2.2; WordPress/6.1.1)
       body: {"data":[{"action_source":"website","event_time":1673298874,"event_id":"97c163a7-d8d9-42fb-a8f1-b1b2856b9768","event_source_url":"https:\/\/brutebonen.nl\/winkel\/winkelmand\/","custom_data":{"content_ids":"[\"PP250H_2672\"]","content_name":"Brute Bonen Proefpakket - Halfautomaat \/ Pistonmachine met losse bonenmaler, 250 gram","content_type":"product","contents":"[{\"id\":\"PP250H_2672\",\"quantity\":1}]","value":9.95,"currency":"EUR"},"user_data":{"client_ip_address":"84.104.133.55","client_user_agent":"Mozilla\/5.0 (iPhone; CPU iPhone OS 16_0_2 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/15E148 Instagram 264.3.0.19.104 (iPhone15,2; iOS 16_0_2; en_NL; en-NL; scale=3.00; 1179x2556; 432065435)","fbc":"fb.1.1673298864870.PAAabFYVTfrjvJBN9k_yZgs5pd37YEJSf6KLqbeLzJRTHvq_9f5vl2PPZHc4U_aem_AZ-MXlPOnf1BUQeitjq8TJQyiqu59Ij4OGxjSbjfUcGHanznNcSWVGH-NRG5MU8RNS1NmfsB9cK1lioVMNTplNCdN8C1m6wmwIXNxd9kSjenmvh2gkq-M1JlD5bk3DIMdhU","fbp":"fb.1.1672145758853.1318592254"},"event_name":"AddToCart"}],"partner_agent":"woocommerce-7.2.2-3.0.7"}
       duration: 0.12841s
   
       01-09-2023 @ 22:14:34 - Response
       code: 200
       message: OK
       body: {"events_received":1,"messages":[],"fbtrace_id":"AyJWRrbMHuzyXEpznEq_UgM"}
   
       01-09-2023 @ 22:14:43 - Request
       method: POST
       uri: https://graph.facebook.com/v13.0/151625036263774/events
       user-agent: Facebook-for-WooCommerce/3.0.7 (WooCommerce/7.2.2; WordPress/6.1.1)
       body: {"data":[{"action_source":"website","event_time":1673298883,"event_id":"20188f5e-1f4f-445c-9c3e-6ab27a0bf7ff","event_source_url":"https:\/\/brutebonen.nl\/winkel\/afrekenen\/","custom_data":{"num_items":1,"content_ids":"[\"PP250H_2672\"]","content_name":"[\"Brute Bonen Proefpakket - Halfautomaat \\\/ Pistonmachine met losse bonenmaler, 250 gram\"]","content_type":"product","contents":"[{\"id\":\"PP250H_2672\",\"quantity\":1}]","value":"5.98","currency":"EUR"},"user_data":{"client_ip_address":"84.104.133.55","client_user_agent":"Mozilla\/5.0 (iPhone; CPU iPhone OS 16_0_2 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/15E148 Instagram 264.3.0.19.104 (iPhone15,2; iOS 16_0_2; en_NL; en-NL; scale=3.00; 1179x2556; 432065435)","fbc":"fb.1.1673298864870.PAAabFYVTfrjvJBN9k_yZgs5pd37YEJSf6KLqbeLzJRTHvq_9f5vl2PPZHc4U_aem_AZ-MXlPOnf1BUQeitjq8TJQyiqu59Ij4OGxjSbjfUcGHanznNcSWVGH-NRG5MU8RNS1NmfsB9cK1lioVMNTplNCdN8C1m6wmwIXNxd9kSjenmvh2gkq-M1JlD5bk3DIMdhU","fbp":"fb.1.1672145758853.1318592254"},"event_name":"InitiateCheckout"}],"partner_agent":"woocommerce-7.2.2-3.0.7"}
       duration: 0.10694s
   
       01-09-2023 @ 22:14:43 - Response
       code: 200
       message: OK
       body: {"events_received":1,"messages":[],"fbtrace_id":"AhKRBZQSJ8Ru6hracOVg9HM"}
       ```
   
 * All events are neatly tracked, the purchase event just never shows up…
 *  [Paulo P – a11n](https://wordpress.org/support/users/paulostp/)
 * (@paulostp)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16358840)
 * Hello,
 * Thanks for your troubleshooting efforts and for sharing your findings with the
   community.
 * We would be grateful if you could file a feature request so the developers are
   aware of this use case: [https://woocommerce.com/feature-requests/facebook/](https://woocommerce.com/feature-requests/facebook/)
 * As for the possibility of using AutomateWoo to bridge this gap, we would need
   you to reach out to our premium support at WooCommerce.com – we can’t discuss
   our paid plugins here in the WordPress.org forums.
 * Please contact us at [WooCommerce.com > My Account > Support](https://woocommerce.com/my-account/create-a-ticket/?form=ticket).
   You may need to create an account before you can access that page.
 * Please include a link to this forum thread for context.
 * Thanks!
 *  Thread Starter [jopb](https://wordpress.org/support/users/jopb/)
 * (@jopb)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16360548)
 * 👍</img> Doesn’t sound like a feature to me, I filled a bug:
 * [https://github.com/woocommerce/facebook-for-woocommerce/issues/2447](https://github.com/woocommerce/facebook-for-woocommerce/issues/2447)
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16360623)
 * Hi [@jopb](https://wordpress.org/support/users/jopb/)
 * We totally understand this and thanks for raising this concern to the proper 
   channel.
 * Please subscribe to the thread to keep posted for updates.
 * Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘CAPI issues’ is closed to new replies.

 * ![](https://ps.w.org/facebook-for-woocommerce/assets/icon.svg?rev=3469606)
 * [Meta for WooCommerce](https://wordpress.org/plugins/facebook-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-for-woocommerce/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/capi-issues/#post-16360623)
 * Status: resolved