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.
Introduction
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
- AppsFlyer Android SDK version 6.0.0
Step 1: Integration setup in EmailLabs
To set up the integration in EmailLabs:
- Set up your domain according to this article
- Set up your click recording domain according to this article and the screenshot below.
- Enable link tracking according to this article and the screenshot below.
- Contact EmailLabs support at bok@emaillabs.pl and request to enable SSL.
- 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
Note
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.
- Associate the click recording domain in Xcode:
- 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 = @[@"example.com",@"click.example.com"];
- 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
- Create a OneLink URL on the Link Management page (or manually). You must URL-encode parameter values.
- [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.
- Insert the OneLink URL in the email.
Example:<a href="links.example.com data-msys-sublink="appsflyer">Link to your app!</a>
- 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. - EmailLabs wraps the link with the defined click domain so that a click on the click domain redirects to the OneLink attribution link.
Example
The URL parameters in the example that follows aren't encoded to enable ease of reading.
https://example.onelink.me/abcd?pid=emaillabs&c=Spring_Newsletter&is_retargeting=true& af_dp=testapp://path/to/content&af_web_dp=https://www.example.com/path/to/content& af_ios_url=https://www.example.com/path/to/content&af_android_url=https://www.example.com/path/to/content
Step 4: Test your links
To test the integration:
- Set up EmailLabs.
- Create a OneLink URL.
- Insert the URL in an email.
- 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.