Skip to main content

AppsFlyer MMP Integration

AppsFlyer MMP Integration

J
Written by Jorge Rubia

AppsFlyer MMP Integration

AppsFlyer is a Mobile Measurement Partner (MMP) that tracks installs and in-app events across ad networks and agencies. Integrating AppsFlyer with Aftrad lets you send traffic through your preferred ad networks and agencies and receive postback notifications directly into Aftrad when users install your app or complete in-app events.


Overview

The setup consists of four parts:

  1. Configure Ad Networks — register the ad networks (pid) you'll use to buy traffic

  2. Configure Agencies — register the agencies (af_prt) managing your campaigns (optional)

  3. Configure Handshakes — link agencies to ad networks to authorize traffic (optional)

  4. Configure the offer — select the MMP, assign ad networks and agencies, and set up tracking URLs


Part 1 — Configure Ad Networks

Go to Settings → Integrations → AppsFlyer → Ad network.

In AppsFlyer, an Ad Network is an external platform — such as Meta Ads, Google Ads, or TikTok for Business — where you buy and manage your advertising campaigns. You can learn more about what an Ad Network is in AppsFlyer in this video.

Click Create and fill in the form:

  • Partner ID (pid) (mandatory) — the unique identifier that AppsFlyer uses to recognise this ad network. Obtained from AppsFlyer.

  • Name (mandatory) — a descriptive name to identify this ad network within Aftrad.

  • Score (mandatory) — a numeric score used for internal ranking and reporting.

  • Enable click signing (optional) — AppsFlyer click signing is an anti-fraud security measure that cryptographically signs clicks before they are sent to AppsFlyer, verifying that each click is genuine, comes from an authorised source, and has not been tampered with. If enabled, you must provide the API token supplied by AppsFlyer for this ad network.


Part 2 — Configure Agencies

Go to Settings → Integrations → AppsFlyer → Agency.

In AppsFlyer, an Agency is an external company or service provider contracted to run, manage, and measure app marketing campaigns on behalf of an advertiser.

Click Create and fill in the form:

  • Agency ID (mandatory) — the af_prt value that identifies this agency in AppsFlyer. Obtained from AppsFlyer.

  • Name (mandatory) — a descriptive name to identify this agency within Aftrad.

  • Score (mandatory) — a numeric score used for internal ranking and reporting.

  • Enable report integration (optional) — when enabled, AppsFlyer reports can be imported into Aftrad. If enabled, you must provide the API token supplied by AppsFlyer.

Report integration is covered in a separate article. Once available, this section will be updated with a link.

Click Save.


Part 3 — Configure Handshakes

Go to Settings → Integrations → AppsFlyer → Handshakes.

A Handshake is an authorisation between an Agency (af_prt) and an Ad Network (pid). It confirms within AppsFlyer that a specific agency is permitted to run traffic using a particular ad network's integration. Without a handshake, the agency–ad network combination will not be recognised by AppsFlyer.

Click Create and select:

  • Agency — the agency you want to authorise

  • Ad network — the ad network the agency will use

Click Save. You can create as many handshakes as needed to cover all your agency–ad network combinations.


Part 4 — Configure the offer

CPI offers are the standard offer type for AppsFlyer integrations. Create or edit a CPI offer and go to General → Main setup.

App ID

Scroll to the app ID fields and fill in the identifier that matches your offer's platform:

  • iOS App Store ID — for iOS offers (e.g. id1359763701)

  • Android App ID — for Android offers

  • App/Bundle ID — for APK or other distribution types

MMP section

Scroll to the MMP section and select AppsFlyer from the dropdown.

Once selected, the AppsFlyer Ad networks & Agencies section appears below:

  • Ad Networks without Agency — enable the ad networks that will send traffic directly (without an agency). Toggle each ad network on or off individually.

  • Handshakes (Agency + Ad networks) — click + Add Agency to add an agency and its associated ad networks. Each handshake you configured in Part 3 will be available here.

Tracking URL and Impression URL

Aftrad automatically generates tracking and impression URLs based on the ad networks and agencies assigned to the Offer. The AppsFlyer URL check validates that all required parameters are present and correctly mapped.

The URLs are built using the following parameter mapping:

AppsFlyer parameter

Aftrad macro

Description

pid

{af_pid}

Uniquely identifies an AppsFlyer integrated partner

af_prt

{af_prt}

Agency identifier

clickid

{click_id}

Unique click ID — used by AppsFlyer to send postbacks back to Aftrad

af_sub_siteid

{aggregate_id}

Aggregated click ID (no dedicated AppsFlyer field; af_sub_siteid is the recommended mapping)

af_ip

{client_ip}

User IP

af_ua

{client_ua}

User agent

af_model

{af_model}

Device model

af_os_version

{af_os_version}

OS version

af_lang

{client_lang}

User language

advertising_id

{gaid}

Google Advertising ID (Android)

idfa

{idfa}

IDFA (iOS)

c

Campaign name (set manually in the offer URL)

af_siteid

Publisher identifier (set manually in the offer URL)

af_click_lookback

Attribution lookback window (set manually, e.g. 7d)

Click Save once the offer is configured.


Part 5 — Configure postbacks in AppsFlyer

Once the offer is live in Aftrad, you need to configure the postback URLs on the AppsFlyer side so that AppsFlyer notifies Aftrad of installs and in-app events. This is done from the integration management panel in your AppsFlyer account.

Use your Aftrad event domain URL as the base for both postback URLs:

https://[your-event-domain]/api/v1/events

Normal postback

In AppsFlyer, go to Integration management → Default postback.

Set the same URL for both Install postback URL and In-app event postback URL, and map the parameters as follows:

Install postback parameters:

AppsFlyer parameter

Your receiving parameter

Postback ID

click_id

In-app event postback parameters:

AppsFlyer parameter

Your receiving parameter

Sub site ID

aggregated_id

Postback ID

click_id

Event name

event_parameter

Event revenue USD

payout

Advanced privacy postback

In AppsFlyer, go to Integration management → Advanced privacy.

Set the same URL for both Install postback URL and In-app event postback URL, and apply the same parameter mapping as for the normal postback above.

Advanced privacy postbacks are used when AppsFlyer applies privacy aggregation (e.g. for iOS SKAdNetwork traffic). The parameter mapping is the same, but the data received may be aggregated rather than user-level.


Related articles

Did this answer your question?