Update Customer Metadata
Add or update custom metadata on WooCommerce customers.
Overview
The Update Customer Metadata action adds or updates custom meta fields on WooCommerce customers. This is useful for storing additional customer information, loyalty data, or integration-specific fields.
Configuration
Required Fields
| Field | Type | Description |
|---|
| Customer | integer | Customer user ID |
| Meta Key | string | Metadata field name |
| Meta Value | string | Value to store |
Optional Fields
| Field | Type | Description |
|---|
| Multiple | array | Multiple key-value pairs |
Example Configurations
Single Field
Customer: {{Trigger.customer_id}}
Meta Key: loyalty_points
Meta Value: {{Trigger.new_points}}
Multiple Fields
Customer: {{Trigger.customer_id}}
Multiple:
- Key: total_orders
Value: {{Trigger.order_count}}
- Key: lifetime_value
Value: {{Trigger.lifetime_total}}
- Key: last_order_date
Value: {{Trigger.order_date}}
Loyalty Points
Customer: {{Trigger.customer_id}}
Meta Key: loyalty_points
Meta Value: {{Trigger.current_points + Trigger.earned_points}}
VIP Status
Customer: {{Trigger.customer_id}}
Meta Key: vip_status
Meta Value: gold
| Key | Use Case |
|---|
loyalty_points | Points balance |
lifetime_value | Total spent |
order_count | Number of orders |
referral_code | Customer’s referral code |
vip_status | Membership tier |
last_purchase | Last order date |
preferences | Customer preferences |
Output Data
| Variable | Type | Description |
|---|
{{Action.customer_id}} | integer | Customer ID |
{{Action.meta_key}} | string | Updated key |
{{Action.meta_value}} | string | New value |
Common Workflows
Update Order Count
- Trigger: Order Completed
- Action: Update Customer Metadata
- Meta Key:
order_count
- Meta Value: Increment by 1
Track Lifetime Value
- Trigger: Order Completed
- Action: Update Customer Metadata
- Meta Key:
lifetime_value
- Meta Value: Running total
Loyalty Program
- Trigger: Order Completed
- Action: Update Customer Metadata
- Meta Key:
loyalty_points
- Meta Value: Calculate points from order
Best Practices
- Use consistent key naming conventions
- Store numeric values for calculations
- Consider data type requirements
- Document custom meta keys