> For the complete documentation index, see [llms.txt](https://help.branch.io/llms.txt).

# Enable Moloco (New)

> Integrate Moloco with Branch for optimized mobile app advertising, enabling attribution, postbacks, and cost data management for effective campaigns.

## Overview

[Moloco](https://www.moloco.com/) is a demand-side platform (DSP) that runs performance advertising campaigns and post-install optimization across mobile apps. Connect Moloco to Branch to attribute clicks and installs, forward conversion events via Postbacks, deep link users into your app, and import cost data.

For more information about integrating ad partners in general, visit our [Ad Partner Integration Guide](https://help.branch.io/marketer-hub/ad-partner-integration-guide-new.md).

> **Note: this guide is for new Branch**
>
> Please note that this guide is about integrating Moloco in the [new Branch experience](https://help.branch.io/marketer-hub/new-branch-overview.md). For information on Moloco in legacy Branch, visit our [legacy guide](https://help.branch.io/marketer-hub/moloco.md).

### Partner capabilities

| Capability | Details |
| --- | --- |
| Company type | DSP |
| Deep linking | Supported |
| Attribution | Click-through attribution, View-through attribution |
| Ad campaign types | Contact Moloco for details |
| Ad formats | Contact Moloco for details |
| Click types | Contact Moloco for details |
| Supported platforms | iOS, Android |
| Link wrapping | Not supported |
| Cost ingestion support | Supported |
| Cost ingestion types | API |
| Cost time zone | GMT |
| Pricing models | CPI, CPC, CPM |

## Before you begin

To set up the Moloco integration, you need:

- Ad partner integrations enabled for your Branch account. Availability varies by Branch plan. See [Branch pricing](https://www.branch.io/pricing/) or contact your Branch representative.
- A Branch account with access to **Configuration > Ad Partners** and admin permissions to enable and configure integrations.
- The Branch SDK implemented in your app ([iOS](https://help.branch.io/developer-hub/ios-sdk-overview.md) | [Android](https://help.branch.io/developer-hub/android-sdk-overview.md)) with [event tracking](https://help.branch.io/developer-hub/track-branch-events.md) configured.
- A Moloco account with admin access and campaigns running through Moloco.
- [PAM](https://help.branch.io/marketer-hub/predictive-aggregate-measurement.md) enabled (recommended).

> **Note: PAM uses two separate toggles**
>
> The **PAM for Publishers** toggle for this partner, found under **Partner settings** > **Manage account**, is separate from the account-level **PAM switch**. **PAM for Publishers** must be enabled to reconcile conversion events with your partner. To attribute events with PAM, you also need PAM enabled on the [Attribution page](https://help.branch.io/account-hub/attribution-page-new.md) under **Configuration** > **Attribution**. Learn more in our [PAM Overview](https://help.branch.io/marketer-hub/predictive-aggregate-measurement.md#pam-for-publishers).

## Enable Moloco

To begin, navigate to **Configuration > Ad Partners > Moloco**.

Branch enables Moloco's basic setup automatically. On the **Status** tab, the **Ad Linking**, **Attribution**, and **Postbacks** cards show **Enabled**. The **Clicks and Impressions** and **Cost Data** cards show **Needs Setup** until those features are configured (see [Create a Branch Ad Link](#create-a-branch-ad-link) and [Import cost data](#import-cost-data)).

(Recommended) To configure the optional **PAM for Publishers** privacy setting, select **Partner settings** to open the **Manage account** dialog and enable the toggle. When enabled, [PAM for Publishers](https://help.branch.io/marketer-hub/predictive-aggregate-measurement.md#pam-for-publishers) removes advertiser-specific user identifiers from postbacks for users who haven't opted in via Apple's App Tracking Transparency (ATT) framework, prioritizing identifiers provided directly by Moloco.

## Configure attribution

By default, Moloco uses your global app attribution settings. To set attribution windows specific to Moloco, enable the **Override global app settings** toggle on the **Attribution windows** tab.

For more information, follow [Configure attribution](https://help.branch.io/marketer-hub/ad-partner-integration-guide-new.md#configure-attribution) in the general [Ad Partner Integration Guide](https://help.branch.io/marketer-hub/ad-partner-integration-guide-new.md).

## Configure postbacks

Enabling Moloco automatically activates postbacks for `INSTALL`, `OPEN`, and `PURCHASE`. The default postback URL template is:

```
https://postback.adsmoloco.com/postback?ref_name=branch_data_sync&imp_id=${ (last_attributed_touch_data.~click_id)! }&device_country=${ (user_data.geo_country_code)! }&event_name=${ (name)! }&mmp_network=${(last_attributed_touch_data.~advertising_partner_name)!}&device_gaid=${ (user_data.aaid)! }&device_idfa=${ (user_data.idfa)! }&app_bundle=<@loop data=app.app_bundles val="bundle"><#if user_data.os == bundle.os><#if bundle.os=="ANDROID">${(bundle.android.package_name)!}<#elseif bundle.os == "IOS">${(bundle.ios.bundle_id)!}</#if><@break/></#if></@loop>&device_name=${ (user_data.model)! }&device_language=${ (user_data.language)! }&device_os=${ (user_data.os)! }&device_osv=${ (user_data.os_version)! }&moloco_mtid=${ (last_attributed_touch_data.source_string)! }&attribution_attributed=<#if (last_attributed_touch_data.$3p)?? && ad_network.machine_name?? && (last_attributed_touch_data.$3p)! == (ad_network.machine_name)!>1<#else>0</#if>&attribution_view_through=<#if last_attributed_touch_type == "CLICK">0<#elseif last_attributed_touch_type == "IMPRESSION">1</#if>&custom_data=<@urlencode><@jsonmap data=custom_data></@jsonmap></@urlencode>&event_revenue_raw=${ (event_data.revenue)! }&event_revenue_currency=${ (event_data.currency)! }&user_platform=${(user_data.platform)!}&store_install_begin_timestamp=${(store_install_begin_timestamp)!}&referrer_click_timestamp=${(referrer_click_timestamp)!}&device_ip=${ (user_data.ip)! }&device_ua=${ (user_data.user_agent)! }&ua=${ (user_data.user_agent)! }&device_idfv=${ (user_data.idfv)! }&product=<@urlencode><@jsonmap data=content_items></@jsonmap></@urlencode>
```

To add postbacks for additional events or to customize postback behavior, follow [Configure postbacks](https://help.branch.io/marketer-hub/ad-partner-integration-guide-new.md#configure-postbacks) in the general [Ad Partner Integration Guide](https://help.branch.io/marketer-hub/ad-partner-integration-guide-new.md).

## Import cost data

Moloco cost ingestion uses API authentication with a **Token** and **Account Id**. To find these credentials, open your Moloco **Ad Account Settings** and go to the **Report Partner Integration** tab. If you don't already have an integration, create a new one and select **Branch** to generate a Token. Contact your Moloco account manager if you need help locating the credentials.

In Branch, select **Partner settings** to open the **Manage account** dialog. Under **Cost Data Credentials**, enter your **Token** and **Account Id**, then select **Save**.

> **Note: cost data availability**
>
> Cost data is only available from the date the **Token** is created in Moloco. Data from before the Token's creation date cannot be backfilled.

## Create a Branch Ad Link

Create a Branch Ad Link to use in your Moloco campaigns. Branch uses the link to attribute clicks and impressions and deep link users into your app. Placing the Branch Ad Link in your Moloco campaign will resolve the **Clicks and Impressions: Needs Setup** status on the **Status** tab.

Follow [Create Ad Links](https://help.branch.io/marketer-hub/ad-links-new.md).

## Verify your data

After your integration is connected and events are flowing, you can verify data is reaching Branch and Moloco:

- **In Branch** [**Liveview**](https://app.branch.io/testing-and-monitoring/events): confirm that events from your app appear in real time. This is the fastest way to confirm SDK events are firing.
- **In Branch** [**Analysis dashboards**](https://help.branch.io/marketer-hub/analysis-dashboards-overview-new.md): review attributed installs and events where `Ad Partner Name = Moloco`. Cost data appears in cost-reporting views once ingestion is active. Allow up to 24 hours after setup for the first cost data to be pulled in.
- **In Moloco**: confirm that forwarded events are appearing in your Moloco attribution reporting.

## Data mappings

### Campaign data

Branch populates the following fields from Moloco campaign data.

| Branch field | Partner data |
| --- | --- |
| `~advertising_partner_name` | `"Moloco"` (static) |
| `~feature` | `"paid advertising"` (static) |
