We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Creating a Flow for tagging customer based on their past 365 day Purchase

Creating a Flow for tagging customer based on their past 365 day Purchase

DP8
Visitor
1 0 0

I need to make a Flow - where the Flow app tags customers on the basis of last 365 days Purchase.

I want the flow to change the tag in customers when they reach a certain amount spent in the last 365 days

similarly changes the tag if their total falls with time as their total amount falls in future if they don't buy

 
 
Reply 1 (1)

DaisyVo
Shopify Partner
4469 501 598

Hi @DP8 

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.

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution