# Integration best practices

> Configure your integration correctly to ensure that you share the required data with your campaign.

When you integrate your preferred Mobile Measurement Partner (MMP) with your Unity User Acquisition campaign, ensure that you configure your integration correctly. You must follow these best practices to ensure your campaign receives the necessary data. Failing to send the correct data can negatively impact your campaign performance.

Use these best practices as you complete your integration set up to ensure you configure your data-sharing settings correctly:

## Share install data from all sources

When you share install data with Unity, ensure that you include data from your entire user base, including attributed, unattributed, and organic installs. Refer to the [Attribution fundamentals](/user-acquisition/data-sharing/attribution/campaign-attribution-fundamentals.md#attribution-types) for definitions of each attribution type.

Each MMP has unique terminology for this setting. Refer to the following examples of how to share data from all sources in supported MMP dashboards:

1. **Adjust**

   ### Share data from all sources with Adjust

   Use these steps to share data from all sources in the Adjust dashboard:

   1. Go to the **Campaign Lab** tab > **Partners** page.
   2. From the **What sources of data do you want to share** options, select **Data from all attribution sources**.

2. **AppsFlyer**

   ### Share data from all sources with AppsFlyer

   Use these steps to share data from all sources in the AppsFlyer dashboard:

   1. Go to the **Integration** tab > **Default postbacks** section.
   2. From the **for users from** dropdown, select **All media sources, including organic**.

3. **Singular**

   ### Share data from all sources with Singular

   Use these steps to share data from all sources in the Singular dashboard:

   1. Go to the **Attribution Postbacks & Settings** tab > **Attribution Postbacks** table.
   2. Enable the **Send All** checkbox.

4. **Tenjin**

   ### Share data from all sources with Tenjin

   Use these steps to share data from all sources in the Tenjin dashboard:

   1. Go to the **Callbacks** tab for your app.
   2. From the **User filter** dropdown, select **all users**.

## Map post-install events correctly

When you share [post-install event data](/user-acquisition/data-sharing/post-install-event-data-sharing.md) with your campaign, ensure that you correctly map the post-install events. Correct mapping means that you align the Unity event name with the correct MMP event name.

> **Warning:**
>
> If you use any MMP other than Singular, don't combine ad revenue events with in-app purchase (IAP) events.
>
> If your MMP account supports ad revenue data-sharing, send this data as a dedicated ad revenue event. Sending ad revenue as a different event type can cause campaign optimization to stop working.
>
> Refer to the partner-specific [Integration guides](./integration-guides) for detailed mapping instructions.

Refer to the following examples of correctly mapped event names:

1. **Adjust**

   ### Adjust event mapping

   Map your post-install events in the **Map events to share with Unity Ads** section of the Adjust integration as follows:

   > **Important:**
   >
   > If your Adjust account supports ad revenue data-sharing, send this data as a dedicated `ad_revenue` event.
   >
   > Otherwise, don't send ad revenue events. Mapping ad revenue events as other event types, such as `purchase`, can cause campaign optimization to stop working.

   | In-app purchase (IAP) | `purchase`       | `purchase`               |
   | --------------------- | ---------------- | ------------------------ |
   | Milestone completion  | `level_complete` | `{milestone_event_name}` |
   | Session               | `session`        | `session`                |

2. **AppsFlyer**

   ### AppsFlyer event mapping

   Map your post-install events in the **In-app event postbacks** table of the AppsFlyer integration setup as follows:

   > **Important:**
   >
   > If your AppsFlyer account supports ad revenue data-sharing, send this data with the **Get ad revenue data** toggle in the **Ad revenue** tab.
   >
   > Otherwise, don't send ad revenue events. Mapping ad revenue events as other event types, such as `af_purchase`, can cause campaign optimization to stop working.

   | In-app purchase (IAP) | `purchase`       | `af_purchase`            |
   | --------------------- | ---------------- | ------------------------ |
   | Milestone completion  | `level_complete` | `{milestone_event_name}` |
   | Session               | `session`        | `af_session`             |

3. **Singular**

   ### Singular event mapping

   Map your post-install events in the **Revenue Events Postbacks** and **Events Postbacks** tables of the Singular integration setup as follows:

   > **Important:**
   >
   > Singular is the only MMP that supports sending ad revenue and in-app purchase events together. To send ad revenue events with Singular, ensure that you select **Send all ad monetization events** from the **Revenue Events Postbacks** dropdown and select **`__REVENUE__*`** from the **SDK Event Name** dropdown.

   | In-app purchase (IAP) | `purchase`       | * `_iap_`
   * `{custom_purchase_event_name}` |
   | --------------------- | ---------------- | ------------------------------------------ |
   | Ad revenue            | `ad_revenue`     | `__REVENUE__*`                             |
   | Milestone completion  | `level_complete` | `{milestone_event_name}`                   |
   | Session               | `session`        | `_SESSION_`                                |

4. **Tenjin**

   ### Tenjin event mapping

   Activate your post-install events in the **Channel Callbacks** page of the Tenjin integration setup as follows:

   > **Important:**
   >
   > If your Tenjin account supports ad revenue data-sharing, send this data as a dedicated **Ad Revenue Impression** event.
   >
   > Otherwise, don't send ad revenue events. Mapping ad revenue as other event types, such as **In-app Purchase**, can cause campaign optimization to stop working.

   | In-app purchase (IAP) | `purchase`   | `In-app Purchase`       |
   | --------------------- | ------------ | ----------------------- |
   | Ad revenue            | `ad_revenue` | `Ad Revenue Impression` |
   | Session               | `session`    | `Unity ads app open`    |

## Share both values and revenue for purchase and revenue events

When you share Purchase or Ad revenue event data with Unity, ensure that you share both values and revenue for each event. Sharing this complete data improves Unity's User Acquisition models and can improve campaign performance.

Your MMP might use different terminology for these settings. Refer to the following examples:

1. **AppsFlyer**

   ### Share values and revenue with AppsFlyer

   To share both values and revenue with your post-install events, follow these steps in the AppsFlyer dashboard:

   1. Go to the **Integration** tab > **In-app event postbacks** section.
   2. From the **including** dropdown for each event, select **Values & revenue**.

2. **Singular**

   ### Share values and revenue with Singular

   To share both values and revenue with your post-install events, follow these steps in the Singular dashboard:

   1. Go to the **In app Events Postback** tab of the integration setup.
   2. Select the **Include Revenue** checkbox for each row.

## Set postback windows to lifetime

If your MMP supports lifetime postback windows, always set the window to lifetime. Otherwise, set your postback window to the maximum length. Setting your postback window to lifetime allows your campaign to learn from your app's entire install history and can improve campaign performance.

Your MMP might use different terminology for the postback window settings. Refer to the following examples:

1. **AppsFlyer**

   ### Set lifetime postback windows with AppsFlyer

   To use lifetime postback windows with AppsFlyer, go to the **In-app event settings** section of your integration setup and set the **In-app event postback window** to **lifetime**.

2. **Singular**

   ### Set lifetime postback windows with Singular

   To set lifetime postback windows with Singular, follow these steps:

   1. Go to the **In app Events Postback** tab of the integration setup.
   2. In the **Postback Window Starting Point** column, select **Unlimited** for each event.
   3. If you have a Singular [Enterprise](https://support.singular.net/hc/en-us/articles/115000483946-Partner-Configuration-and-Postbacks-FAQ-and-Troubleshooting#in_app_event_postbacks) account, set the **Postback Window (days)** to **Unlimited** . Otherwise, set the window to `30` days.
