> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manalens.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Unity Analytics

> Move a Unity game from Unity Analytics to Manalens: event mapping, custom events, purchases, consent, audiences, dashboards, and the definitions that differ.

This guide maps each part of Unity Analytics (Unity Gaming Services) to Manalens: events, custom events, audiences, and dashboards. It also lists the definitions that differ, so your numbers do not surprise you after the switch.

> [!NOTE]
>
> Your Unity Analytics history does not move. There is no import, so export what you want to keep before you switch it off. See [Export your Unity Analytics data](#export-your-unity-analytics-data).

## Steps

**1. Install the Manalens Unity SDK**

Add the package next to Unity Analytics. The two SDKs are separate packages with separate IDs, so one build can send to both. See the [Unity SDK](https://docs.manalens.dev/sdks/unity.md#installation).

**2. Replace the calls**

Replace each `RecordEvent` with `Manalens.Track`, using the [event mapping](#event-mapping) below. Move your consent handler and your player ID.

**3. Run both SDKs for two weeks**

Ship one build that sends to both tools. Two weeks give you two of each weekday to compare. Compare trends, not totals: see [Definitions that differ](#definitions-that-differ).

**4. Rebuild your audiences and dashboards**

Create the segments from the [audience mapping](#audience-mapping), and start from the [Game KPIs template](https://docs.manalens.dev/features/dashboards.md#templates).

**5. Remove Unity Analytics**

Remove every `AnalyticsService` call and the Analytics package, then ship a build without them.

## Event mapping

The Manalens SDK sends the session events for you, as Unity does. You record purchases, ads, and your own game events in code.

| Unity Analytics | Manalens | Notes |
| - | - | - |
| `sdkStart`, `gameStarted` | `game_open` and `session_start` | Sent for you at launch. |
| `newPlayer` | `game_open` with `is_first_open: true` | Sent for you on the first launch on the device. A new user ID does not make a new player. |
| `gameEnded` | `session_end` with `duration_s` | Sent for you on quit, and after 30 minutes without focus or events. |
| `transaction` | `purchase` with `revenue` and `currency` | Send it yourself. Events are flat, so send one event per purchase, with the item in a property. See [Purchases](#purchases). |
| `transactionFailed` | `purchase_failed` | No reserved name yet: send it as a custom event, with a `reason` property. |
| `adImpression` | `ad_impression` | No reserved name yet: send it as a custom event, with `ad_network`, `placement`, `revenue`, and `currency`. Like any custom event with a numeric `revenue`, it adds to the [Revenue metric](https://docs.manalens.dev/features/revenue.md), so leave `revenue` out if you want ad revenue kept separate. |
| `clientDevice` | Not needed | Every event carries `context.app`: platform, version, build, and storefront. No device or hardware details are sent. |
| `gameRunning` | Not needed | Sessions end after 30 minutes without focus or events, so no heartbeat event is needed. |
| `acquisitionSource` | [Install attribution](https://docs.manalens.dev/attribution/installs.md) and the [Steam UTM import](https://docs.manalens.dev/integrations/steam.md) | No direct match: attribution comes from your website visits and links, not from a mobile attribution partner. |
| `ddnaForgetMe`, `RequestDataDeletion()` | `SetConsent(false)`, then [Delete a player](https://docs.manalens.dev/features/players.md#delete-a-player) | `SetConsent(false)` deletes the ID, the session, and the queue on the device. To delete data already sent, an owner or admin deletes the player in the dashboard. |
| Your custom events | `Manalens.Track("name", properties)` | No schema to create first. See [Custom events](#custom-events). |
| `UnityServices.ExternalUserId` | `Manalens.Identify("player_42")` | Joins devices and your website to one player. See [Identify users](https://docs.manalens.dev/guides/identify-users.md). |

Use flat `snake_case` names, such as `level_complete`. The [game event conventions](https://docs.manalens.dev/data/events/game.md) list the names that the game reports read.

## Custom events

Replace each `RecordEvent` call with one `Track` call. In Unity Analytics, you create the event and its parameters in the Event Manager first, and write a matching `Event` class, because events that do not match a schema are rejected. In Manalens, you send a name and a dictionary of properties. There is no Event Manager and no schema.

```csharp Unity Analytics theme={null}
// Create levelComplete in the Event Manager first.
public class LevelCompleteEvent : Unity.Services.Analytics.Event
{
    public LevelCompleteEvent() : base("levelComplete") { }
    public int Level { set { SetParameter("level", value); } }
    public int Score { set { SetParameter("score", value); } }
}

AnalyticsService.Instance.RecordEvent(new LevelCompleteEvent { Level = 3, Score = 1200 });
```

```csharp Manalens theme={null}
Manalens.Track("level_complete", new Dictionary<string, object> { ["level"] = 3, ["score"] = 1200 });
```

Property values are strings, numbers, booleans, or null. Send a date as an ISO 8601 string. The SDK drops lists, dictionaries, and objects, and logs a warning.

## Purchases

Send one `purchase` event with a numeric `revenue` property. The Revenue metric sums it.

```csharp theme={null}
Manalens.Track("purchase", new Dictionary<string, object>
{
    ["revenue"] = 4.99, ["currency"] = "USD", ["store"] = "app_store", ["item"] = "large_treasure_chest",
});
```

> [!WARNING]
>
> Unity IAP 4.2 or later sends `transaction` events to Unity Analytics for you. Send the Manalens `purchase` yourself, from your Unity IAP callback. If you also connect [Stripe](https://docs.manalens.dev/integrations/stripe.md) or [Paddle](https://docs.manalens.dev/integrations/paddle.md), the provider record wins for that player, so a sale counts once.

## Consent and start-up

During the move, one consent handler can drive both SDKs. With `ConsentRequired = true`, the Manalens SDK sends nothing and stores no ID until `SetConsent(true)`, and it remembers the choice for the next launch. See [Consent mode](https://docs.manalens.dev/guides/consent.md).

```csharp theme={null}
public void OnAnalyticsConsent(bool granted)
{
    // Unity Analytics (Unity 6.1 and earlier, or Analytics SDK 6.0 and earlier)
    if (granted) AnalyticsService.Instance.StartDataCollection();
    else AnalyticsService.Instance.StopDataCollection();

    // Manalens
    Manalens.SetConsent(granted);
}
```

## Audience mapping

Unity ships 12 standard audiences. Manalens has [lifecycle stages](https://docs.manalens.dev/data/metrics.md#lifecycle-stages), [player filters](https://docs.manalens.dev/features/filters-segments.md#player-filters), and [built-in segments](https://docs.manalens.dev/features/filters-segments.md#built-in-segments). Build each Unity audience as a saved segment on the [Players](https://docs.manalens.dev/features/players.md) page.

| Unity audience | Unity definition | Manalens |
| - | - | - |
| Recently Active | Last session in the last 30 days | **Last seen** in the last 30 days |
| All Spenders | Lifetime real spend above 0 | **Revenue** greater than 0, with **Lifetime**. For a premium game, the built-in **Buyers** segment. |
| Non-Spenders | Lifetime real spend of 0 | **Revenue** equals 0, with **Lifetime**. For a premium game, the built-in **Not bought yet** segment. |
| Recent Spenders | Payment in the last 7 days | **Behavior**: did `purchase` at least once in the last 7 days |
| Lapsed Spenders | Last payment more than 30 days ago | **Revenue** greater than 0 with **Lifetime**, and **Behavior**: did `purchase` exactly 0 times in the last 30 days |
| New Players | First session in the last 2 days | **First seen** in the last 2 days. The built-in **New players** segment uses 7 days. |
| Existing Players | Not new | **First seen** more than 2 days ago |
| Engaged | Played on 7 of the last 7 days | **Days active**: at least 7 of the last 7 days |
| Unengaged | Played on 2 or fewer of the last 7 days | **Days active**: at most 2 of the last 7 days |
| Dormant | Last session 7 to 14 days ago | **Lifecycle**: At Risk (7 to 13 days) and Dormant (14 to 27 days) |
| Churned | No session for 14 days or more | **Lifecycle**: Dormant (14 to 27 days) and Churned (28 days or more) |
| Veteran | More than 100 lifetime sessions | **Behavior**: did `session_start` more than 100 times, at any time |

Manalens also has stages that Unity has no audience for: **Resurrected** (back in the last 7 days after a gap of 28 days or more) and **Active**. The built-in **Regulars** segment is players active on 3 or more of the last 7 days.

> [!WARNING]
>
> **"Churned" means different things.** In Unity, Churned is 14 days or more without a session. In Manalens, Churned is 28 days or more, and 14 to 27 days is **Dormant**. If you compare the Churned count alone, you see fewer churned players after the switch, and retention looks better than it is. Compare Dormant and Churned together with Unity's Churned.

Two more differences:

* **Stages do not overlap.** Each player has one lifecycle stage, checked in a fixed order. Unity audiences overlap: one player can be Engaged, a Recent Spender, and a Veteran at once. Saved segments in Manalens can overlap too.
* **Where they apply.** People filters and built-in segments work on the Players page. Saved segments also work in funnel, retention, and user path charts. Unity audiences also target Game Overrides and Remote Config; Manalens has no remote config.

For `purchase` in a Behavior filter, paid Stripe, Paddle, and itch.io payments also count. Steam sales have no player, so they do not count.

## Dashboard mapping

Unity's built-in dashboards are fixed. Manalens templates are editable boards that you save and change.

| Unity dashboard | Manalens |
| - | - |
| Game Performance | [Game KPIs template](https://docs.manalens.dev/features/dashboards.md#templates): DAU, WAU, MAU, stickiness, sessions per DAU, session length, playtime per DAU, churn rate |
| Retention | D1, D7, and D30 cards and **Install cohorts** in Game KPIs, and the [Retention report](https://docs.manalens.dev/features/retention.md) |
| Revenue | The **Revenue** tile on [Overview](https://docs.manalens.dev/features/overview.md) and the [Revenue](https://docs.manalens.dev/features/revenue.md) page |
| User Acquisition | The acquisition card on [Overview](https://docs.manalens.dev/features/overview.md) and the [Attribution](https://docs.manalens.dev/attribution/overview.md) page |
| Unity Cloud Diagnostics (a separate product) | [Game health template](https://docs.manalens.dev/features/dashboards.md#templates) and [Error tracking](https://docs.manalens.dev/features/error-tracking.md) |
| Data Explorer, Funnels, SQL Data Explorer | [Explorer](https://docs.manalens.dev/features/explorer.md), [Funnels](https://docs.manalens.dev/features/funnels.md), and [SQL Explorer](https://docs.manalens.dev/guides/sql-explorer.md) |

## Definitions that differ

Expect the totals to differ during the two weeks of overlap. These are the main reasons:

| Topic | Unity Analytics | Manalens |
| - | - | - |
| Active player | Any event counts as activity | Retention counts a return with `session_start`. Lifecycle counts game events only, not website page views. See [D1, D7 and D30 retention](https://docs.manalens.dev/data/metrics.md#d1-d7-and-d30-retention). |
| Revenue | Gross | Net of refunds, in your reporting currency at the ECB rate of the event day. See [Revenue](https://docs.manalens.dev/data/metrics.md). |
| Churned | 14 days or more without a session | 28 days or more without game activity |
| MAU | Unique user IDs with a session, across all projects and environments of the organization | Distinct players with at least one event in the calendar month, per project |
| Late events | Events collected more than 30 days before they arrive are rejected | App events up to 7 days old are accepted. Game reports place them on the day they happened. |
| Sends | Every 60 seconds | Every 10 seconds, at 20 queued events, on pause, and on quit. See the [offline queue](https://docs.manalens.dev/sdks/unity.md#offline-queue-and-retries). |

## Export your Unity Analytics data

Do this before you switch Unity Analytics off. Unity keeps raw event data for 13 months, then deletes it.

* **Dashboard reports:** export to PNG or CSV from Unity.
* **Raw data:** Unity Data Access shares your Analytics data through Snowflake. You need your own Snowflake account, and only organization owners can open the Data Access settings.
* **Totals to compare:** while you still have access, note the totals you want to compare with later, for example with SQL Data Explorer.

Manalens charts export to CSV, so you can put old and new months side by side. Note the day you switched, and compare trends across that day. The [server events API](https://docs.manalens.dev/sdks/server.md) accepts past timestamps for a backfill of events and revenue from your own script; backfilled events do not rebuild sessions or retention.

## Checklist before you remove Unity Analytics

Test a development build, not the editor, and check each item in the [Activity](https://docs.manalens.dev/features/activity.md) feed. Set `Debug = true` to log each queued event and each failed send.

* `game_open` and `session_start` arrive on the first launch, with `is_first_open: true`.
* Each mapped event arrives with the right name and properties, and no property is dropped with a warning.
* A purchase arrives once, with `revenue` and `currency`.
* With `ConsentRequired`, nothing is sent before `SetConsent(true)`.
* `Identify` with the same player ID joins the player on a second device and on your website.
* Offline events arrive with their original time after you go online.
* `session_end` arrives with `duration_s` when you quit.
* Daily players and sessions move the same way in both tools for two weeks.

For the reasons to move and the Unity pricing details, read [How to move from Unity Analytics to Manalens](https://manalens.dev/blog/migrate-from-unity-analytics) on our blog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.