# Universal Link Research
### Apple app site association file details.
1. Create apple-app-site-association file with details of web page paths to make universal link
2. Steps are mentioned in apple documention [Appl Universal Doc link](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html) how to include website paths and exclude path which we don't want to make universal links and load in web browser itself instead of in Native app. such as we can restrict guns, ammo pdp pages by mentioning those paths in this file
3. Apple app site association, needs to host for QA website at root to test in Stagging / QA environment.
3. Host apple-app-site-association on dickssportinggoods website at root path https://<domain>/.well-known/apple-app-site-association.
4. To restrict specific product for universal links, component path has to mention path to exclude pages like below:
```
{
"appID": "XT5SKW92DF.com.dsg.mobile.consumer",
"components": [
{
"/": "NOT /p/*-fire-*"
},
{
"/": "/p/*-gun-*",
"exclude": true
}
]
}
```
5. We need to host DSG and GG apple app site assiciation files.
### Handle Universal links in iOS App
1. iOS app needs to handle universal links in the app by decoding universal links data or paths and hand off decoded paths to router to navigate to specific pages.
2. To support universal link follow below steps
* add entitlements for associated domains that app support.
* Implement appDelegate useractivity delegate func to receive useractivity object and decode and hand off paths to router to naviagate to pages.
* Add entitlements for QA/sanbox environment for testing.
* here document links for more details https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
**USE-CASE-1: DSG**
Assumptions:
1. Apple App site association file hosted on DSG domain
2. DSG app installed on device
3. Enable universal link on DSG top level Domain
Athlete google search product on Safari browser
Found DSG Product on search list
Athlete Taps on DSG listed product
Opens Native DSG app and take user to product page
Caveat:
1. Branch will not be able to post any kind of tracking analytics data for this kind universal link as they does not process these links and posts tracking.
2. We will not able to collect branch attributes analytics coming from google search directly to app.
2. We Need to post universal links tracking analytics data to Adobe system separatly something since user's are directly coming from google search to app.
**USE-CASE-2: DSG**
Assumptions:
1. Apple App site association file hosted on DSG domain.
2. DSG app not installed on device
3. Enable universal link on DSG top level Domain
Athlete google search product on Safari browser
Found DSG Product on search list
Athlete Taps on DSG listed product
Product continue to opens in web browser since app not installed on device.
**USE-CASE-3: DSG**
Assumptions:
1. Apple App site association file hosted on DSG domain.
2. DSG app not installed on device
3. Enable universal link on DSG top level Domain
4. Enalbed app banner on website domain
Athlete google search product on Safari browser
Found DSG Product on search list
Athlete Taps on DSG listed product
Product opens in web browser since app not installed but also banner will show on page to take user to AppStore.
Caveat:
1. Branch will not be able to post any kind of tracking analytics data for this kind universal link as they does not process these links and posts tracking.
2. We will not able to collect branch attributes analytics coming from google search directly to AppStore.
### How Branch works with Universal link
As per the documentation, Branch ask to enable universal link on top level domain i.e DSG/GG domain and give that domain to Branch for registration.
**How does branch works with organic search like Google:**
1. User clicks on a link from a search engine (ex. Google, Yahoo, etc.).
2. Branch collects specific signals on app open.
3. The Branch SDK simulates a click.
4. Branch attributes app users to the organic search results.
Branch Integration Guide with Univesal links:
* Verify that your Branch iOS SDK version is v1.39.4+
* Enable Universal / App Links on the top-level brand domain
* Register top-level brand domains with Branch
Branch Document link https://help.branch.io/using-branch/docs/seo-app-attribution
**Action Items:**
1. We need to reach out to Branch to enable Universal links on top level brand domain and register top level brand domain with Branch.
2. We need to test integration.