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#
- Drop the AppsFlyer Deep Link Button onto the success page from the component palette.
- In the Destination URL field, paste your OneLink template URL. You can include
pidandcquery params on this URL — they become the OneLink campaign's media source and campaign name. - Configure built-in parameters and OneLink parameters as needed (sections below).
- Inside your mobile app, read the conversion parameters from AppsFlyer's
onConversionDataSuccesscallback 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.
OneLink Parameters#
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 resolveparamNamefrom the funnel landing page'swindow.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 tomediaSource.defaultValue(defaults to whatever's in the destination URL, then"organic"if absent)c→ maps tocampaign.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:
| Situation | What happens |
|---|---|
| Smart Script still loading | Button uses direct URL fallback (params appended to destination) |
| Smart Script fails to load | Same — direct URL fallback |
generateOneLinkURL() returns null | Console warning + direct URL fallback |
generateOneLinkURL() returns invalid URL | Console 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:
- Initialize the AppsFlyer SDK with your dev key and OneLink ID.
- Implement
onConversionDataSuccess(iOS / Android). - Read the
af_*conversion params plus any custom params you sent (app_user_id,email, etc.). - Route the user. Common pattern: call your backend with
app_user_idto 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#
- Open the funnel in Live mode (the URL builder is no-op in editor preview).
- Open the browser DevTools console.
- Tap the button. You should see
[DeepLinkButton] AF Smart Script loadedfollowed by[DeepLinkButton] URL: https://yourapp.onelink.me/...?.... - Inspect the URL — confirm your enabled built-in params are present with the expected keys, and your OneLink params are resolved.
- On a real device with AppsFlyer SDK installed, tap the live link and confirm
onConversionDataSuccessreceives the params.
Troubleshooting#
| Symptom | Likely cause | Fix |
|---|---|---|
| Click does nothing | Funnel is in preview/editor mode | Open the live funnel URL, not the builder |
| Params missing from final URL | Field is disabled, or source value is empty | Enable 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 params | Ad network injected unicode into the source value | Already sanitized — verify in the console output that the cleaned value looks right |
[DeepLinkButton] AF Smart Script failed to load | CSP blocks onelinksmartscript.appsflyer.com, or AdBlock | Allowlist the script source; verify by visiting the script URL directly in the browser |
OneLink param {{fbclid}} resolves empty | The 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 unexpectedly | A OneLink Parameter row is using key pid | Remove it, or put the value on the destination URL instead |