# Abandoned Transaction Paywalls

Learn how to respond when a user starts a purchase, then cancels the transaction.

When a user opens the store purchase sheet and dismisses it before completing the purchase, Superwall tracks a `transaction_abandon` event. You can respond to that in three ways:

1. Run an **On Abandon** action from the purchase button.
2. Show another paywall with a `transaction_abandon` placement.
3. Keep the user on the current paywall and reveal a drawer, offer, or survey using the `didAbandonTransaction` paywall state.

Run an On Abandon action [#run-an-on-abandon-action]

Use the purchase action's **On Abandon** section when the response belongs to the button that started the purchase. This is the simplest option for cases like closing the paywall, moving to a recovery page in the same Flow, setting a state variable, or registering a custom placement after the user cancels the purchase sheet.

To set it up, select the purchase button, open its **Tap Behavior**, and add one or more actions under **On Abandon**. The actions run after Superwall receives the abandon result, so `state.didAbandonTransaction` and `products.abandoned` are already available when they execute.

For the full list of outcome actions and SDK requirements, see [Purchase outcome actions](/docs/dashboard/dashboard-creating-paywalls/paywall-editor-styling-elements#purchase-outcome-actions).

Show another paywall instead [#show-another-paywall-instead]

You can add `transaction_abandon` as a placement in a campaign. If a matching paywall is available, Superwall closes the current paywall and presents the new one.

Use this approach when the recovery experience should be a completely separate paywall, such as a dedicated discount page, a transaction-abandon survey template, or a later campaign with its own audience filters.

For campaign setup details and available audience filter parameters, see [`transaction_abandon`](/docs/dashboard/dashboard-campaigns/campaigns-standard-placements#transaction_abandon).

<iframe width="560" height="315" src="https://www.youtube.com/embed/-LeBeSHTs4g?si=DH7sWlyF-ppoO8tp" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" referrerpolicy="strict-origin-when-cross-origin" />

Use `didAbandonTransaction` in the current paywall [#use-didabandontransaction-in-the-current-paywall]

Use the `didAbandonTransaction` state when you want the recovery offer to feel like part of the same paywall instead of closing one paywall and opening another.

`didAbandonTransaction` is a boolean state variable that Superwall manages for you. It starts as `false` when the paywall opens or when a new purchase begins. If the user cancels the store purchase sheet, Superwall sets it to `true`.

You can use that state to open a drawer after the abandoned transaction:

## Add a drawer for the recovery offer

In the paywall editor, add a [Drawer](/docs/dashboard/dashboard-creating-paywalls/paywall-editor-drawer-component) element. Put the follow-up offer, survey, or personalized message inside the drawer.

## Bind the drawer to the transaction state

Select the drawer and set its open state to use a dynamic value. Use the `state.didAbandonTransaction` variable as the condition so the drawer opens when the value is `true`.

## Add the follow-up purchase action

Add a button inside the drawer that starts the purchase you want to offer next. For example, you might show the same product with clearer copy, a discounted product, or a lower-priced alternative.

## Publish and test the paywall

Preview the paywall on a device, tap the purchase button, then dismiss the App Store or Google Play purchase sheet. The drawer should appear on the same paywall after the transaction is abandoned.



> **Tip**

If you need to edit or preview the drawer in the paywall editor, open the **Variables** panel and
temporarily set `state.didAbandonTransaction` to `true`.



Personalize the recovery offer [#personalize-the-recovery-offer]

When a transaction is abandoned, Superwall also stores the abandoned product reference. This lets you personalize copy based on the product the user tried to buy.

For example, if the user attempted to purchase the annual product, you can use the abandoned product variables to show annual-specific copy or pricing inside the drawer:

```liquid
Still interested in {{ products.abandoned.periodly }} access?
```

You can use the same product fields available for your other product variables, such as `products.abandoned.price`, `products.abandoned.periodly`, or `products.abandoned.trialPeriodText`.

> **Note**

`products.abandoned.*` refers to the product on the current paywall that the user attempted to
purchase. Campaign audience filters use a separate `abandoned_product_id` value, which is the
store product identifier.