I totally get what you’re trying to do—you want to create an automated Shopify Flow that tags customers based on their spending over the past 365 days. The key is setting up conditions that update these tags dynamically as their total purchase amount changes over time.
How to Set Up Your Shopify Flow:
1-Trigger: “Customer Created” or “Customer Updated”
This ensures that the flow runs whenever a customer makes a purchase or their details are updated.
2-Condition: Check the Total Spent in the Last 365 Days
Since Shopify Flow doesn’t have a direct “last 365 days” filter, we’ll use Shopify’s query-based conditions.
3-Action: Add/Remove Tags Based on Purchase Amount
Assign tags when customers hit spending thresholds.
Remove tags if they drop below those amounts.
Step-by-Step Shopify Flow Example:
1-Trigger:
Select “Order Paid” (this ensures Flow runs when an order is completed).
2-Condition: Check if the customer’s total spent in the last 365 days meets your threshold.
Use the “Get customer data” action with the total_spent variable.
3-Branching Logic:
If total_spent ≥ $X → Add tag VIP
If total_spent ≥ $Y but < $X → Add tag Loyal
If total_spent < $Y → Remove previous tags
Shopify Flow JSON Code Example:
If you want to modify this in the Shopify Flow app manually, here’s a basic JSON structure:
{
“version”: “1”,
“triggers”: [
{
“type”: “order_paid”
}
],
“conditions”: [
{
“field”: “customer.total_spent”,
“operator”: “greater_than_or_equal_to”,
“value”: “1000”
}
],
“actions”: [
{
“type”: “add_customer_tag”,
“parameters”: {
“tag”: “VIP”
}
}
]
}
(You can modify the threshold values based on your needs.)
Additional Considerations:- Scheduled Runs: Shopify Flow doesn’t support scheduled automation directly. If you need a rolling 365-day evaluation, you might need a custom app or an external script using Shopify’s API.
Using Shopify Scripts or APIs: If you need more flexibility (like auto-removal of tags when spending drops), you might have to use a Shopify Script or a third-party automation tool.
Let me know if you need more tweaks! Happy to help.
Thanks,
Daisy.