Universal Links

Universal links are URLs that redirect users to your mobile app. When a customer clicks a universal link in one of your email campaigns, your app will be opened. Follow the steps in this guide to ensure that universal links work correctly.

👍

To ensure that universal links work correctly and collect click statistics

  • Ensure that your users have your app with Maestra’s SDK installed;
  • Install a JS tracker and an iOS/Android AASA file in each domain and subdomain of your website;
  • Enable universal link support in app settings.

Adding and initializing the SDK

Skip this step if your app is already integrated with the SDK.

iOS:

Android and Huawei:

Setting up the JS tracker

Javascript SDK

To track clicks correctly, add the JS tracker to each domain and subdomain to which your links should be processed as universal.

Setting up universal link support

iOS:

1. Supporting associated domains

Establish an association between your app and website, and specify the URLs that your app handles. To do this, follow Apple’s guide on how to support associated domains.

Ensure that each domain and subdomain that deals with universal links has an Apple App Site Association (AASA) file in the .well-known subfolder. Ensure that you can access this file through HTTPS at https://<domain>/.well-known/apple-app-site-association without redirection.

2. Supporting universal links in the app

Update App Delegate to ensure that it responds to the user clicking on the universal link to open the app. To do this, follow Apple’s guide on how to support universal links in your app.

Android and Huawei:

1. Adding intent-filter

Android Help

Add your intent-filter with the autoVerify="true" attribute to the manifest file.

Example:

<activity … >
…
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="https" 
            android:host="domain1.com" 
            android:pathPrefix=”/foo”/>

    </intent-filter>
…
</activity>

If every screen in the app corresponds to an individual activity, you can specify a separate intent-filter string for each. Thus, every individual link will open a specific activity.

2. Establishing the association between the website and the intent-filter

Android help

Upload the following file on your website: https://domain.name/.well-known/assetlinks.json.

Example:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example",
    "sha256_cert_fingerprints": ["<certificate key>"]
  }
}]

Setup in your Maestra project

Specify the domain and subdomains where universal links are located: