iOS Universal Links with TUNE

With the release of iOS 9, Apple introduced Universal Links to make the content in your apps discoverable. Essentially, Universal Links makes it easier to “deep link” users from a web experience into your app experience. With Universal Links, a deep link is structured the same as a standard HTTP/HTTPS hyperlink (such as “http://www.myMobileApp.com/App1/Page123.php”) rather than a standard, app-specific deep link URL (such as “myApp://screen123”).

For attribution and campaign optimization purposes, you can append parameters to these Universal Links, just as you append parameters to a standard TUNE link. Functionally, Universal Links allows you to have a single link that either opens your app or your mobile site.

Prior to iOS 9, deep links were largely handled at the app level where you had to implement some mechanism (such as a third-party SDK/platform or some JavaScript) to handle the logic for new users who do not have the app installed. Typically this involved invoking the Safari app to perform a browser redirection to the app store to install the app (else a deep link would simply invoke Safari to open the app to a specific screen). If you didn’t implement any logic for routing new users, then clicking a deep link would simply do nothing, thereby creating a poor user experience.

For example, the following animated graphic shows deep link behavior in iOS 8: when an app is installed, deep links work well (in this case, the deep link opens the Instructions screen in the Atomic Dodge Ball Lite app, rather than the default Home screen). But if an app is removed/not installed, then deep links don’t work at all.

But with Universal Links in iOS 9, deep links are handled at the operating system (iOS) level instead of the app level. So rather than invoking an app like Safari to process the link, iOS itself checks to see if the target domain supports Universal Links: if not, then deep links are processed the same as in pre-iOS 9 (you implement some deep link logic to handle new users).

If the domain supports Universal Links, then iOS checks to see if the app is installed: if not, then iOS launches Safari and displays a mobile-friendly page (which may show a Smart Banner that encourages the user to install the app). If the app is installed, then iOS launches the app directly to the page/screen specified by the deep link.
uLinks

Attribution

Prior to iOS 9, TUNE clients typically solved the “deep link failure” issue by using a standard Attribution Analytics TUNE link instead of an app-specific deep link URL (that fails when app not installed). TUNE links can include a deep link (via the “invoke_id” parameter) so TUNE performs app detection and subsequent handling: if app not installed, then redirect the user to the app store to install the app; else if app installed, then deep link the user directly into the app.

Universal Links are not only difficult and costly to implement, but also do not support redirects; this makes it hard to measure your performance of a link. TUNE supports Universal Links for iOS apps, and does most of the work needed for you with one code change and one piece of information from your Apple developer account. All TUNE links are configured to use Universal Links to guide your users to the app.

One of the advantages of using TUNE links is that by convention, you can append campaign optimization parameters while TUNE collects and logs the corresponding values for reporting and analytics. For example, the following TUNE link includes appended campaign parameters:

https://12345.measurementapi.com/serve?action=click&publisher_id=12345&invoke_id=1234&sub_campaign=Atomic%20Dodge%20Ball%20Lite%201&sub_adgroup=US%2018%2B&sub_ad=Challenge%20Friends%20Blue&sub_placement=Mobile%20News%20Feed

Because Universal Links are formatted the same as standard HTTP/HTTPS hyperlinks, you can append your campaign parameters to a Universal Link in the same way that you append parameters to a standard TUNE link. For example, the following sample Universal Link includes the same appended parameters as the sample TUNE link above (but the domain is different):

https://alpha.tlnk.io/atomic/upgrade.php?publisher_id=12345&sub_campaign=Atomic%20Dodge%20Ball%20Lite%201&sub_adgroup=US%2018%2B&sub_ad=Challenge%20Friends%20Blue&sub_placement=Mobile%20News%20Feed

Note: The deep link parameter in the callbacks deliver the deep link defined in the TUNE link, or the invoke_url parameter on the TUNE link.

Requirements

To use Universal Links, you’ll need the following:

  • An iOS app that supports iOS 9/Xcode 7 (Universal Links are not supported before iOS 9)
  • An iOS app that contains a “com.apple.developer.associated-domains” entitlement (which essentially registers your app with iTunes as being capable of handling Universal Links; the entitlement lists all the domains that your app can handle as Universal Links)

With these pieces in place, iOS 9 handles Universal Links according to the following process.
iOS_Logic

When a user clicks a Universal Link:

  1. iOS checks the corresponding domain entitlement to see if the domain supports Universal Links.
    • If not, then take user to mobile web version.
  2. If the domain supports Universal Links, then iOS checks the “apple-app-site-association” file to see which apps are allowed/assigned to handle Universal Links for the domain.
    • If this check fails for any reason (such as file missing, or misconfigured entries in file, or improperly set file attributes), then take user to mobile web version.
  3. Then iOS checks to see if the assigned app is installed on the user’s device.
    • If not, then take user to mobile web version.
  4. If app is installed, then iOS launches the app to a specific screen (as determined by the Universal Link destination).

To use Universal Links with TUNE attribution for your iOS app, follow the instructions in our developer documentation for Implementing iOS Universal Links.

Enabling iOS Universal Links

Once your iOS app is set up to handle universal links, you’ll need to enable the Universal Link setting in your Attribution Analytics account.

  1. In Attribution Analytics, go to ApplicationsSettings.
  2. Toggle the Universal Links (iOS apps only) setting to Enabled.
  3. Once enabled, provide your Apple Developer Team ID.ios_universal_links
  4. Click Update.

Adjusting Preference on a Per App Basis

If you prefer to manually disable and enable the use of universal links for each of your iOS apps, you can do so by:

  1. In the left hand navigation menu, in the Applications section, click on Mobile Apps.
  2. Find and click on the name of the mobile app you wish to manually change the preference for.
  3. In the Details box, click Edit.ios_universal_links2
  4. On the Edit App page, in the Routing section, toggle the Universal Links setting to Enabled/Disabled.ios_universal_links3
    1. If Enabled, provide your Apple Developer Team ID.
  5. Click Save.

To use Universal Links with TUNE attribution for your iOS app, follow the instructions in our developer documentation on Implementing iOS Universal Links.

No Comments

Leave a reply