Attribution link structure and parameters

At a glance:  Learn about the AppsFlyer attribution link structure and parameters.

Overview

Attribution links allow advertisers to collect data about user engagement with an ad. Attribution links are placed behind ads and notify AppsFlyer when users engage with an ad. The engagement can occur via a click on an ad or when a user views an ad impression. A copy of the attribution URL is sent to AppsFlyer.

Attribution links are generated using OneLink or a single-platform link.

  OneLink (multi-platform link) Single-platform link

Description and when to use

Use when:

  • You want a single link for all platforms.
  • Deep linking capabilities are required.
  • You want to use Android App Links or iOS Universal Links to open the app.

Learn more about OneLink

Use when:

  • You only use a single platform. For example, Android and not iOS.
  • You only use URI schemes to open the app.

Learn more on how to set up an integrated partner

Prerequisites

OneLink template

None

Mandatory information

Base URL

{subdomain}.onelink.me

app.appsflyer.com

Unique identifier

Template ID

app_id

URL structure https://{subdomain}.onelink.me/
{templateid}&pid{media_source}
&af_siteid={ApplicationID}
&c={CampaignName}

https://app.appsflyer.com/{app_id}?pid={media_source}&af_siteid={ApplicationID}&c={CampaignName}

Example https://yourbrand.onelink.me/aAB1?pid=greatnetwork_int
&c=GreatCampaign&af_siteid=A1b1
https://app.appsflyer.com/com.greatapp?pid=greatnetwork_int&
c=GreatCampaign&af_siteid=A1b1

Attribution link parameters

  • The parameters listed are available for use in the attribution link.
  • The value field type column is the character limit of the parameter value. Find more about limitations on the length of parameter values here.

Attribution link parameters—UA and retargeting

The following table can be downloaded as a .csv file.

Parameter Display name in raw data Description

Field type and length

pid Media Source Uniquely identifies an AppsFlyer integrated partner. Don't change it. More details.

String 150

c Campaign Provided by the advertiser or the publisher. See limits on campaign names.

String 100

af_prt

Partner

  • Agency Account Name enables attributing installs to the agency
  • Caution: Don't use this parameter before ensuring that Agency Permissions are enabled

String 50

af_mp

N/A
  • Enable sending postbacks to publisher marketing partners per install.
  • Note: Currently, this parameter is relevant only for Pinterest Marketing Partners.

 

clickid

N/A

Ad network unique click identifier

 

af_siteid

Site ID

  • Unique ID that identifies the publisher that displays the ad. Learn more

String 24

af_sub_siteid

Sub Site ID

  • Ad sub-network/Publisher ID. 
  • If in addition to the main publisher (site ID), there is a sub-publisher, or you want to include additional info, such as ad type/placement within the app, like banner, interstitial, video, etc. use af_sub_siteid. For example: af_sub_siteid =ABCD_4567

String 50

af_c_id

Campaign ID

Provided by the advertiser/publisher

String 24

af_adset

Adset

  • Provided by the advertiser/publisher.
  • Adset is an intermediate level in the hierarchy between Campaign and Ad. See more

String 100

af_adset_id

Adset ID

Provided by the advertiser/publisher

String 24

af_ad

Ad

Ad Name (see more) provided by the advertiser/publisher

String 100

af_ad_id

Ad ID Provided by the advertiser/publisher

String 24

af_ad_type

Ad type

 Use the following naming convention:

  • text: an ad unit containing only text, for example a search result
  • banner: a basic format that appears at the top or bottom of the device screen
  • interstitial: a full-page ad that appears during breaks in the current experience
  • video: a standard video, that is non-rewarded
  • rewarded_video: an ad unit offering in-app rewards in exchange for watching a video
  • playable: an ad unit containing an interactive preview of the app experience
  • sponsored_content: a link included in a piece of sponsored content, like an advertorial article
  • audio: an audio ad

String 24

af_click_lookback

Attribution lookback window

  • Lookback Window for Click Attribution. This window's duration is the maximum CTIT (Click Time to Install) for the new user to be attributed to the source displaying the ad/link.
  • Configurable number of days for the lookback click attribution period. Available parameter values: 1d - 30d (days) OR 1h-23h (hours). The default value is 7d.
  • The lookback window can be customized for OneLinks and SRNs.

Note: Only affects click URLs and not impression URLs.

3 char max

af_viewthrough_
lookback

N/A

  • Configurable number of hours for the lookback view-through attribution period. Available parameter values: 1h - 24h (hours). The default is 24h.
  • The lookback window can be customized for SRNs.

Note: Only affects impression URLs and not click URLs

3 char max

af_channel

Channel

The media source channel through which the ads are distributed, for example, UAC_Search, UAC_Display, Instagram, Meta Audience Network, etc.

Dynamic Enum. String 20

af_keywords

Keywords

Keywords list for text-targeted campaigns

String 100

af_cost_model

Cost model

  • Cost model, CPI (default) is currently the only supported model when reporting cost by click, which populates cost value in AppsFlyer aggregated data reports.
  • Where possible, report cost by API. In cases where cost is reported by on the link and by API - API has priority.

String 20

af_cost_currency

Cost currency

  • 3 letter currency code compliant with ISO-4217. For example, USD, ZAR, EUR
  • [Default]: USD

Enum. 3 char 

af_cost_value

Cost value

  • Cost value in using cost currency.
  • Up to 4 digits after the decimal point.
  • Set ONLY numerical digits (use a decimal point if needed) Example: "56", "2.85"

String 20

af_sub[n] 

(n=1-5) example: af_sub1

Sub param [n]

Optional custom parameter defined by the advertiser. For more information about the usage of these parameters, check the FAQ section.

String 100

af_r N/A

Used in single-platform links to redirect users to the specified URL for both platforms (Android and iOS).

  • Overrides the following template-level parameters:
    • android_custom_url
    • ios_custom_url
 
af_web_dp N/A

URL to redirect desktop (for example, Windows or Mac) users to a different web page than configured in the OneLink template. Use this to keep attribution data of desktop users on other platforms (for example, Google Analytics or Omniture)

Note: If you have an active Redirect allowlist, ensure the domain of this URL is in the list.

 
af_dp N/A The URI scheme fallback value to launch the app, to be used if the Universal Link or Android App Link method fails, and for Android users below 6.0. It should only point to the base path, i.e. the default activity.  
af_force_deeplink N/A Force deep linking into the activity specified in af_dp value  
af_ref N/A
Ad networks working with S2S clicks can send a unique referrer value using the following parameter: &af_ref=ReferrerValue
The af_ref value must consist of a unique value, structured as follows:
NetworkName_UniqueClickValueForEachClick
Example: af_ref=networkname_123456789ABCDEF
 
The network name can be any valid string. It can be networkname_int or just network name.
 
AppsFlyer may use this parameter for attribution in Android devices. AppsFlyer doesn't use this parameter for attribution in iOS or Windows devices.
 
is_incentivized N/A
Boolean: true/false
Incentivized or non-incentivized campaigns
 
af_param_forwarding N/A
  • When set to false, parameters that are on the attribution link are not forwarded to the redirected page.
  • Use this for a cleaner looking URL in the redirected page, or if attribution link parameters might cause issues due to query parameter handling on the redirected page.
 
af_base_params_forward N/A
  • When set to false, AppsFlyer PID and C parameters that are on the attribution link are not forwarded to the redirected page.
  • Use this if the URL is going to be clicked from a desktop and you want essential CRM parameters to remain but the AppsFlyer PID and C parameters to be removed. This will avoid having multiple PIDs in the URL.
 
af_partner_account_id Network Account ID Advertiser's account ID with the partner String 100
redirect N/A When&redirect=false, this parameter lets AppsFlyer know that this is an S2S click and that the partner is responsible for redirecting the user that clicked.  
af_ua User-agent

Relevant for ad networks that send clicks and impressions server-to-server.

The user-agent string sent as:

  1. URL parameter (URL-encoded)
  2. HTTP request header (unencoded)

The User-Agent should be identical in both the URL parameter and the HTTP header.

Note: In Android, the user-agent is sometimes reduced do to Client Hints. It should be sent regardless.

  • Example of full user-agent: Mozilla/5.0 (Linux; Android 12; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.16 Mobile Safari/537.36
  • Example of reduced user-agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.0.0 Mobile Safari/537.36
 
af_ip IP

Relevant for ad networks that send clicks and impressions server-to-server.

Device IP address

Recommended: If available, provide the device IP under the af_ip parameter.

Next option: If available, AppsFlyer will use the IP in X-Forwarded-For.

 
[Deprecated] af_os OS version

[For iOS only] The device operating system version.

This parameter is deprecated but still supported by AppsFlyer. Recommended: Use the af_os_version parameter instead. 

 
af_os_version OS version
  • Relevant for ad networks that send clicks and impressions server-to-server.
  • The device operating system version.
    • Android:
      • Example: 12
      • For reduced user-agent (due to browsers running on desktop or Android and using the Chrome 110+ engine), the ad network must use the Client Hints API to get this value.
      • For user-agent that isn’t reduced, use the following regex to extract the Android OS version from the user-agent string: (\d+(?:\.\d+)*);(?:\s..-..;)?\s(.+?(?=\)|\s\w*\/)).
    • iOS:
      • Example: 16.2
 
af_model Device model
  • Relevant for ad networks that send clicks and impressions server-to-server.
  • The device model.
    •  Android:
      • Example: Pixel 5
      • For reduced user-agent (due to browsers running on desktop or Android and using the Chrome 110+ engine), the ad network must use the Client Hints API to get this value.
      • For user-agent that isn’t reduced, use the following regex to extract the Android model from the user-agent string: (\d+(?:\.\d+)*);(?:\s..-..;)?\s(.+?(?=\)|\s\w*\/)).
    • iOS:
      • Either iphone or ipad (all lowercase)
 
af_media_type Media type

Placement of the ad carrying the link as follows:

  • app: The link is available via an app
  • web: The link is available within a mobile website
 
deep_link_sub1-10 N/A

Additional deep link values. Developers implement the desired behavior of the values in the code.

 
deep_link_value N/A

The name for the specific in-app content that users will be directed to. Developers implement the desired behavior of the deep_link_value in the code. 

 
af_og_title N/A

When a link is posted to social media, open graph (OG) title will generate a preview of the title.

String 40
af_og_description N/A

When a link is posted to social media, open graph (OG) description will generate a preview of the description.

String 300
af_og_image N/A

When a link is posted to social media, open graph (OG) image will generate a preview of the image.

 

Attribution link parameters—retargeting only

Parameter Display name in raw data Description

Field type and width

is_retargeting

Is Retargeting (campaign)  The click URL of all retargeting campaigns must include &is_retargeting=true.
If the parameter is not included or its value is "false," the campaign is considered as a regular user acquisition campaign.

Enum 5 char

af_reengagement_window

Re-engagement window

Change the re-engagement attribution window by adding this parameter to the attribution link.

The possible window range options are:

  • Days: 1-90 or Hours 1-36
  • Lifetime: This means the re-engagement window is unlimited. Example: &af_reengagement_window=lifetime

Default value: 30 days

Example: &af_reengagement_window=30d sets the re-engagement window to 30 days.

N/A

Ad type parameters

Depending on the ad type, you can also send the relevant viewability parameter detailing the specifications of the engagement. Below is a list of possible values for “af_ad_type” along with the expected viewability parameters.

Ad type (af_ad_type)

Parameter Value format Description
af_video_total_length seconds The total possible duration of the video
af_video_played_length seconds How much of the video was viewed
af_playable_played_length seconds How long the playable element was played once fully loaded
af_ad_time_viewed seconds How long the ad unit was visible on the screen
af_ad_displayed_percent % The maximum percentage of the ad unit that was visible on the device screen
af_audio_total_length seconds The total possible duration of the audio
af_audio_played_length seconds How much of the audio was heard

Android-specific parameters

Parameter Display name in raw data Description

Field type

advertising_id

Advertising ID

Google Advertising ID - Requires ad network support

40 char max

sha1_advertising_id

N/A

Google Advertising ID hashed with SHA1 - Requires ad network support

 

md5_advertising_id

N/A

Google Advertising ID hashed with MD5 - Requires ad network support

Supported with installs and re-attributions only

android_id

Android ID

Device Android_id - Requires ad network support

20 char max

sha1_android_id

N/A

Device Android_id hashed with SHA1 - Requires ad network support

 

md5_android_id

N/A

Device Android_id hashed with MD5 - Requires ad network support

Supported with installs and re-attributions only

imei

IMEI

Device IMEI ID

 

sha1_imei

N/A

Device IMEI ID hashed with SHA1 - Requires ad network support

 

md5_imei

N/A

Device IMEI ID hashed with MD5 - Requires ad network support

 

oaid

OAID

Open Anonymous Device Identifier

Available as of Android SDK version 4.10.3

sha1_oaid

N/A

Open Anonymous Device Identifier hashed with SHA1 - Requires ad network support

Available as of Android SDK version 4.10.3

md5_oaid

N/A Open Anonymous Device Identifier hashed with MD5 - Requires ad network support Available as of Android SDK version 4.10.3

af_android_url

N/A

Redirect Android users to a different URL than the app page on Google Play. Use for third-party app stores.

Note: If you have an active Redirect allowlist, ensure the domain of this URL is in the list.

 

sha1_el

N/A

Used for desktop to mobile attribution - email hashed with SHA1. Requires ad network support

 

fire_advertising_id

N/A

Amazon Fire Advertising ID

 

af_android_store_csl

store_product_page

Custom store listing in Google Console

string

iOS-specific parameters

Parameters Display Name Description

idfa

IDFA

Use upper case. Requires ad network support

Field type: 40 char max

idfv

IDFV Use upper case. 

af_ios_url

 

Use this for landing page redirections to redirect iOS (iPhone or iPad) users to a different URL than the app page on iTunes

Note: If you have an active Redirect allowlist, ensure the domain of this URL is in the list.

af_ios_store_cpp store_product_page

Custom product page ID (ppid)

af_ios_fallback [deprecated]

N/A

Deprecated: Users are redirected based on the iOS URI scheme flow

sha1_idfa

N/A

IDFA hashed with SHA1. Requires ad network support

sha1_idfv

N/A

IDFV hashed with SHA1

mac

N/A

Device mac address. Requires ad network support

md5_idfv

N/A

IDFV hashed with MD5

sha1_mac

N/A

Device mac address hashed with SHA1. Requires ad network support

 Example

https://app.appsflyer.com/{app_id}/?pid=airpush_int&c=RedBanner&
	  af_siteid={publisher_id}&af_sub1=1.5&af_sub2=USD&af_sub3=burst_campaign

All parameters are available in the Install report and the Analytics, Reports, and APIs.

Custom parameters

In addition to default Android-specific and iOS-specific parameters, you can also specify custom parameters. These custom parameters can help you if you wish to customize the user experience and content according to the attribution link that leads to an install.

You can append custom parameters to the attribution link in the format parameter=value. For example:

https://app.appsflyer.com/com.greatapp?pid=networkx_int&c=winter&af_adset=coats&af_ad=cashmere&my_custom_param=my_custom_value

Two important things to know about custom parameters:

Partner ID (PID) parameter

Among all available attribution link parameters, PID is mandatory. The PID is the unique identifier of the media source allocated by AppsFlyer. 

Each integrated partner has their own unique PID value. The PID ends with the _int suffix. When using OneLink links you can set the PID to any value you prefer, as long as it's not reserved by an integrated partner. To avoid a conflict, don't use the _int suffix. 

Examples of important integrated publisher IDs: organic, googleadwords_int (Google AdWords), Meta ads, and Twitter. You can use any name for non-integrated sources like email, SMS, or mail pigeons.

Avoid common PID issues:

  • Always include PID in your attribution links. Without the PID on the attribution link, the user is automatically attributed to a "None" media source and the original installation source is gone.
  • For Custom Sources, use non-integrated partner PIDs. For each integrated source, use only the designated PID for the correct attribution of its installs. For any custom media source, such as email, SMS, or even viral unpaid posts on Facebook use other, non-integrated PID values.
  • Use only legal characters. If the PID parameter in the Attribution Link contains one of the following characters /<>*&?\
    • The click or install appears in the dashboard under af_invalid_param
    • Attribution links will not be attributed
    • Deep linking capabilities will not work on clicks

 Tip

Avoid using white spaces in the PID value, or make sure to URL encode your attribution links before using them.

Site ID parameter

The site ID is the unique identifier of the publisher serving the ad. In other words, the website or app displaying the ad. Ad networks allocate unique site IDs for each publisher. 

This ID is included in the af_siteid parameter passed to AppsFlyer in the attribution link and is made available via the various dashboards, reporting options, and postbacks. 

The site ID must be passed to AppsFlyer in the attribution link because it:

  • Provides clarity and transparency about the publisher
  • Is used by AppsFlyer to identify and eliminate fraudulent publishers, and other traffic clusters.

The site ID parameter only includes the ID of the publisher that serves the ad.

To include additional information, such as ad type, placement, or both within the app, for example, banner, interstitial, or video, use the sub-site ID parameter.

 Example

The following attribution link includes:

  • af_siteid (site ID): Publisher ID
  • af_sub_siteid (sub-site ID): Additional ID info (in this case, an affiliate source and ad type placement)
https://app.appsflyer.com/com.yourapp?pid=mediaName_int&clickid={clickid}&advertising_id={gaid}&af_siteid=1234&af_sub_siteid=ABCD_4567

In the example link:

  • 1234 = Publisher ID
  • ABCD = Affiliate source (sub-publisher) that the publisher is working with
  • 4567 = Ad type placement within the app, such as banner, interstitial, or video

FAQ: Why does traffic result in many blocked installs?

Blocked installs can be due to the following:

  • Missing site ID: The af_siteid parameter is empty in the click URL. Engagements sent with an empty Site ID signify either a technical issue or an intentional attempt to bypass fraud detection mechanisms.
  • Multiple site IDs: The same publisher is sent on multiple click URLs, using different site IDs. This is considered fraudulent behavior that masks the real publisher activity and is often associated with click flooding.
  • Site ID formatted incorrectly: Sending the wrong format, combined with other fraud indications, could result in blocking not only the specific publisher, but also of a higher cluster level, and might impact greater volumes of the partner activity.

To avoid blocked installs, make sure you send a single site ID parameter per publisher, as shown in the example.

Levels of data granularity

You can use up to four URL parameters to deep dive into your ads' performance.

Using all 4 parameters on all your active attribution links enables you to:

  • Attribute all user installs and events to specific ads
  • Drill down and compare the performance of all your ads per ad set, per campaign, and per media source on aggregated reports to optimize on every level
  • Compare all of your ads across all media sources on the raw data reports and Pivot table

The parameters are:

  • Media source (pid=)
  • campaign name (c=)
  • Ad set (af_adset=)
  • Ad name (af_ad=)

 Example

The following attribution link uses 4 levels of granularity to record the "cashmere" ad in the "coats" ad set in the "winter" campaign running on the integrated "network" media source.


https://app.appsflyer.com/com.greatapp?pid=networkx_int&c=winter&
af_adset=coats&af_ad=cashmere

Traits and limitations

Trait Remarks
Special characters

The following special characters are not allowed in parameter or values: ;, *, !, @, #, ?, $, ^, :, &, ~, `, =, +, ’, >, <, /, {, }, %

URL character limit

Total URL length must not exceed 2000 characters

Facebook Deeplinking redirection

Due to recent changes in Facebook's redirection logic, users of Android's Facebook v420+ WebView will now be redirected to the Play Store instead of their previously installed application. 

FAQ

Should I use lower or upper case letters for parameters

You can use either, but you must be consistent. If you set a custom parameter with upper or lower case characters, make sure always to use that parameter.

For example, if you set pid=MyMediaSource, make sure always to use it. If you use pid=MyMediaSource on one attribution link and pid=mymediasource on another, discrepancies in data might occur. The same goes for any other param that you set on the attribution link.

Is the AppsFlyer attribution link dynamic or static?

Attribution links can be dynamic or static.
How can you tell if a link is dynamic or static?
If the attribution link contains parameters, it's a long pre-defined attribution link, and therefore static.
Only short URLs (for example, yourbrand.onelink.me/HaT8/r5c2b371), used for custom attribution links, are dynamic.
This means that once you start using an attribution link for an integrated partner, or a long URL for owned media, it would not change for any leads engaging with it, even if you change the attribution link values in the AppsFlyer dashboard. For the change to take place, you must use the new long URL going forward.
On the other hand, short URLs for owned media, don't directly contain parameters. When a lead engages with an AppsFlyer short URL, the lead is redirected to AppsFlyer and the current set parameters take place dynamically.

What is this Play Store error message?

If you ever encounter the following error message in the Play Store after following an attribution Link:

TL_error_message.png

This is because the attribution link includes a # character. For example:
https://app.appsflyer.com/com.travelco?pid=globalwide_int&clickid=#reqid#

Usually, these characters are in the link because they are macros, and are dynamically replaced by a value, so it is not a really big problem and you can ignore the message.

What are subscriber parameters good for?

The Subscriber Parameters, meaning af_sub1, af_sub2, ..., af_sub_5 can be used to record any useful KPIs. These parameters get parsed and appear in the raw data report, which makes them very handy for performing data aggregation or filtering.

 Example

A hail ride app, Luber, has creatives with 3 color templates: blue, yellow, and red. Luber's mobile marketer, Linda, wants to test which color template brings in more installs. To do so she adds &af_sub3=blue in the attribution links of all the blue ads across ALL non-SRN media sources. The same is done for the yellow and red ads as well. With this information parsed and appearing in the raw data reports, Linda is able to analyze the success of the different colored ads and pick the best converting one.

What limits are there on campaign names?

  • The maximum length of a campaign name in the attribution link URL is limited to 100 characters. If exceeded, the campaign name is changed to: c_name_exceeded_max_length
  • The campaign name shouldn't start from or end with a white space, as it may cause discrepancies in dashboards and reports