Tracking Links

Capture click IDs from ad campaigns, detect the ad network, and redirect users to the app store.

  • Capture click IDs -- extract fbclid, gclid, or ttclid from the URL query string
  • Detect the ad network -- identify the source based on click ID presence, utm_source, or link defaults
  • Record the click -- store the click for later attribution matching
  • Redirect to app store -- send the user to the App Store or Play Store listing
Tracking Link Format
https://your-domain.com/api/c/{linkId}

Create tracking links in the AppRefer dashboard under the Links page for your app.

Query Parameters#

ParameterSourceDescription
fbclidMeta (Facebook)Facebook click identifier
gclidGoogle AdsGoogle click identifier
ttclidTikTokTikTok click identifier
campaign_idAll networksCampaign identifier
campaign_nameAll networksCampaign name (shown in dashboard)
adset_id / adgroup_idAll networksAd set / ad group identifier
adset_name / adgroup_nameMeta / TikTokAd set / ad group name
ad_idMetaIndividual ad identifier
ad_nameMetaIndividual ad name
utm_sourceAnyTraffic source name
utm_mediumAnyTraffic medium (cpc, cpm, etc.)
utm_campaignAnyCampaign name (fallback if campaign_name missing)

Network Detection Priority#

  1. Click ID presence -- fbclid = Meta, gclid = Google, ttclid = TikTok
  2. utm_source -- fallback if no click ID is present
  3. Link default -- the network configured on the link itself

Ad Campaign Setup#

All ad platforms require the base URL and tracking parameters in separate fields. Copy each from the Links page in your dashboard.

Meta — paste in Website URL
https://apprefer.com/api/c/your_meta_link
Meta — paste in URL Parameters
fbclid={{fbclid}}&campaign_id={{campaign.id}}&campaign_name={{campaign.name}}&adset_id={{adset.id}}&adset_name={{adset.name}}&ad_id={{ad.id}}&ad_name={{ad.name}}
Google — paste in Final URL
https://apprefer.com/api/c/your_google_link
Google — paste in Final URL Suffix
campaign_id={campaignid}&campaign_name={campaignname}&adgroup_id={adgroupid}&keyword={keyword}
TikTok — paste in Destination URL
https://apprefer.com/api/c/your_tiktok_link
TikTok — add as Custom Parameters
campaign_id=__CAMPAIGN_ID__&campaign_name=__CAMPAIGN_NAME__&adgroup_id=__AID__&adgroup_name=__AID_NAME__

Macro Syntax Varies by Network

Each ad network uses a different syntax for dynamic macros. Meta uses {{fbclid}}, Google uses {gclid}, and TikTok uses __CLICKID__. These are replaced with actual values by the ad platform at serve time.

AppRefer can auto-create default tracking links for Meta, Google, and TikTok with your configured App Store and Play Store URLs. Enable this in the Links page to get started quickly without manual link creation.