Skip to content

Customer Cohort Attribution

How WP Zbridge Pro labels purchases from new and returning customers.

WP Zbridge Pro labels each purchase as coming from a new or a returning customer, so you can tell first purchases apart from repeat ones.


When the purchase payload is built, WP Zbridge counts the customer’s WooCommerce orders with wc_get_customer_order_count(), by customer ID for registered customers or by billing email for guests:

$customerType = ($orderCount <= 1) ? 'new' : 'returning';

The label is added to the purchase event under user_data:

{
"order_id": "8821",
"event_id": "order_8821_9a12b3c4...",
"total": 149.00,
"currency": "USD",
"user_data": {
"customer_type": "new",
"lifetime_orders": 1
}
}
  • Meta receives these as custom data (user_data.customer_type, user_data.lifetime_orders), which you can use in custom conversions.
  • GA4, TikTok and the other tools don’t read user_data. To use the label there, create a custom Zaraz action that reads it, or change the payload with the zbridge_order_user_data filter.

No customer contact details are included.