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

FieldTypeDescription
CustomerintegerCustomer user ID
Meta KeystringMetadata field name
Meta ValuestringValue to store

Optional Fields

FieldTypeDescription
MultiplearrayMultiple 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

Common Metadata Keys

KeyUse Case
loyalty_pointsPoints balance
lifetime_valueTotal spent
order_countNumber of orders
referral_codeCustomer’s referral code
vip_statusMembership tier
last_purchaseLast order date
preferencesCustomer preferences

Output Data

VariableTypeDescription
{{Action.customer_id}}integerCustomer ID
{{Action.meta_key}}stringUpdated key
{{Action.meta_value}}stringNew value

Common Workflows

Update Order Count

  1. Trigger: Order Completed
  2. Action: Update Customer Metadata
    • Meta Key: order_count
    • Meta Value: Increment by 1

Track Lifetime Value

  1. Trigger: Order Completed
  2. Action: Update Customer Metadata
    • Meta Key: lifetime_value
    • Meta Value: Running total

Loyalty Program

  1. Trigger: Order Completed
  2. 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