[Closed beta] Set up your ESP integration with AppsFlyer

At a glance: Set up an ESP integration with AppsFlyer to enable seamless and secure deep linking in your email campaigns for better user engagement and conversion rates.

ESP final main KB image.png

About the AppsFlyer ESP integration 

Marketers often use email service providers (ESPs) to send large-scale email campaigns. And while this should be a simple process, delivering predictable user journeys, this is often not the case. The reason lies in how the typical ESP handles its analytics, which tends to break deep links and negatively affect the mobile user experience. As a result, users are sometimes routed to mobile websites instead of your app, making conversions less likely.

AppsFlyer addresses this issue with an ESP integration solution, which enables AppsFlyer to serve as an intermediary between the ESP server and your domain name. Its role as a proxy enables the provision of association files (AASA / asset links) which facilitates deep linking. Additionally, the AppsFlyer solution sends measurement data back to your ESP, enabling you to monitor your email analytics effectively.

Set up an ESP integration with AppsFlyer for smooth and secure deep-linking experiences in your email campaigns, for optimal mobile user engagement and conversion rates.

Set up the integration

This section describes how to set up your ESP integration with AppsFlyer.

Prerequisites

Before you begin setting up your ESP integration with AppsFlyer, you'll need to have an account with a supported ESP*. The following items will be required from them:

  • The click-tracking domain: The click-tracking domain is the domain component of the URL appearing in the email message. This domain consists of the subdomain name and your domain name, for example, mail.yourbrand.com. Some ESPs refer to this as link branding, tracker domain, click domain, link rewriting, click tracking, white label or other names.
    Note: Ensure that links within email campaigns using the click-tracking domain are secured with the HTTPS protocol.
  • The ESP endpoint: The endpoint is provided to you by the ESP so you can route your clicks to its servers. Example of the ESP endpoint structure: esp.endpoint.com.
  • Specific ESP integration requirements:
    • Emarsys - Ask your Emarsys customer success manager to enable HTTP redirection.
    • Blueshift - Ask your Blueshift customer success manager to
      change the HTTP response code for clicks to 302 (from the default 307).

To set up the integration, follow these steps:

Step 1. Create a OneLink template for your email campaign

Create a OneLink template with Universal Links or App Links in AppsFlyer. This template will be used later to create OneLink links for your email campaigns.

*If you already have a OneLink template configured with Universal Links, you can use the existing template.

Step 2. Configure your app (developer task)

Have your developer make the following configurations to your app:

 

Configure your app to support associated domains 

AppsFlyer hosts app association files for your app to enable Universal Links (iOS) or App Links (Android).

To configure your app to access the files:

For iOS
Prerequisite: SDK from v6.12.3
Configure your app to enable Universal Linking from the email message to your app.
Learn more about configuring Universal links.
Note: The click domain should be added to the current domains already defined in the associated domains.

For Android
Prerequisite: SDK from v6.12.5
Configure your app to enable Android App Linking from the email message to your app. Learn more about configuring Android App Links.
Note: The click domain should be added to the current domains already defined in the Android Manifest.

 

Configure your app to support deep linking 

When a click on an App Link or Universal Link occurs, the app should open.

To enable the app to extract the OneLink behind the click recording domain and resolve the deep link:

1. Provide the click recording domain to the SDK API resolveDeepLinkURLs. This API must be called before SDK initialization.

2. Use the Unified DeepLinking API to get the deep link parameters and handle the deep link data.

 

Configure your app to handle Weblinks and Application Links

The provided code aims to regulate the functionality of wrapped links within an email campaign, specifically addressing two types: Weblinks intended to open a website, and links designed to open the app through a universal link or App link.
For more developer information please see the following guides:

Step 3. Set your ESP integration in AppsFlyer

Now it's time to set the integration in AppsFlyer.

To set:

1. In AppsFlyer, from the side menu, select Engage > ESP integration.

From Engage click ESP integration.png

 

2. Select your ESP.

select ESP.png

 

3. Select the OneLink template you want to use for email campaigns, then click Next.

select OneLink template.png

 

4. Make sure you have an active account with the selected ESP.

You will need the following from your ESP:

  • Your click tracking domain
  • ESP endpoint

Click Next.

 

5. Enter your click tracking domain and ESP endpoint, then click Validate connection. This validates that the click tracking domain points to the endpoint you entered.

enter your ctd and esp endpoint.png

When done, click Next.

 

6. Route link traffic to AppsFlyer:

a. Copy and send the customized pre-fabricated instructions in AppsFlyer to your IT or domain administrator. They will need to reroute your email campaign traffic from the ESP servers to the AppsFlyer servers by updating your DNS CNAME records with the new domain provided by AppsFlyer.

As a result, every time a link is clicked, the click will be redirected to AppsFlyer, which in turn will redirect it to the ESP endpoint.

click to Af to ESP image.png

 

b. After copying and sending the instructions, click Done.

Your ESP integration has been created.

 

Please note that: 

  • Your ESP integration status is pending and will only start working after the CNAME record is mapped.
  • It can take up to 24 hours after mapping for a new integration to start working and become active.

 

Step 4. Customize the OneLink link for your email campaign

To create and customize the OneLink link for your campaign:

1. In AppsFlyer, create an “Email-to-app” OneLink link on the OneLink management page (or manually) within the OneLink template you created earlier. This is the link you’ll use in your email campaign that will attribute and redirect users per your specifications. Learn how to create a OneLink link.

email-to-app.png

 

Best practice: Use the same campaign name in both the ESP email campaign and in the AppsFlyer OneLink links used in that campaign.

Step 5. Test the integration

To test the integration with the OneLink link you created:

Insert the OneLink URL in a test email you create and send to yourself using the ESP email editor.

From your mobile device, open the email and click the link. If you have the app installed, the app will open and you'll be deep-linked to the relevant content.

In addition, a mobile click should appear in the AppsFlyer dashboard, attributed to the provided media source and campaign, as well as in your ESP analytics dashboard.

Once the test is successful, you're all set.

Step 6. Use the link confidently in your email campaigns

Well done! You're now ready to use links in your email campaigns. Afterwards, you can view the campaign results in your ESP or AppsFlyer dashboards.

*ESPs supporting this integration include: Blueshift, Braze, CleverTap, Customer.io, Emarsys, Expert Sender, Klaviyo, MailExpress, MailGun, Moengage, RDStation, Reteno, Sailthru, Sendgrid, Sparkpost, and more to come.