WooCommerce natively sends webhooks — no custom server-side code is needed to forward events. You only need a small plugin to enable session matching, then register the webhooks in your WooCommerce admin.
| WooCommerce topic | WC order status | TrustData event | Shopify equivalent |
|---|---|---|---|
order.created | processing, completed | purchase | orders/paid |
order.updated | refunded | refund | orders/updated (with refunds) |
order.updated | cancelled, failed | refund | orders/cancelled |
You need:
The TrustData plugin saves the visitor ID from the browser to order meta during checkout. WooCommerce then includes it in webhook payloads, which allows TrustData to match the order to the original ad click.
trustdata-woocommerce.zip from the GitHub releasesNo configuration needed — the plugin works automatically once activated.
Go to WooCommerce → Settings → Advanced → Webhooks → Add webhook.
Create two webhooks:
| Field | Value |
|---|---|
| Name | TrustData – Order created |
| Status | Active |
| Topic | Order created |
| Delivery URL | https://t.trustdata.tech/webhooks/woocommerce/YOUR_ATTRIBUTION_ID/orders |
| Secret | Generate a random string and copy it |
| API version | WP REST API Integration v3 |
| Field | Value |
|---|---|
| Name | TrustData – Order updated |
| Status | Active |
| Topic | Order updated |
| Delivery URL | https://t.trustdata.tech/webhooks/woocommerce/YOUR_ATTRIBUTION_ID/orders |
| Secret | Same secret as above |
| API version | WP REST API Integration v3 |
Replace YOUR_ATTRIBUTION_ID with your actual Attribution ID from the TrustData dashboard.
X-WC-Webhook-Topic header.The JS SDK sets a _trdt_vid cookie when a visitor lands on your site. 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.
Visitor lands on store → JS SDK sets _trdt_vid cookie
Visitor completes checkout → Plugin saves _trdt_vid to order meta
WooCommerce fires order.created → Sends webhook to TrustData
TrustData reads _td_visitor_id → Matches order to ad session
_trdt_vid appears in browser DevTools → Application → Cookies on your storefront200 response means TrustData received itsession_matched — false means the webhook arrived but no session was found