Skip to content

[SNAPWOO-76] Snapchat for WooCommerce shows low transaction ID overlap between Pixel and CAPI purchase events#63

Open
jamesmorrison wants to merge 2 commits intotrunkfrom
feature/SNAPWOO-76-snapchat-for-woocommerce-shows-low-transaction-id-overlap-between
Open

[SNAPWOO-76] Snapchat for WooCommerce shows low transaction ID overlap between Pixel and CAPI purchase events#63
jamesmorrison wants to merge 2 commits intotrunkfrom
feature/SNAPWOO-76-snapchat-for-woocommerce-shows-low-transaction-id-overlap-between

Conversation

@jamesmorrison
Copy link
Collaborator

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/SNAPWOO-76/snapchat-for-woocommerce-shows-low-transaction-id-overlap-between

Screenshots:

N/A

Detailed test instructions:

Test 1: Pixel PURCHASE event uses order ID

  1. Add a product to your cart and complete checkout.
  2. On the order confirmation (thank you) page, open browser dev tools Console.
  3. Search the page source or console for snaptr("track", "PURCHASE" -- you can also check the inline script on the page.
  4. Verify the payload contains:
  • event_id = the WooCommerce order ID (a numeric string like "123")
  • client_dedup_id = same value as event_id
  • transaction_id = same value as event_id
  1. All three should be identical and match the order ID shown on the thank-you page.

Test 2: CAPI PURCHASE event uses order ID

  1. On the same order confirmation page, check the Network tab for requests to admin-ajax.php or look at server logs / Action Scheduler for the queued snapchat_wc_send_conversion_event action.
  2. The CAPI payload should have:
  • event_id = the same WooCommerce order ID string (e.g. "123")
  • custom_data.order_id = the same value
  1. Confirm event_id matches the Pixel's transaction_id from Test 1.

Test 3: Duplicate tracking guard still works

  1. After completing Test 1, reload the order confirmation page.
  2. Check the page source -- the snaptr("track", "PURCHASE" call should not appear a second time (blocked by the _snapchat_pixel_tracked meta flag).

Test 4: Non-purchase events are unaffected

  1. Visit a product page -- check that VIEW_CONTENT pixel event still fires with a UUID-style event_id (not an order ID).
  2. Add a product to cart -- check that ADD_CART pixel event still fires with a UUID-style event_id.
  3. Go to checkout -- check that START_CHECKOUT pixel event still fires with a UUID-style event_id.
  4. Visit any non-product/non-checkout page -- check that PAGE_VIEW still fires normally.

Additional details:

Fix - Fix low transaction ID overlap by using order ID as event_id for purchase deduplication.

@github-actions github-actions bot added the status: e2e tests failing E2E tests are failing on PR label Mar 25, 2026
@github-actions github-actions bot added status: e2e tests passing E2E tests are passing on the PR and removed status: e2e tests failing E2E tests are failing on PR labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: e2e tests passing E2E tests are passing on the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant