Skip to content

Update CAPI event handling#3360

Closed
iodic wants to merge 13 commits intomainfrom
fix/added_pageview_event_to_capi
Closed

Update CAPI event handling#3360
iodic wants to merge 13 commits intomainfrom
fix/added_pageview_event_to_capi

Conversation

@iodic
Copy link
Copy Markdown
Collaborator

@iodic iodic commented Jun 13, 2025

Description

This changeset updates CAPI event handling and adds logging for Purchase events

The goal of the changes is to make tracking more robust and address deduplication issues encountered by some users.

Type of change

  • Fix (non-breaking change which fixes an issue)

Checklist

  • I have commented my code, particularly in hard-to-understand areas, if any.
  • I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
  • I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
  • I followed general Pull Request best practices. Meta employees to follow this wiki.
  • [n/a] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
  • I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
  • [n/a] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this wiki.

Changelog entry

Update CAPI event handling & add logging for the Purchase event

Test Plan

To test, please install this build of the plugin on a site connected to MBE and browse the site triggering the various events. Analyze the tracked events in the Events Manager, the result should be a 1:1 distribution between CAPI and pixel events being tracked.

@iodic iodic requested a review from vahidkay-meta June 13, 2025 07:53
@iodic iodic force-pushed the fix/added_pageview_event_to_capi branch from 83e00dd to 866afb0 Compare June 13, 2025 07:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 13, 2025

📦 Latest Plugin Build

Built at: 2025-06-13T21:31:10.452Z
Commit: dc037c5
Size: 1.1M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

Comment thread includes/fbutils.php Outdated
Comment thread includes/fbutils.php Outdated
@iodic iodic force-pushed the fix/added_pageview_event_to_capi branch from 866afb0 to 324ddba Compare June 13, 2025 08:28
@iodic iodic force-pushed the fix/added_pageview_event_to_capi branch from 5534aaa to 3cabd95 Compare June 13, 2025 11:09
@iodic iodic force-pushed the fix/added_pageview_event_to_capi branch from 3cabd95 to 4d4b725 Compare June 13, 2025 21:30
@iodic iodic requested a review from vahidkay-meta June 13, 2025 21:37
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vahidkay-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vahidkay-meta merged this pull request in fcecbaf.

@vahidkay-meta vahidkay-meta mentioned this pull request Jun 20, 2025
facebook-github-bot pushed a commit that referenced this pull request Jun 24, 2025
Summary:
*   Tweak - Add comprehensive unit tests for Locale class by sol-loup in #3362
*   Tweak - Add unit tests for Idempotent_Request trait by sol-loup in #3380
*   Tweak - Add comprehensive unit tests for MetaLog Response by sol-loup in #3376
*   Tweak - Add comprehensive unit tests for ProductSets Delete Response class by sol-loup in #3398
*   Fix - Since tags by sol-loup in #3397
*   Tweak - Add comprehensive unit tests for Pages Read Response by sol-loup in #3378
*   Tweak - Add comprehensive unit tests for User Response to improve code coverage by sol-loup in #3377
*   Fix - Linter errors for ./includes/fbproductfeed.php by ajello-meta in #3396
*   Tweak - Add unit tests for Events AAMSettings class by sol-loup in #3369
*   Tweak - Improve CAPI event handling & add logging for Purchase events by iodic in #3360
*   Fix - Adding links to the updated banner by SayanPandey in #3388
*   Fix - Removing deprecated tag from Product Sync tab by SayanPandey in #3387
*   Fix - Transmit opted_out_woo_all_products timestamp by vinkmeta in #3386
*   Tweak - Product sync tab deprecation using Rollout Switches by SayanPandey in #3364
*   Tweak - Excluded categories and tags from Rollout Switches by SayanPandey in #3382
*   Tweak - Add unit tests for ProductExcludedException and ProductInvalidException by sol-loup in #3357
*   Tweak - Global sync check for Rollout Switches by SayanPandey in #3367
*   Fix - Limiting BatchLogHandler processing for performance reasons by vinkmeta in #3381
*   Tweak - Add unit tests for Framework Api Exception class by sol-loup in #3370
*   Tweak - Add unit tests for Framework Plugin Exception class by sol-loup in #3371
*   Fix - Updated since tags across a few files by sol-loup in #3374
*   Fix - Deprecated the concept of tip info by vinkmeta in #3373
*   Fix - Removed instance of deprecated logger by vinkmeta in #3372
*   Fix - the process to share ExternalVersionUpdate with Meta by vinkmeta in #3365
*   Fix - Failing tests by vinkmeta in #3366
*   Fix - Deprecated legacy logging apis by vinkmeta in #3351
*   Fix - Issue with productSetSyncTest causing warnings during PHPUnit by sol-loup in #3355
*   Tweak - Add comprehensive unit tests for Events\Normalizer class by sol-loup in #3359
*   Tweak - Add unit tests for API Response classes to improve code coverage by sol-loup in #3358
*   Fix - Deprecated the concept of fblog by vinkmeta in #3354
*   Fix - Deprecated tool tip event concepts by vinkmeta in #3349
*   Fix - Removed unnecessary logs being sent to Meta servers by vinkmeta in #3347
*   Fix - Clean up info Banner releated class and components by vinkmeta in #3348
*   Fix - Sending backgroung syncing jobs action logs to Meta by vinkmeta in #3346
*   Fix - Tracking error messages being displayed to Admins by vinkmeta in #3345
*   Tweak - Workflow for Releasing Plugin by tzahgr in #3309
*   Fix - Deleted wp_ajax_ajax_sync_all_fb_products action by vinkmeta in #3343
*   Fix - Deprecated log_with_debug_mode_enabled by vinkmeta in #3342
*   Fix - Removed unnecessary logs by vinkmeta in #3341
*   Fix - removing duplicate logging by vinkmeta in #3337
*   Fix - Updated exception logs to centralized logger by vinkmeta in #3338
*   Fix - Migrated Feed Logger by vinkmeta in #3340
*   Fix - Deprecated log_to_meta functionality by vinkmeta in #3336
*   Fix - Enabled fbproduct for code sniffing in #3328
*   Fix - Enabled phpcs for plugin banners by vinkmeta in #3332
*   Fix - Updated loggers for Feeds by vinkmeta in #3335
*   Fix - Updated loggers for checkout flow by vinkmeta in #3334
*   Fix - Logging background product syncing debug logs by vinkmeta in #3329
*   Fix - Enabled Pixel Normalizer for CS by vinkmeta in #3333
*   Fix - Update to Feed Loggers by vinkmeta in #3330
*   Fix - Debug logs for background product syncing by vinkmeta in #3327
*   Add - Sync all products if user has opted-in for Woo All Products by SayanPandey in #3281
*   Fix - PHPUnit warnings by renaming test files to match their class names by sol-loup in #3311
*   Tweak - Removing exclusion of sync of excluded categories and tags by SayanPandey in #3244
*   Fix - Lints and phpcs issues with fbproduct by vinkmeta in #3324
*   Fix - Code sniffing fixes for fbproduct by vinkmeta in #3323
*   Fix - Migrated Product Feed Progress Logging Mechanism by vinkmeta in #3321
*   Fix - Added critical log when user attempting non-permissible actions by vinkmeta in #3322
*   Fix - Handling edge case with BatchLogHandler in #3320
*   Fix - Product Group Logging by vinkmeta in #3317
*   Fix - PHPCBF for fbproduct by vinkmeta in #3319
*   Fix - Linting for WC_Facebookcommerce_Background_Process by vinkmeta in #3318
*   Tweak - Adding tags on excluded categories and tags by SayanPandey in #3308
*   Tweak - Removing unnecessary modal for excluded categories by SayanPandey in #3307
*   Tweak - Removing delete on stock check by SayanPandey in #3306
*   Add - Showing a banner to the user about the changes by SayanPandey in #3256
*   Fix - Updated location for Product Feeds by vinkmeta in #3316
*   Tweak - Removing internal wiki links by vinkmeta in #3315
*   Add - Introducing a centralized logger by vinkmeta in #3313
*   Fix - Update ratings and reviews query logic and fix tests by nrostrow-meta in #3312
*   Fix - Restoring the product sync tagging with integers by SayanPandey in #3305
*   Tweak - Removing Enable Sync checkbox by SayanPandey in #3241
*   Fix - Flush rewrite rules to ensure /fb-checkout endpoint is working correctly by ajello-meta in #3301
*   Tweak - Deprecating Product Sync tab by SayanPandey in #3273
*   Tweak - Updated GitHub PR template by vinkmeta in #3304
*   Fix - Changed json_encode to wp_json_encode to avoid phpcs issues by vinkmeta in #3303
*   Fix - Replaced json_encode with wp_json_encode by vinkmeta in #3276
*   Fix - Linting issues resolved for includes/ProductSets/Sync.phpby sol-loup in #3188
*   Fix - Linting issues resolved for includes/Utilities/Background_Remove_Duplicate_Visibility_Meta.php by sol-loup in #3187
*   Fix - Linting issues resolved for includes/Events/Event.php by sol-loup in #3189
*   Tweak - Enable Video sync at Variable Product Level by gurtejrehal in #3291
*   Fix - Revert #3295 by vinkmeta in #3299

Pull Request resolved: #3444

Reviewed By: tzahgr

Differential Revision: D77219857

Pulled By: vahidkay-meta

fbshipit-source-id: 52148818ea2d6c1b937f3caa78e6071a258d17f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants