Opens in a new tab

Set up Meta CAPI for SureCart.

Preview a simulated checkout, configure consent and verify a server Purchase in Meta. Follow the SureCart screens and test each stage before Live use.

Development guide · Microbite CAPI 1.9.0-beta.15 · PHP 8.1 or newer. SureCart tracking is not yet included in customer version 1.8.6.

Before you start

This guide applies to Microbite CAPI 1.9.0-beta.15, the private development copy. The current customer download, 1.8.6, supports WooCommerce server Purchases and does not include this SureCart adapter. Do not substitute a beta for the customer download.

You need WordPress administrator access, HTTPS, PHP 8.1 or newer, SureCart, the development plugin ZIP, and a separate unpublished test product with a one-time price. WooCommerce and GTM4WP are not required. Preview needs no Meta credentials or CAPI licence; server Test and Live delivery need an active site licence and your own Meta dataset ID and access token.

Supported purchases: paid one-time checkouts. Subscriptions, trials, installments and automatic renewals are excluded. Refund tracking and revenue reversals are not supported: a refund does not recall a previously sent Meta Purchase.

1. Install and check Preview

  1. In WordPress, open Plugins → Add Plugin → Upload Plugin. Install and activate the private development ZIP. Check the version under Plugins. The development and customer packages replace the same plugin; do not activate both on one website.
  2. Open SureCart → SureCart CAPI. If WooCommerce is also installed, the CAPI submenu is under WooCommerce. Select Preview test orders — no Meta or GA4 requests.
  3. In SureCart → Products, open your test product and copy the value after id= in the browser’s address bar. Paste this SureCart product UUID into Test product UUID on SureCart CAPI, then click Save SureCart Settings. Use the product identifier, not its WordPress post ID or price UUID. Every product in the Preview/Test cart must match this UUID. See SureCart’s product ID instructions.
  4. Stay signed in as an administrator and complete one fresh simulated checkout using SureCart’s built-in Test processor. Check Latest browser data-layer check on SureCart CAPI: event ID, amount, currency and products should match the checkout. Preview is an administrator-only field check and makes no Meta or GA4 request.

Open Server Purchase policy from SureCart CAPI. The default is Require visitor consent, shared by WooCommerce and SureCart server Purchases. Shop uses this policy worldwide, including Australia.

  1. Open Cookie consent setup. Use its native WordPress action to install or activate Pressidium Cookie Consent. Version 1.9.1 is the tested integration.
  2. Review the banner, privacy link and analytics/advertising categories. Apply the recommended settings, then separately enable the bridge. Installing a banner alone does not enable server delivery. Check that the connection reports ready.
  3. The first Apply keeps a backup of the original settings. Disable the bridge before restoring that backup.
  4. Check a fresh visitor session: essential-only refusal, advertising permission with analytics declined, and withdrawal. A valid advertising grant must exist before payment and remain valid when the worker sends. Missing, refused, withdrawn or expired permission blocks delivery; later acceptance does not backfill an old blocked purchase.

The separate Australia-only merchant policy is an explicit, site-wide administrator option for reviewed store arrangements. It is not visitor-country detection or an automatic Australian exemption. It can operate without a cookie plugin for server Purchases, but still requires fresh checkout ownership and pre-payment authorisation and honours recorded refusals. It does not grant browser advertising or analytics permission.

Data and retention: disclose the actual sharing and purpose in your own privacy notice. SureCart server Purchases include order/item details, value, currency, time and a hashed email identifier. Hashing does not make the identifier anonymous. The necessary checkout ownership cookie lasts up to six hours; saved browser choices alone do not renew server permission.

No PHP or JavaScript changes are needed. Open Cookie Consent → Translations → Edit beside the active language. Under Consent modal, edit Title, Description, Primary button and Secondary button. Keep the Cookie settings link and your privacy-policy link. Use Settings modal and category descriptions for fuller provider, purchase-sharing and withdrawal information.

For example: “Help us improve your shopping experience”, followed by “Optional cookies help us understand what shoppers find useful and measure ads with Meta, including purchase information. You can change your choice anytime.” Use Accept cookies and Essential only. Preserve the native accept-all and accept-necessary actions, and leave optional categories off until chosen.

Click Save, check Preview Consent and Preview Settings, then test a fresh visitor on desktop and mobile. Notice changes can require permission to be confirmed again. This example is suggested wording; your full notice must describe your actual use.

3. Prepare Meta server Test delivery

  1. On SureCart CAPI, use Manage licence to activate your site’s CAPI licence. Use Meta settings to save your own Pixel/dataset ID and enable CAPI. Use Meta credentials to save the access token privately; do not put it in a page, screenshot or GTM variable.
  2. In your dataset’s Meta Events Manager → Test Events, copy the current Test Event Code. Save it in CAPI Settings with Test Mode on. A connection diagnostic is separate from a Purchase test.
  3. Return to SureCart CAPI, select Meta server test events only, retain the test product UUID, and save. Continue using SureCart’s Test processor.
  4. Use a new guest session and new simulated checkout. Under the consent policy, choose advertising before payment. Record the checkout ID, total and currency. Submit once; do not reuse the Preview checkout or replay an already paid order.

4. Verify the Purchase result

Check Latest server result on SureCart CAPI. Background delivery uses Action Scheduler when available, otherwise WP-Cron, so the result can arrive after checkout. There is no fixed delivery time.

  • Meta accepted server Purchase: API acceptance. Separately confirm the matching Purchase / Processed / Server event in Meta Test Events, including the exact event ID, value and currency.
  • Paused: check CAPI enablement, site licence, saved credentials, Test Mode and the current test code.
  • Blocked: review the selected policy, ready bridge and pre-payment permission. Do not manually queue or backfill that checkout; correct the setup and use a new controlled test.
  • Skipped: check paid status, mode, allowed product and one-time price. Ineligible orders or missing customer match information are not sent.
  • Temporary failure: bounded retries recheck permission. Inspect the scheduler instead of submitting the purchase again. Permanent rejection needs a credential/dataset review.

The event ID is sc_checkout_ followed by the checkout UUID. A browser data-layer check or HTTP acceptance does not prove browser Pixel receipt, deduplication or GA4 receipt. Also test a fresh refused purchase and withdrawal before payment; neither should send a Meta Purchase under the consent policy.

5. Add optional browser tracking

Server Purchase delivery does not require GTM. If you also want browser tracking, back up your GTM container and merge GTM-MICROBITE-SURECART.json, available from Download SureCart GTM template on SureCart CAPI. WooCommerce data-layer settings and GTM4WP ecommerce instructions do not apply here.

Set your own destination IDs and review consent requirements. Imported tags remain paused until reviewed. Preview emits mbcapi_sc_preview, Test emits mbcapi_sc_test_purchase, and Live emits mbcapi_sc_purchase. Preview and test orders must not enter live analytics.

Verify browser receipt separately. For Meta deduplication, match the dataset, event name Purchase and exact checkout-based event ID on browser and server, then inspect Meta’s result. Verify GA4 purchase receipt separately if used. WooCommerce screenshots on the other guide are not SureCart receipt evidence.

6. Prepare Live use

Complete your privacy notice, consent checks and the acceptance review for the version you intend to use first. The development beta is not a completed customer release, and Shop currently remains in Test Mode.

When your rollout is ready, clear the Test Event Code, switch CAPI Test Mode off, select Live paid orders in SureCart CAPI, and save and recheck each setting. Real orders need the intended live payment processor; Test orders are excluded from Live sends. Check normal background delivery on the first genuine eligible purchase without replaying earlier orders.

Current verification and limits

On 11 October 2026, a fresh simulated A$1 checkout on beta.15 with pre-payment advertising permission passed the normal worker and appeared as a matching Processed Server purchase in Meta Test Events. Refusal, withdrawal, guest expiry and controlled worker checks have also been exercised. The consent dialog was checked on desktop and mobile.

These results establish scoped development evidence, not every installation or a general customer-release pass. Remaining checks include the declared WooCommerce runtime/concurrency scope, native PHP 8.1 WordPress, other cache/cleanup behaviour and remote licence-service failure handling. Browser Pixel receipt, deduplication and optional GA4 remain separate.

Need help? Use the setup prompt in the development plugin’s SureCart setup panel, or contact info@microbite.com.au. Keep tokens, licence keys and customer records private. Describe your plugin version, tracking mode and safe result message.