# Mobile games

This playbook shows how to set up Pushwoosh for a mobile game, from identifying players to launching journeys for onboarding, engagement, reactivation, and in-app purchases.

Set up Pushwoosh in seven stages, in this order:

1. Set a [User ID](/tutorials/industry-playbooks/mobile-games/collect-player-data/#identify-players-by-user-id) for each player, so Pushwoosh recognizes the same player on every device.
2. Choose the [events to track](/tutorials/industry-playbooks/mobile-games/collect-player-data/#set-up-the-events-to-track) to record what players do in the game.
3. Optional: store player data, such as the level or whether the player has paid, in [tags](/tutorials/industry-playbooks/mobile-games/collect-player-data/#store-player-data-in-tags).
4. Group players who match your conditions in [segments](/tutorials/industry-playbooks/mobile-games/build-the-segments/), for example players who have not opened the game for 30 days.
5. Ask for push permission at the right moment, set delivery rules, and set up a control group. See [Prepare for communication](/tutorials/industry-playbooks/mobile-games/prepare-for-communication/).
6. Send messages automatically with [journeys](/tutorials/industry-playbooks/mobile-games/build-the-journeys/) when a player does something in the game or joins a segment.
7. [Test each journey](/tutorials/industry-playbooks/mobile-games/launch-and-measure/), then read its statistics and measure results.

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

## Prerequisites

<Aside type="caution" icon="setting" title="Developer assistance needed">
Some steps of this playbook are changes in your game'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/) so devices register automatically.
* Email and App Inbox only for the journeys that list them under **Needs**: [Reactivation for inactive players](/tutorials/industry-playbooks/mobile-games/build-the-journeys/loyalty-and-win-back/#reactivation-for-inactive-players) uses email, and [Live event and VIP announcements](/tutorials/industry-playbooks/mobile-games/build-the-journeys/loyalty-and-win-back/#live-event-and-vip-announcements) uses App Inbox. Most journeys in this playbook use push and in-app messages.

## 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/mobile-games/collect-player-data/#identify-players-by-user-id).
* [Send the events](/tutorials/industry-playbooks/mobile-games/collect-player-data/#send-the-events-from-the-game) your journeys need.
* [Track purchases](/tutorials/industry-playbooks/mobile-games/collect-player-data/#track-revenue-as-pw_conversion) and, if you sell subscriptions, [pass the player's ID with each store purchase](/tutorials/industry-playbooks/mobile-games/collect-player-data/#track-subscriptions-from-the-stores).
* [Move the push permission request](/tutorials/industry-playbooks/mobile-games/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 level, reward, store, and event screens, which the journeys open from pushes.
* Integrate the Message Inbox SDK if you use [App Inbox](/tutorials/industry-playbooks/mobile-games/build-the-journeys/loyalty-and-win-back/#live-event-and-vip-announcements).

## Minimum setup to start messaging players

If you do not need all seven stages yet, this minimum setup covers two basic tasks: getting new players through the tutorial and winning back players who stopped playing. Complete these steps:

1. Ask your developers to call `setUserId` on login. See [Identify players by User ID](/tutorials/industry-playbooks/mobile-games/collect-player-data/#identify-players-by-user-id).
2. Check that `PW_ApplicationOpen` arrives from the game. Ask your developers to also send the `Tutorial started` and `Tutorial completed` events. See [Set up the events to track](/tutorials/industry-playbooks/mobile-games/collect-player-data/#set-up-the-events-to-track) and [Send the events from the game](/tutorials/industry-playbooks/mobile-games/collect-player-data/#send-the-events-from-the-game).
3. Move the push permission request to a later moment, for example after the tutorial. On iOS, a player 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/mobile-games/prepare-for-communication/#ask-for-push-permission-at-the-right-moment).
4. Set the [delivery rules](/tutorials/industry-playbooks/mobile-games/prepare-for-communication/#set-delivery-rules-before-you-message-players).
5. Build the [At-risk players](/tutorials/industry-playbooks/mobile-games/build-the-segments/#at-risk-players) segment. If you already track purchases with `PW_InAppPurchase`, also build [Recent payers](/tutorials/industry-playbooks/mobile-games/build-the-segments/#recent-payers).
6. Create the content for these two journeys, as listed under **Content to prepare** in each recipe.
7. Launch [Onboarding for new players](/tutorials/industry-playbooks/mobile-games/build-the-journeys/new-and-active-players/#onboarding-for-new-players) and [Reactivation for inactive players](/tutorials/industry-playbooks/mobile-games/build-the-journeys/loyalty-and-win-back/#reactivation-for-inactive-players).

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/)
* [Set up a user engagement campaign](/tutorials/product-guides/lifecycle-marketing-campaigns/how-to-set-up-a-user-engagement-campaign-in-pushwoosh/)
* [Create a re-engagement campaign](/tutorials/product-guides/lifecycle-marketing-campaigns/how-to-create-a-re-engagement-campaign-in-pushwoosh/)
* [Run A/B/n tests in journeys](/tutorials/product-guides/how-to-create-campaigns-in-pushwoosh/how-to-abn-test-customer-journeys/)