I know it\'s possible to link directly to an app in iOS by registering a custom scheme (e.g. so://) and it\'s also possible to link to the app in the appstore via itunes.
There are a bunch of complicated edge cases here, so the easiest solution is to let someone else handle that stuff.
This is what https://branch.io/ do. You can use their free plan to achieve exactly what you want, with a handful of bonus features
I'm not affiliated with Branch.io, but I do use their product.