What's your biggest current challenge? Have your say in Community Polls along the right column.

Shopify Flow, Track Client Spend for Calendar Year

Shopify Flow, Track Client Spend for Calendar Year

megweb
Shopify Partner
3 0 2

Hello! 

 

I am looking to set up a flow to track client spending for the calendar year. This flow should start tracking from January 1st onwards and will tag the client and email me every time a client spend hits $1,000, as well as in $1,000 increments thereafter. 

 

Is this possible? I have a flow set up for each time a client spends $1,000, however I cannot figure out how to set it up so that the flow only tracks from January 1st, 2024 onwards. Any help would be appreciated!  

Replies 3 (3)

DaveMcV
Shopify Staff
104 31 29

Hi Megweb,

 

You should be able to do this by using the Get order data action and setting it up to query for orders by that specific customer since Jan 1, 2024. Once you have the orders, you can sum them and use the sum to get the total 2024 spend and use that in downstream steps.

 

Here is the custom query to use in the Get order data step to achieve this using the Order created trigger:

 

 

customer_id:{{order.customer.legacyResourceId}} AND created_at:>='Jan 1, 2024'

 

 

DaveMcV_0-1705620757209.png

 

Also worth noting that the maximum number of orders that can be fetched is 100 so if a customer makes over 100 orders, it will not capture the full amount they spent in 2024.

 

Hope that helps!

 

DaveMcV | Flow Development Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
megweb
Shopify Partner
3 0 2

Thanks, Dave! 

 

I've attached the rest of my flow below. Can you confirm that this is correct? The code "TRYON" is used for customers getting try-on packages sent to them, so we don't want the spend on those orders to count towards their yearly spend. Please let me know if there is an easier way to go about this! 

 

Thanks for your help. Screen Shot 2024-01-23 at 12.13.37 PM.png

megweb
Shopify Partner
3 0 2

Hey Dave,

 

Unfortunately this didn't work, and we are still receiving alerts for the lifetime spend, not the total spend within 2024. Any further guidance you or anyone else has would be appreciated!