TrustData
Connectors

WooCommerce

Track orders, refunds, and cancellations from WooCommerce using native webhooks.

WooCommerce sends webhooks natively, so you write no server-side code to forward events. Install a small plugin for session matching, then register the webhooks in your WooCommerce admin.

Event mapping

WooCommerce topicWC order statusTrustData eventShopify equivalent
order.createdprocessing, completedpurchaseorders/paid
order.updatedrefundedrefundorders/updated (with refunds)
order.updatedcancelled, failedrefundorders/cancelled

Before you start

You need:

  • The TrustData JS SDK installed on your storefront (see JavaScript SDK)
  • Your Attribution ID from SettingsAttribution IDs

Step 1: Install the plugin

During checkout, the TrustData plugin saves the visitor ID from the browser to order meta. WooCommerce then includes it in webhook payloads, which lets TrustData match the order to the original ad click.

  1. Download trustdata-woocommerce.zip from the GitHub releases
  2. In your WordPress admin, go to PluginsAdd NewUpload Plugin
  3. Select the ZIP file → click Install NowActivate

There is nothing to configure. The plugin works as soon as you activate it.


Step 2: Register webhooks in WooCommerce

Go to WooCommerceSettingsAdvancedWebhooksAdd webhook.

Create two webhooks:

Order created

FieldValue
NameTrustData Order created
StatusActive
TopicOrder created
Delivery URLhttps://t.trustdata.tech/webhooks/woocommerce/YOUR_ATTRIBUTION_ID/orders
SecretGenerate a random string and copy it
API versionWP REST API Integration v3

Order updated

FieldValue
NameTrustData Order updated
StatusActive
TopicOrder updated
Delivery URLhttps://t.trustdata.tech/webhooks/woocommerce/YOUR_ATTRIBUTION_ID/orders
SecretSame secret as above
API versionWP REST API Integration v3

Replace YOUR_ATTRIBUTION_ID with your Attribution ID from the TrustData dashboard.

Both webhooks share the same endpoint URL and secret. WooCommerce sends the topic in the X-WC-Webhook-Topic header.

How session matching works

The JS SDK sets a _trdt_vid cookie when a visitor lands on your store. At checkout, the TrustData plugin reads this cookie and saves it to the WooCommerce order as _td_visitor_id meta. WooCommerce includes all order meta in the webhook payload, so TrustData receives the visitor ID alongside the order data.

Loading diagram…

Troubleshooting

Conversions not attributed

  • Confirm the TrustData plugin is active
  • Check that _trdt_vid appears in browser DevTools → Application → Cookies on your storefront
  • In WooCommerce → Webhooks, check the Delivery log for the webhook. A 200 response means TrustData received it
  • In the TrustData dashboard → Webhooks tab → Recent Activity, check session_matched. A value of false means TrustData received the webhook but found no session

Webhook delivery failures

  • Confirm the Delivery URL contains the correct Attribution ID
  • Check that the webhook Status is set to Active
  • WooCommerce retries failed deliveries automatically. Check the delivery log for error details