Use Case
When payment is confirmed, you want to immediately update customer metadata. This captures purchase data at the moment of payment for real-time tracking and segmentation.
Common scenarios:
- Record payment date for RFM analysis
- Update loyalty points balance
- Track payment method preferences
- Flag as paying customer
- Store purchase milestone data
Step-by-Step Setup
1. Create a New Workflow
Navigate to Sequensy → Workflows in your WordPress admin and click Add New Workflow.
Name your workflow “Track Payment on Completion” or “Real-Time Customer Stats”.
2. Configure the Trigger
Select Payment Complete as your trigger.
Available filters:
- Payment Method: Track by gateway used
- Order Total: Different handling by amount
- Products: Track product-specific purchases
- First Order: Flag new vs returning
3. Set Up the Update Customer Metadata Action
Configure the metadata update:
| Setting | Example Value | Description |
|---|---|---|
| Customer | {customer_id} | Target customer |
| Meta Key | last_payment_date | Field to update |
| Meta Value | {current_date} | Current timestamp |
| Update Type | Replace | Overwrite value |
4. Track Multiple Fields
Create workflows for each metric:
| Meta Key | Value | Purpose |
|---|---|---|
last_payment_date | {current_date} | Recency tracking |
total_payments | {increment} | Frequency count |
lifetime_paid | {add_amount} | Monetary value |
preferred_payment | {payment_method} | Preference |
is_paying_customer | true | Customer flag |
5. Test Your Workflow
- Enable the workflow
- Complete a test purchase
- Check customer metadata updated
- Verify timing (immediately on payment)
- Test with different payment methods
Pro Tips
Payment vs Order Completion: Payment Complete triggers immediately when payment clears. Order Completed triggers when fulfilled. Choose based on what you’re tracking.
Real-time analytics: Use payment-triggered metadata for live dashboards and instant segmentation.
Payment method tracking: Understanding payment preferences helps optimize checkout.
First purchase flagging: Identify new customers instantly for immediate follow-up.
Metadata Examples
Payment Tracking
Meta Key: _last_payment_timestamp
Value: 1704067200
Meta Key: _total_successful_payments
Value: 12
Meta Key: _total_amount_paid
Value: 1,250.00
Meta Key: _average_payment_amount
Value: 104.17
Loyalty Integration
Meta Key: _loyalty_points_balance
Value: 500 (updated: +{order_total_points})
Meta Key: _points_earned_this_month
Value: 150
Meta Key: _tier_progress
Value: 75% to Gold
Customer Flags
Meta Key: _is_verified_buyer
Value: true
Meta Key: _first_payment_date
Value: 2024-01-15
Meta Key: _has_completed_payment
Value: yes
Meta Key: _payment_risk_score
Value: low
Segmentation Use Cases
Payment-Based Segments
| Segment | Metadata Query |
|---|---|
| New Buyers | first_payment_date within 7 days |
| Regular Payers | total_payments > 3 |
| High Value | total_amount_paid > $500 |
| Credit Card Users | preferred_payment = card |
| PayPal Users | preferred_payment = paypal |
Marketing Automation
Condition: total_payments = 3
Action: Send "Loyal Customer" email
Offer: Exclusive 15% discount
Condition: first_payment_date = today
Action: Start welcome sequence
Trigger: Onboarding emails
Payment Method Tracking
Recording Preferences
Trigger: Payment Complete
Action: Update _payment_methods_used array
Value: Add {payment_method} to list
Over time, see:
["credit_card", "credit_card", "paypal", "credit_card"]
Most used: credit_card (75%)
Analyzing Behavior
| Customer | Primary Method | Insight |
|---|---|---|
| John | PayPal | Digital-first buyer |
| Sarah | Credit Card | Traditional payment |
| Mike | Apple Pay | Mobile shopper |
| Lisa | Invoice | B2B customer |
Integration Ideas
Real-Time Dashboard
Update metadata that feeds live dashboards:
- Total revenue today
- New customers this hour
- Average order value trend
Email Segmentation
Create segments based on:
- Payment frequency
- Preferred payment method
- Lifetime value tier
- Days since last payment
Troubleshooting
Metadata not updating?
- Verify payment actually completed
- Check customer ID mapping
- Review meta key spelling
Wrong values stored?
- Check calculation formulas
- Verify merge tag format
- Review data types
Can’t query metadata?
- Check meta key prefix
- Verify data is in user meta table
- Use correct query methods