Use Universal Links
When linking from the browser, you should most definitely be using Universal Links. If the user does not have the app installed and they click a URI scheme, the browser will show an error message. There are ways around this, like a javascript redirect, but these are very hacky and tend not to work all the time.
Detecting click in browser
The functions in your app delegate will not be called until the app has already been handed control from the browser, so it's impossible to detect the browser click from the app itself. You'll have to use some javascript click event handlers to detect that, but all of the handoff is handled at the OS level so you won't be able to control that.
Registering an open from a deep link
Once the deep link opens your app, it will call one of three functions.
From URI Scheme (myapp://):
application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
From Universal Link ONLY WHEN APP IS RUNNING IN BACKGROUND:
(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler
From Universal Link if app is closed
(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
This last one gets most people because they assume continueUserActivity
should get called but it's really this function and they put the deep link url inside the launch options parameter.
Use Branch or a third party
Lastly, you could use Branch that leverages both URI and Universal Links whenever necessary and forwards all of your app delegate functions to one callback so you don't have to update routing logic in three different places.