Tracking & Attribution

How to Create Attribution Links and OneLinks in AppsFlyer

Every parameter in an AppsFlyer link, what it does, and how to build links that attribute correctly the first time.

ClickSpero Editorial TeamUpdated 4 min read

An AppsFlyer attribution link records a click or impression for a specific media source and campaign, so the install that follows can be credited correctly. There are two main forms: OneLink links, which use your branded subdomain and can deep-link users into the app across platforms, and direct links on app.appsflyer.com for a single app. Both carry the same core parameters.

https://{subdomain}.onelink.me/{templateID}?pid={media_source}&c={campaign}
https://app.appsflyer.com/{app_id}?pid={media_source}&c={campaign}
  • OneLink works for Android and iOS from one URL, routes users to the right store or into the app if installed, and supports deep linking.
  • Direct links use the app ID (Android package name or id + iOS App Store ID) and are often used by ad networks for one platform.

AppsFlyer accepts engagement traffic over HTTPS only.

The parameters that matter

ParameterMeaningNotes
pidMedia sourceFor integrated partners this is a fixed partner ID (often ending in _int). Do not change it. Max 150 characters.
cCampaign nameMax 100 characters. Keep names consistent.
af_siteidPublisher / site IDIdentifies the sub-publisher. Max 24 characters.
af_sub_siteidSub-site IDSecond level of publisher detail.
af_c_idCampaign IDUseful when names change.
af_adset, af_adAd set and ad namesFor creative-level reporting.
af_sub1 … af_sub5Custom valuesFree fields, often used for click IDs.
clickidPartner click IDReturned in postbacks so the partner can match conversions.
af_click_lookbackClick lookback windowFor example 7d, within allowed limits.
af_prtAgency account IDIdentifies the agency running the campaign.
deep_link_value, deep_link_sub1…Deep link dataTells the app which screen or content to open.

Parameter names are not case sensitive, but values should be consistent — Summer_Sale and summer_sale are different campaigns in reports.

  1. Open the partner in your integrations (Collaborate / partner marketplace).
  2. Activate it and configure postbacks.
  3. Open the partner's attribution link tab. AppsFlyer generates the link with the partner's pid and the partner's macros already in place — for example clickid={click_id} and af_siteid={pub_id}, using the partner's macro names.
  4. Add your campaign name (c) or let the partner fill it.
  5. Copy the click URL (and impression URL if the partner supports view-through) and share it with the partner.

The partner's platform replaces its macros with real values on every click.

For owned media, influencers, email, QR codes or web-to-app banners:

  1. Create a OneLink template (one per app or app pair): set the subdomain, store fallbacks and deep linking behaviour.
  2. Create links from the template, choosing a media source name (for example email, influencer, qr) and campaign.
  3. Add deep_link_value if users should land on a specific screen.
  4. Shorten the link if needed and test it on Android and iOS.

Use your own media source names for owned channels; reserve integrated partner pid values for the partners themselves.

When an agency runs a campaign, the link includes the agency's account ID in af_prt. The advertiser must allow the agency and, since 2024, ad networks must allowlist agencies that run through their integration — see AppsFlyer for agencies and advertisers.

  1. Register your test device in AppsFlyer.
  2. Click the link on the device and install the app fresh.
  3. Open the app and check the install in the dashboard under the right media source, campaign and site ID.
  4. If you use deep linking, check that the app opens the right screen both for new installs (deferred deep linking) and existing users.

Common mistakes

  • Changing an integrated partner's pid — the install will not be attributed to that partner and postbacks will not fire.
  • Spaces or special characters in campaign names — URL-encode them or use underscores.
  • Missing click ID — the partner cannot match conversions; always pass it in the field the partner expects.
  • HTTP instead of HTTPS.
  • Using one link for every partner — every source needs its own pid or media source name.

FAQ

What is pid in AppsFlyer?

pid is the media source parameter. For integrated partners it is a fixed ID assigned by AppsFlyer; for owned channels you choose a name.

OneLink is a branded, cross-platform link with routing and deep linking. A regular (direct) link points to one app on one platform. Both support attribution parameters.

Use the partner's clickid parameter (or an af_sub field if agreed) and fill it with the partner's or tracker's click ID macro.

Yes. OneLink is designed for routing web, email, social and offline traffic into the app and attributing the resulting installs.

Sources

Published 25 October 2026 by the ClickSpero Editorial Team. Platform features, fees and policies change often — check the provider’s current terms before you rely on a number. Third-party names are trademarks of their owners; no endorsement is implied.

Work with ClickSpero

Reading is free. So is the first conversation.

Advertisers get campaigns paid on attributed events. Publishers get offers with written terms.

Begin the conversation →