AppsFlyer Deep Link Button

For mobile teams using AppsFlyer OneLink for install attribution and deferred deep linking. You'll have a success-page button that hands off paid users to OneLink with funnel context already encoded as conversion parameters. You need an AppsFlyer account with a OneLink template configured.

What this component does#

The AppsFlyer Deep Link Button is a variant of the standard Deep Link Button that integrates with AppsFlyer's OneLink Smart Script. On mount it loads the Smart Script from onelinksmartscript.appsflyer.com. On click it builds a OneLink config from your destination URL and parameters, then calls AF_SMART_SCRIPT.generateOneLinkURL() to produce a click URL that AppsFlyer can attribute.

If the Smart Script fails to load or returns an invalid URL, the button falls back to appending the same parameters directly to the destination URL.

Setup#

  1. Drop the AppsFlyer Deep Link Button onto the success page from the component palette.
  2. In the Destination URL field, paste your OneLink template URL. You can include pid and c query params on this URL — they become the OneLink campaign's media source and campaign name.
  3. Configure built-in parameters and OneLink parameters as needed (sections below).
  4. Inside your mobile app, read the conversion parameters from AppsFlyer's onConversionDataSuccess callback and route the user accordingly.

Built-in parameters#

Same nine fields as the standard Deep Link Button — Funnel ID, Organization ID, Campaign ID (default key af_c_id), Experiment ID, Email, App User ID, Stripe Customer ID, Meta FBP, Meta FBC. All disabled by default; toggle on the ones your app needs.

When the Smart Script is active, every enabled built-in parameter is added to the OneLink config as an afCustom entry with keys: []. Setting keys: [] is deliberate — it forces AppsFlyer to use only the value Zellify provides and stops it from scanning the current page URL for a matching key. Without that guard, ambient ad-network parameters on the funnel URL (?auid=..., etc.) can collide with conversion params and produce corrupted values like uuid_我的_dddd.

If the Smart Script falls back, the same parameters are appended directly to the destination URL.

See the Deep Link Button reference for the per-field source mapping.

The dedicated OneLink Parameters section lets you add arbitrary key/value pairs that don't fit the built-in list. Toggle Enable OneLink Parameters on to expose the editor.

Each row uses Label as the param key and Description as the value. Two value modes are supported:

  • Static text — used as-is. Sanitized to ASCII before sending.
  • Landing-page reference — write {{paramName}} to resolve paramName from the funnel landing page's window.location.search. Empty/missing params resolve to nothing and the row is skipped.

Example: row with Label fbclid and Description {{fbclid}} forwards the fbclid from the funnel's landing URL into the OneLink as a conversion param.

Special handling for pid and c#

If a OneLink Parameter row uses Label pid or c, it overrides the corresponding values from the destination URL:

  • pid → maps to mediaSource.defaultValue (defaults to whatever's in the destination URL, then "organic" if absent)
  • c → maps to campaign.defaultValue (defaults to whatever's in the destination URL, then empty string)

All other rows go into afCustom. Any query params already present on the destination URL (excluding pid and c) are preserved as additional afCustom entries.

App Store Buttons mode#

Switch Button Type to "App Store Buttons" to render Apple + Google Play badges instead of a single CTA. Both badges go through the OneLink Smart Script — the App Store and Play Store URLs each get the same parameter-injection treatment.

This is the right pattern when your OneLink template auto-routes platform-specific store URLs. If you want each badge to point at a different OneLink (e.g. an iOS-only OneLink and a separate Android-only one), put the relevant URL in each badge's Link field.

Fallback behaviour#

The button gracefully degrades when AppsFlyer is unavailable:

SituationWhat happens
Smart Script still loadingButton uses direct URL fallback (params appended to destination)
Smart Script fails to loadSame — direct URL fallback
generateOneLinkURL() returns nullConsole warning + direct URL fallback
generateOneLinkURL() returns invalid URLConsole warning + direct URL fallback
Live mode disabled (preview/editor)No URL is built; click is a no-op

Open the browser console to see exactly which path was taken. Lines are prefixed with [DeepLinkButton].

Inside your app#

The mobile-side wiring is unchanged from a standard AppsFlyer integration — no Zellify-specific SDK. In your app:

  1. Initialize the AppsFlyer SDK with your dev key and OneLink ID.
  2. Implement onConversionDataSuccess (iOS / Android).
  3. Read the af_* conversion params plus any custom params you sent (app_user_id, email, etc.).
  4. Route the user. Common pattern: call your backend with app_user_id to look up the funnel session, fetch the user's plan / RevenueCat entitlement, and drop them in the right onboarding step.

See AppsFlyer's docs on conversion data for the full SDK API.

Test and verify#

  1. Open the funnel in Live mode (the URL builder is no-op in editor preview).
  2. Open the browser DevTools console.
  3. Tap the button. You should see [DeepLinkButton] AF Smart Script loaded followed by [DeepLinkButton] URL: https://yourapp.onelink.me/...?....
  4. Inspect the URL — confirm your enabled built-in params are present with the expected keys, and your OneLink params are resolved.
  5. On a real device with AppsFlyer SDK installed, tap the live link and confirm onConversionDataSuccess receives the params.

Troubleshooting#

SymptomLikely causeFix
Click does nothingFunnel is in preview/editor modeOpen the live funnel URL, not the builder
Params missing from final URLField is disabled, or source value is emptyEnable in the Built-in Parameters section; check the source value resolves (e.g. is the user actually a Stripe customer?)
Garbled non-ASCII characters in paramsAd network injected unicode into the source valueAlready sanitized — verify in the console output that the cleaned value looks right
[DeepLinkButton] AF Smart Script failed to loadCSP blocks onelinksmartscript.appsflyer.com, or AdBlockAllowlist the script source; verify by visiting the script URL directly in the browser
OneLink param {{fbclid}} resolves emptyThe funnel landing page didn't have ?fbclid=...Confirm the original ad-network click landed on a URL with fbclid and that the user hasn't navigated away to a clean URL
pid overridden unexpectedlyA OneLink Parameter row is using key pidRemove it, or put the value on the destination URL instead
Deep Link Button
The standard, non-AppsFlyer button.
Deep linking overview
Adjust, Branch, and other providers.
app_user_id
What the App User ID conversion param resolves to.
Mobile app with RevenueCat
End-to-end install → onboarding flow.