Google Analytics in iOS, How do I know if a page of my website was opened using an app? - ios

I'm developing an iOS app that required me to track a clicked event on an advertising image.
When user clicked on the ads image the app will open a website in web view. My question is : how does the owner of that website know that the website has been opened from a link in my app ?

Ok you want to know whether the user clicked the add and the webview was opened, and the add was completely loaded? You could try adding Google Analytics via Javascript to the ad web page or you could use the webViewDidFinishLoad method in the webview to track whether the add was loaded completely or not.

I've found the solution. In case someone wants to do the same as mine, I've added this "?utm_campaign=August&utm_medium=referral&utm_source=MyApp" at the end of the link when clicked. So when the ads owner opens their google analytics console they will see in referral tab the traffic from MyApp. Here is the link for GA detail.

Related

Universal link after installing app wont open from Safari

Senario: User scans a QR code with a unique universal link into our app to "redeem" their code.
They scan the code which goes to a webpage with a link to download the app.
The user downloads the app.
Returns to the web page and there is a link within the page which is the same link as the QR code.
We assume tapping the (same) URL would trigger the universal link but it does not.
The universal link works fine from email or other apps (after its been installed)
How can we fix this bad UX, is there a HTML component or redirect we need to consider when tapping the basic link on the Web page. How can we make the link initiate the "deeplink" into the app now its installed. The banner at the top is displayed but its not the ideal flow.
The user cannot scan the QR code again - they must go through the download and "reopen" app in one flow.
Universal links do not trigger in Safari. This is intentional behavior confirmed by Apple engineers in the forums (sorry, don't have a link right now). Their reasoning: if you're already in the browser eco-system you usually do not want to be redirected to an app, but want to stay in the browser.
What you can do is have your app implement a custom URL scheme, and your web page can then check if your custom URL scheme is supported and open it.

Showing app download page Firebase Dynamic Links

In my iOS app, I have used the Firebase dynamic links to share some of the contents with others. It's simply a custom domain URL with the content ID appended. With this Firebase dynamic URL's, I have successfully implemented to do this task-"When user tap and opens in the mobile phone if the app installed in the phone it will open directly from the app with relevant contents"
But I want to do the following tasks :
If the app has not installed in the mobile, and if the user opens the URL then show a small web page in the default web browser with the app download link which user can click and download which will direct the user to the app store app. This needs to only happen on the mobile.
We have a web app for the mobile app so in case if the user opens the URL shared in the Desktop or Laptop I need them to redirect to the relevant content web page.
Hope kind support on this... Thanks
You can do these settings when creating a new dynamic link:
Just make sure you "Skip the app preview page" is not selected, this way the user will have a web page with a download button to take them to the app store.

how to open app directly from deeplink without user intervention

If we do the deep linking in iOS, when user goes to that specific url it show open app on top and then user has to click it.
How to automatically open app when he goes to that url ?
you can use universal links in iOS.
you can find a detailed tutorial here

Google Analytics for Email Tracking when using Universal Links on iOS

I would like to track button clicks in emails using Google Analytics. Let's say I would like the button to have a Universal Link, which when clicked, will open an iOS app directly with no browser redirect. (https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html)
However, if my URL is a Universal Link, i.e. www.xyzxyz.com/openApp?campaign=promo&source=email, and an email recipient clicks the link from their iPhone with the installed app, no call is made to the server, and therefore the click is not tracked.
Has anyone experienced a way of tracking Universal Link clicks?
Universal Links are handled on the frontend by the device without ever interacting with a server if the app is installed. The AASA file is stored on the device at install and allows the device to check whether the link can open the app before passing the link onto safari. If the app is not installed and the link is passed onto Safari then the Google analytics tags will be processed. The only way to accomplish this is to send the GA request from the app if you register that a Universal Link was clicked.
I recommend looking into a deep linking service like Branch. They have a Google analytics data integration that will handle all of this tracking for you.

IOS10 Firebase Dynamic Link Show a Blank Page with Open Button. But Why?

blank image show if app not installed
I tried to implement firebase dynamic link. It works perfectly if app installed in device but it shows this page if app not installed.It happens every time i try to go to app store. Does anyone have any solution? Please Let me know.
Thanks
If you've created the link manually through firebase console. You can skip the app preview page by editing your link from the console.
-> Dynamic Links
-> Edit Link
-> under 'Campaign tracking, social tags and advanced options'
-> check 'Skip the app preview page'
This is intentional as a way to help you get around the fact that some apps prefer to show all web content inside of their own in-app WebView and make it difficult for JavaScript redirects (like what Firebase Dynamic Links typically does) to take you to the App Store.
That said, I know it's not always a great experience, so the team is looking into adding an option to make this interstitial page optional for your links.
EDIT: There's now a way to skip the interstitial if you'd like. Add the argument efr=1 to your link URL, and it will skip the page and attempt to redirect you directly to the appropriate location. If you're generating a link in the console, you can click the "Skip the app preview page" checkbox in the advanced options.
This is normal. If user clicks on the link it will lead to the correct download page on the app store.
Before iOS10, dynamic links were directly leading to the app store without this transition page. Changes in Safari security setup force them to add this page.

Resources