# Ecommerce

This playbook shows how to set up Pushwoosh for the mobile app of an online store, from identifying shoppers to launching journeys for abandoned carts, repeat orders, and win-back.

Set up Pushwoosh in seven stages, in this order:

1. Set a [User ID](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#identify-shoppers-by-user-id) for each shopper, so Pushwoosh recognizes the same shopper on every device.
2. Choose the [events to track](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#set-up-the-events) to record what shoppers do in the app: view products, add them to the cart, and place orders.
3. Optional: store shopper data, such as the favorite category or the loyalty tier, in [tags](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#store-shopper-data-in-tags).
4. Group shoppers who match your conditions in [segments](/tutorials/industry-playbooks/ecommerce/build-the-segments/), for example shoppers who added a product to the cart and did not order.
5. Ask for push permission at the right moment, set delivery rules in **Settings** → **Message delivery settings**, and set up a control group. See [Prepare for communication](/tutorials/industry-playbooks/ecommerce/prepare-for-communication/).
6. Send messages automatically with [journeys](/tutorials/industry-playbooks/ecommerce/build-the-journeys/) when a shopper does something in the app or joins a segment.
7. [Test each journey](/tutorials/industry-playbooks/ecommerce/launch-and-measure/), then read its statistics and measure results.

To start with less, follow [Minimum setup to start messaging shoppers](#minimum-setup-to-start-messaging-shoppers).

## Prerequisites

<Aside type="caution" icon="setting" title="Developer assistance needed">
Some steps of this playbook are changes in your app's code. See [What your developers need to do](#what-your-developers-need-to-do).
</Aside>

* An [application in your Pushwoosh account](/product/first-steps/start-with-your-project/create-your-project/), with the [SDK integrated](/developer/first-steps/integrate-pushwoosh-sdk/) (the Pushwoosh code library inside your app) so devices register automatically.
* A [role](/product/account-management-and-security/multi-login-accounts/#available-permissions) in the Pushwoosh account with **Modify** for **Applications**, to create events, segments, and journeys and change settings, and **Send** for **Messages**. To look up test shoppers in **User explorer**, the role also needs **Personal data**.
* [Email](/product/messaging-channels/emails/) set up as a channel, only for the journeys that list email under **Needs**. Most journeys in this playbook use push and in-app messages.

<Aside type="note" title="Store on Shopify, WooCommerce, or Magento?">
This playbook covers a store app that uses the Pushwoosh SDK. If your store runs on Shopify, WooCommerce, or Magento, the integration sends its own order and abandoned cart events, with names that start with `PW_`. The Shopify integration also sends product view and add-to-cart events.

Use them in place of the matching custom events in this playbook, for example the abandoned cart event as the entry of Cart abandonment.

The Shopify and WooCommerce integrations record these events under the shopper's email in lowercase as the User ID. For these events and the app to count as one shopper, ask your developers to call `setUserId` with the same email in lowercase, not with your store's customer ID.

These events don't carry the order amount (`__amount`), so set up revenue for the order event in [Conversion events](/product/audience-data-and-segmentation/events/conversion-events/). For the event names, see [Shopify](/product/integrations/shopify/), [WooCommerce](/product/integrations/woocommerce-integration/), and [Magento](/product/integrations/magento-integration/).
</Aside>

## What your developers need to do

Hand your developers this list, so they can ship it in one release:

* [Set the User ID at login](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#identify-shoppers-by-user-id).
* [Send the events](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#send-the-events-from-the-app) your journeys need.
* [Send the order as an event with its amount and currency](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#track-revenue-from-orders), so Pushwoosh can count revenue.
* [Move the push permission request](/tutorials/industry-playbooks/ecommerce/prepare-for-communication/#ask-for-push-permission-at-the-right-moment) out of the first launch.
* Handle [deep links](/product/messaging-channels/push-notifications/advanced-push-features/deep-linking/) to the product, cart, and order screens, which the journeys open from pushes.

## Minimum setup to start messaging shoppers

If you do not need all seven stages yet, this minimum setup covers two basic tasks: bringing back shoppers who left items in the cart and winning back shoppers who stopped ordering. Complete these steps:

1. Ask your developers to call `setUserId` on login. See [Identify shoppers by User ID](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#identify-shoppers-by-user-id).
2. Ask your developers to send the `Product added to cart` and `Order placed` events. See [Set up the events](/tutorials/industry-playbooks/ecommerce/collect-shopper-data/#set-up-the-events).
3. Ask your developers to move the push permission request to a later moment, for example after the first product is added to the cart. On iOS, a shopper who declines the prompt on the first launch can't be asked again. See [Ask for push permission at the right moment](/tutorials/industry-playbooks/ecommerce/prepare-for-communication/#ask-for-push-permission-at-the-right-moment).
4. Set the [delivery rules](/tutorials/industry-playbooks/ecommerce/prepare-for-communication/#set-delivery-rules-before-you-message-shoppers).
5. Build the [At-risk customers](/tutorials/industry-playbooks/ecommerce/build-the-segments/#at-risk-customers) segment. It fills 60 days after `Order placed` events start to arrive. To start sooner, use `PW_ApplicationOpen` instead of `Order placed` in its filters. The segment then also takes in shoppers who stopped opening the app but never ordered.
6. Create the content for these two journeys, as listed under **Content to prepare** in each journey recipe.
7. Launch [Cart abandonment](/tutorials/industry-playbooks/ecommerce/build-the-journeys/browse-and-cart/#cart-abandonment) and [Win-back for inactive customers](/tutorials/industry-playbooks/ecommerce/build-the-journeys/loyalty-and-win-back/#win-back-for-inactive-customers).

Add the other segments and journeys later, as their events start arriving.

## What next

To add more journeys, see these guides:

* [Set up a retention campaign](/tutorials/product-guides/lifecycle-marketing-campaigns/how-to-set-up-a-retention-campaign-in-pushwoosh/)
* [Create a re-engagement campaign](/tutorials/product-guides/lifecycle-marketing-campaigns/how-to-create-a-re-engagement-campaign-in-pushwoosh/)
* [Build push content from a catalog or feed](/product/content/push-presets/build-push-content-from-a-feed/)
* [Run A/B/n tests in journeys](/tutorials/product-guides/how-to-create-campaigns-in-pushwoosh/how-to-abn-test-customer-journeys/)