> For the complete documentation index, see [llms.txt](https://support.gamoshi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.gamoshi.com/gamoshi-wiki/how-to-guides/how-to-integrate-appsflyer-for-gamoshi-dsp.md).

# How to integrate AppsFlyer for Gamoshi DSP

*Availability: DSP accounts and PE Enterprise accounts for DSP advertisers*

## Overview

This article explains how to integrate AppsFlyer app conversion tracking with a Gamoshi DSP account.

The integration allows Gamoshi to attribute app installs and in-app events, such as registrations and purchases, to specific clicks and campaigns for reporting and optimization.

AppsFlyer is available as a predefined template when creating an App Conversion in Gamoshi.

The integration uses a server-to-server attribution flow consisting of:

1. **Click Tracking:** Gamoshi redirects the user to the App Store or Google Play via an AppsFlyer tracking URL that includes Gamoshi macros.
2. **Conversion Tracking:** When an attributed event occurs, AppsFlyer sends a postback to Gamoshi using the Click ID passed in the tracking URL.
3. **View-Through Attribution:** AppsFlyer impression tracking can be enabled to attribute conversions that occur after an impression without a click.

***

## Integration Flow

{% stepper %}
{% step %}

### Create a Conversion in Gamoshi

{% endstep %}

{% step %}

### Create the required Goal or Goals

{% endstep %}

{% step %}

### Configure the AppsFlyer postback

Use the generated Conversion ID and Goal ID.
{% endstep %}

{% step %}

### Associate the Conversion

Associate the Conversion with the relevant Gamoshi creatives.
{% endstep %}

{% step %}

### Test the complete tracking flow

{% endstep %}
{% endstepper %}

***

## Required URL Templates

### Gamoshi Conversion Callback URL

AppsFlyer must trigger the following URL when a conversion event occurs:

```
https://rtb.gamoshi.io/conversion/ss-web-h?conv_id=CONVERSION_ID&goal_id=GOAL_ID&conv_value=CONVERSION_VALUE&ifa={Android Device ID}&order_id={AppsFlyer ID}&user_id={Customer user ID}&click_id={Click ID}
```

Replace CONVERSION\_ID and GOAL\_ID with the IDs generated in Gamoshi.

The Conversion Value macro can also be replaced when required.

### AppsFlyer Click URL

Use the following URL as the Target URL in Gamoshi:

```
https://app.appsflyer.com/{app_id}?pid=gamoshiid_int&af_siteid=[PUBLISHER_ID]&af_c_id=[CAMPAIGN_ID]&af_ad_id=[AD_ID]&af_ad_type=[AD_TYPE]&af_channel=[INVENTORY_ID]&clickid=[REQ_ID]&advertising_id=[IFA]&af_model=[DEVICE_MODE]
```

Replace {app\_id} with the identifier of the advertised application:

| **Operating system** | **App identifier format** | **Example**     |
| -------------------- | ------------------------- | --------------- |
| iOS                  | App Store ID              | id123456789     |
| Android              | Application package name  | com.company.app |

#### iOS Example

```
https://app.appsflyer.com/id123456789?pid=gamoshiid_int&af_siteid=[PUBLISHER_ID]&af_c_id=[CAMPAIGN_ID]&af_ad_id=[AD_ID]&af_ad_type=[AD_TYPE]&af_channel=[INVENTORY_ID]&clickid=[REQ_ID]&advertising_id=[IFA]&af_model=[DEVICE_MODE]
```

#### Android Example

```
https://app.appsflyer.com/com.company.app?pid=gamoshiid_int&af_siteid=[PUBLISHER_ID]&af_c_id=[CAMPAIGN_ID]&af_ad_id=[AD_ID]&af_ad_type=[AD_TYPE]&af_channel=[INVENTORY_ID]&clickid=[REQ_ID]&advertising_id=[IFA]&af_model=[DEVICE_MODE]
```

## Creating a Conversion in Gamoshi

{% stepper %}
{% step %}

### Open the Conversion Creation Form

1. Create a new Advertiser or select an existing one.
2. Navigate to **Advertisers Module > Conversions**.
3. Open the Conversion Creation Form.
   {% endstep %}

{% step %}

### Configure the Conversion

Complete the following fields:

| **Field**                         | **Configuration**                                                                             |
| --------------------------------- | --------------------------------------------------------------------------------------------- |
| Conversion Name                   | Enter a clear name, such as Mobile App Install.                                               |
| Advertiser                        | Select the relevant Advertiser.                                                               |
| Type                              | Select **App**.                                                                               |
| Third-Party Tracking Provider     | Select **AppsFlyer**.                                                                         |
| View-Through Attribution          | Choose whether to enable impression-based attribution. It is enabled by default.              |
| App Bundle ID                     | Enter the application identifier, such as 162465287 for iOS or com.example.myapp for Android. |
| Maximum Conversions per Device ID | Define the maximum number of daily conversions allowed for each Device ID.                    |

After AppsFlyer is selected, the following fields are populated automatically:

* **Click URL (Target URL).**
* **VTA Impression Tracker URL.**
  {% endstep %}

{% step %}

### Create the Conversion

Click **Create**.

The platform creates the Conversion and generates its **Conversion ID**.

Record this ID for the AppsFlyer postback configuration.
{% endstep %}
{% endstepper %}

***

## Creating Goals

Goals represent the individual events tracked under a Conversion. They are used for reporting and algorithmic optimization.

A default **Click to Install** Goal is created automatically when you create the Conversion.

To track additional AppsFlyer events:

1. Add a Goal for each required event, such as:
   * Registration.
   * First Deposit.
2. Select a predefined event or select **Custom**.
3. Click **Save**.

The platform creates the Goal and generates its **Goal ID**.

Record the Goal ID for the corresponding AppsFlyer postback.

***

## Configuring the AppsFlyer Postback

{% stepper %}
{% step %}

### Open the Integration

In AppsFlyer:

1. Navigate to **Active Integrations**.
2. Search for Gamoshi or use the custom Partner configuration.
3. Open the postback configuration for the required event.
   {% endstep %}

{% step %}

### Map the Postback URL

In the Gamoshi Conversion Callback URL:

* Replace CONVERSION\_ID with the Conversion ID generated in Gamoshi.
* Replace GOAL\_ID with the Goal ID generated in Gamoshi.
* Replace the Conversion Value when required.
  {% endstep %}
  {% endstepper %}

### Example

Using the following values:

| **Parameter**         | **Example value** |
| --------------------- | ----------------- |
| Gamoshi Conversion ID | 1001              |
| Gamoshi Goal ID       | 2005              |
| Conversion Value      | 1                 |

The resulting postback URL is:

```
https://rtb.gamoshi.io/conversion/ss-web-h?conv_id=1001&goal_id=2005&conv_value=1&ifa={Android Device ID}&order_id={AppsFlyer ID}&user_id={Customer user ID}&click_id={Click ID}
```

***

## Associating the Conversion with Creatives

{% stepper %}
{% step %}

### Open the Creative

Create or edit the relevant creative from either:

* **Advertisers Module > Advertiser Setup > Creatives**, or
* The central **Creatives** screen.
  {% endstep %}

{% step %}

### Select the Conversion

In the creative’s **Conversion and Tracking** section:

1. Select the **Select Conversion** option.
2. Choose the required Conversion from the list.
3. Enable **Use Conversion/Postback Target URL**. This switch is enabled by default.
4. Confirm that the AppsFlyer Target URL and Impression Tracking URL are displayed.
5. Save the creative.
   {% endstep %}

{% step %}

### Associate the Creative with a Campaign

Create the required Campaigns for the Advertiser and associate them with the relevant creatives.
{% endstep %}
{% endstepper %}

***

## End-to-End Validation

Before scaling the Campaign, validate that the integration is complete.

### Click Check

Click the ad and confirm that it redirects to the correct App Store or Google Play page.

### Macro Check

Review the Gamoshi click logs and confirm that the following values are passed correctly:

* \[REQ\_ID]
* \[IFA]

### Postback Check

Trigger the configured conversion event on a test device.

### Reporting Check

Confirm that the Conversion appears in the Gamoshi dashboard under the correct Campaign and Goal.

***

## Best Practices

* **Use one Goal for each event:** Maintain a one-to-one relationship between AppsFlyer events and Gamoshi Goals.
* **Use consistent names:** Match the Gamoshi Goal names with the corresponding AppsFlyer event names.
* **Test with a physical device:** Verify the redirect and postback flow using a real device.

***

## Related articles

* [How to Implement Conversion Tracking](/gamoshi-wiki/how-to-guides/how-to-implement-conversion-tracking.md)
* [How to Set Up Postback Conversion Tracking](/gamoshi-wiki/how-to-guides/postback-conversion-tracking.md)
* [How to Implement Third-Party Pixel Tracking](/gamoshi-wiki/how-to-guides/how-to-implement-third-party-pixel-tracking.md)
* [How to create a Creative](/gamoshi-wiki/how-to-guides/how-to-create-a-creative.md)
