Recover abandoned Shopify carts with personalized push

By General Input

When a shopper leaves checkout, we check their order history and send a push that names the item they left and matches how they shop.

Integrations

  • OneSignal
  • Shopify
  • Google Sheets

Type

Agentic Task

Categories

  • Marketing
  • Sales

Watch my Shopify store for new abandoned checkouts using the Shopify abandoned checkouts poll trigger, and try to recover each one with a personalized push instead of a generic blast. Process each abandoned checkout once.

Apply my filters before doing any other work. Skip the checkout if its total cart value is below CART_VALUE_THRESHOLD, which I will set (for example 40 in store currency). Skip it if I cannot identify the shopper, meaning there is no Shopify customer attached to the checkout, or that customer has no id I can use to reach them in OneSignal. Guest checkouts are expected to fall out here.

For checkouts that pass, look the shopper up in Shopify. Use Get Customer with the customer id on the checkout to pull their profile, then use Get Customer Orders to pull their order history. Use that history for two things. First, the anti nag check: if the shopper has any order created after the abandoned checkout timestamp, they already bought, so stop and send nothing. Second, classification: zero prior orders means first time visitor, and one or more prior orders means repeat buyer. For repeat buyers, note the items and the date of their most recent order.

Then write the push copy yourself, sized for a push notification: a title of roughly 40 characters and a body under roughly 120 characters. Always name the specific item left in the cart, taken from the abandoned checkout line items, and never fall back on a generic line like you left something in your cart. For a first time visitor, write a welcome style nudge that introduces the store warmly and uses BEST_SELLER_PRODUCT, which I will set, as social proof, along the lines of it being what most shoppers pick first. For a repeat buyer, write a loyalty framing that thanks them for coming back and references what they bought last time by name, connecting it to the item now sitting in the cart. Pick exactly one of these two angles per shopper.

Send the copy through OneSignal Create Message. Target only this one shopper: set include_aliases with alias label external_id and the shopper's Shopify customer id as the alias id. Do not set any other targeting method, such as included_segments, include_external_user_ids, or include_subscription_ids, because OneSignal accepts exactly one targeting method per message. Put the body in contents and the title in headings so this sends as a push. Set idempotency_key to a stable value derived from the abandoned checkout id and reuse that exact value on every retry, so a retry after a timeout or a rate limit can never send the same shopper a second recovery push. If OneSignal returns a 429, wait for the Retry-After value before retrying.

Finally, append one row per recovery attempt to my Google Sheet using Append Values, with these columns: timestamp, abandoned checkout id, shopper type (first time or repeat), cart value, the item left in the cart, the exact push copy that was sent, and the OneSignal message id. Also append a row for each checkout that was skipped, putting the skip reason (below threshold, already ordered, or unreachable shopper) in place of the copy, so the sheet shows both what went out and what got filtered. I want to compare over time which angle, welcome or loyalty, actually converts.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads