EmailLabs integration with AppsFlyer

At a glance: EmailLabs, an email delivery and analytics platform, embeds AppsFlyer OneLink within emails. When email recipients click on the link, they are deep-linked into your app.



ESPs (Email Service Providers) can be excellent sources for segmented user traffic.

One of the challenges when using ESPs is recording clicks while persevering deep linking functionality. ESPs wrap the deep linking URL with their own click recording domain. This action often breaks iOS Universal Links.

However, with ESPs that support Universal Links on top of their click recording domain, deep linking and click recording can still be performed successfully.

SDK version prerequisites

  • AppsFlyer iOS SDK version 6.0.4

Step 1: Integration setup in EmailLabs

To set up the integration in EmailLabs:

  1. Set up your domain according to this article
  2. Set up your click recording domain according to this article and the screenshot below.


  3. Enable link tracking according to this article and the screenshot below.


  4. Contact EmailLabs support at and request to enable SSL.
  5. In EmailLabs, go to Panel > SMTP Accounts > Settings > Deep Links, and check the Activated box. For iOS apps, enter the Apple Application ID in the respective field.


Step 2: Configuring your AppsFlyer SDK


If you haven’t already done so, make sure you have configured your app to support deep linking with OneLink.

After configuring your click recording domain to support Universal Links as described previously, you need to set up your app to deep-link and resolve that Universal Link.

  1. Associate the click recording domain in Xcode:


  2. Provide the click recording domain to the SDK API setResolveDeepLinkURLs. This API needs to be called before SDK initialization. For more information please refer to SDK documentation here.
    [[AppsFlyerLib shared] resolveDeepLinkURLs = @[@"",@""];
  3. When the app is invoked due to a click on the Universal Link, the AppsFlyer SDK resolves the deep link and extracts the underlying OneLink. All deep link parameters are then propagated into the onAppOpenAttribution API for deep link logic execution.

Step 3: Send emails with OneLink through EmailLabs

  1. Create a OneLink URL on the Link Management page (or manually). You must URL-encode parameter values.
  2. [Best practice] Use the following parameters:
    • pid (media source): Use a media source that signifies this usage such as EmailLabs.
    • c (campaign): Campaign name
    • af_dp: The deep link URI scheme you want to deep-link your users into.
    • af_web_dp: Where to redirect users clicking the link on desktop.
    • af_ios_url: Where to redirect users that don’t have the app clicking the link on an iOS device.
    • af_android_url: Where to redirect users that don’t have the app click the link on an Android device.
  3. Insert the OneLink URL in the email.
    <a href=" data-msys-sublink="appsflyer">Link to your app!</a>
  4. If the email is part of a retargeting campaign, add the parameter is_retargeting=true.
    This indicates that the attribution link is from a retargeting campaign. Learn more about retargeting.
  5. EmailLabs wraps the link with the defined click domain so that a click on the click domain redirects to the OneLink attribution link.


The URL parameters in the example that follows aren't encoded to enable ease of reading.

Step 4: Test your links

To test the integration:

  1. Set up EmailLabs.
  2. Create a OneLink URL.
  3. Insert the URL in an email.
  4. Send a test email to yourself. 

Expected result:

  • If you have the app installed, it should launch and you will be deep-linked into the defined app page.
  • A click reflects in:
    • The AppsFlyer dashboard, attributed to the media source and campaign.
    • EmailLabs data.