Salesforce marketing cloud



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

The usual problem with ESPs is performing correct attribution and deep linking. ESPs wrap the deep linking URL with their own ESP's click recording domain. This procedure often times breaks the iOS Universal Links process.

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

This article explains the flow for integrating OneLink URLs into your Salesforce Marketing Cloud (SFMC) account, to seamlessly deep link from emails. This utilizes SFMC's support for Universal Links on top of the branded click recording domain.


  • AppsFlyer iOS SDK version 4.9.0 

For iOS Universal Links you should perform the following in your SFMC environment:

  • Purchase and implement Sender Authentication Package (SAP)
  • Purchase an SSL Certificate (also known as SSL Configuration) and submit an SSL Request Form
    * To obtain Sender Authentication Package and SSL Certificate reach out to your Salesforce Account Representative or submit a deliverability support case via Salesforce Help.

SFMC setup

Steps 1 - 4 are only needed to support iOS deep linking.

Part 1: Setting your click recording domain in SFMC

To set a click recording domain, follow SFMC official guides for:

Step 2: Upload your SSL certificate to SFMC

In order for iOS Universal Links to work properly, your click recording domain must include your domain’s SSL certificate that should be installed in your SFMC account. Instructions on setting your SSL certificates can be found in SFMC official guide.

Step 3: Setting deep linking in SFMC

To enable deep linking from SFMC emails:

  1. Login to your SFMC account, and go to the Email Studio view
  2. Click on the Admin tab
  3. In the side menu, click on deep linking. In this view, you can configure new deep link integration with your app, or modify existing ones.

  4. To create a new configuration, click the Create button and enter your AppID. The AppID value is a combination of your Apple developer team ID and the Bundle ID. Both of these values can be retrieved from your Apple Developer account.


    Given the Team ID prefix 5UABCDFGH, and the Bundle ID, the following value should be entered:


  5. Your set up of universal links and deep linking is completed once SFMC sets up the Apple App Site Association (AASA) file. This process may take a few hours. You can see your generated file using the following URL:

Step 4: 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 the 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.
    [[AppsFlyerTracker sharedTracker] setResolveDeepLinkURLs:@[@""]];
  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 5 Sending your first mail

  1. Create a OneLink URL in the Link Management page (or manually)
  2. When creating the OneLink URL make sure to URL encode all parameter values
  3. The following parameters are highly recommended to use:
    • pid (media source) - Use a media source that signifies this usage such as Email.
      c (campaign) - The name of the campaign you want to attribute
    • 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 in an iOS device
    • af_android_url - Where to redirect users that don’t have the app click the link in an Android device
  4. Place this link in the email you are creating in Email Studio.
    At this stage, Salesforce Marketing Cloud will wrap the above link with your click recording domain that you set in previous steps. Any click on the click recording domain will redirect to the OneLink attribution link.


URL parameters are not URL encoded for the sake of readability:

Step 6: Testing your links

After following all the required steps mentioned above, creating the appropriate OneLink URL, and placing it in an email, send yourself a test email.

What should you expect?

If you have the app installed, the app should be invoked. If the relevant AppsFlyer SDK deep linking APIs are implemented you should be deep linked into the relevant content.
In addition, a click should appear in both the AppsFlyer dashboard, attributed to the provided media source and campaign, and also in Salesforce's data.

Was this article helpful?