Recover abandoned Shopify carts with personalized push

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.

Agentic Task
OneSignalShopifyGoogle SheetsMarketingSalesContent GenerationNotifications & Alerts
PromptCreate

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.

Example output

First time visitor, cart value 68.00, item: Ridgeline Wool Beanie Title: Your beanie is still waiting Body: The Ridgeline Wool Beanie is in your cart. New here? The Alpine Crew Socks are what most shoppers grab first. Repeat buyer, cart value 142.00, item: Trail Runner Jacket, last order: Alpine Crew Socks on 12 March Title: Welcome back, ready to finish? Body: Your Trail Runner Jacket is still saved. It layers nicely over the Alpine Crew Socks you picked up in March. Sheet row appended: 2026-08-09 14:22 | 4102993 | repeat | 142.00 | Trail Runner Jacket | "Welcome back, ready to finish? ..." | msg_9f2a1c

What does this prompt do?

  • Watches your Shopify store for abandoned checkouts and picks up each one within minutes, no manual export needed
  • Looks the shopper up in Shopify first, so a first time visitor and a loyal repeat buyer never get the same message
  • Writes fresh push copy that names the exact item left behind, then sends it to that one shopper through OneSignal
  • Skips small carts and anyone who already placed an order after leaving, so nobody gets nagged about a purchase they finished
  • Logs every attempt to a Google Sheet with the cart value, the copy sent, and the shopper type, so you can see which angle actually wins

What do I need to use this?

  • A Shopify store you can connect, with permission to read customers, orders, and abandoned checkouts
  • A OneSignal account with push already set up for your app or website
  • Shoppers identified in OneSignal by their Shopify customer ID, so we can reach exactly the right person instead of blasting a segment
  • A Google Sheet to collect the results, with a tab ready for the log
  • The name of your best selling product, used as social proof for first time shoppers
  • A minimum cart value worth chasing, for example 40 in your store currency

How can I customize it?

  • Raise or lower the minimum cart value so you only chase checkouts worth recovering
  • Swap the best seller you cite as social proof, or change it seasonally as your hero product changes
  • Adjust the tone and length of the two angles, the welcome nudge and the loyalty note, or add a discount line to one of them
  • Point the log at a different sheet or add columns, such as whether that shopper came back and bought

FAQs

Will someone get a push after they already bought?
No. Before writing anything, we check the shopper's Shopify orders for one placed after they left checkout. If they already completed a purchase, the workflow stops and sends nothing.
What happens with guest shoppers who are not in my push audience?
They are skipped, because there is no way to reach a specific person who was never identified. The skip is written to your sheet with the reason, so you can see how many checkouts fall into that bucket.
Could a technical hiccup send the same shopper two pushes?
No. Each recovery message carries a unique key tied to that one abandoned checkout, so if the send is retried the shopper still only ever receives it once.
Can it send an email or a text instead of a push?
Yes. OneSignal can send email and SMS as well as push, so you can ask for a different channel, or keep push as the fast first touch and follow up elsewhere.
Why use an agent instead of a fixed template?
Because the message is written per shopper. It reads the actual cart contents and past purchases, then decides whether a welcome framing or a loyalty framing fits, which a single fixed template cannot do.
Does this need a Shopify app or theme change?
No changes to your storefront. It reads your store data and sends through OneSignal. The one setup detail is making sure OneSignal knows each shopper's customer ID.

Related templates

Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Auto-correct address typos and hold the orders you can't fix

Every weekday morning, harmless address typos get fixed on unshipped orders, and anything undeliverable is held while the customer confirms it.

Shippo
Shopify
Gmail
+1
Agentic Task
Catch bad shipping addresses before you buy the label

Every weekday morning, unfulfilled orders get an address check: harmless typos fixed automatically, risky addresses held with a note to the customer.

Shippo
Shopify
Gmail
+1
Agentic Task
Flag VIP client emails in Zoho Mail and alert your team

Keep a spreadsheet of your most important senders, and every email from one gets labeled, posted to your team channel, and logged automatically.

Zoho Mail
Google Sheets
Slack Bot
Deterministic Code

Stop recovering carts with a generic reminder blast.

Give every abandoned checkout a message that names the item and matches the shopper, and keep a running record of which angle brings people back.