Firebase Analytics: Install Referrer: iOS app - ios

Is there any way to get the app install referrer information via firebase for an iOS app.
Say there is a iOS app dynamic link with information about the source and campaign. And if the app is not installed, the link takes you to app store for installing the app.
After installing when opening the first time, is it possible to track the campaign source information via firebase.
Any help is appreciated.

Currently, due to Apple dropping the referrer's URL when the user is taken to Apple Store to install the app for the first time, Firebase Analytics can't report campaign event and attribute it to the source/campaign. Firebase Dynamic Links can probably solve that issue.
If users already install the app, and the URL opens the app directly with the link, then yes, Firebase Analytics can link to the source/campaign if the URL has utm_campaign or utm_source in the URL params.

Yes, according to the documentation, APP_FIRST_OPEN is one of the metrics measured in Dynamic Links. If you want to track different campaigns, the documentation says
You use Dynamic Links with your existing Google Analytics custom
campaigns and iTunes Connect App Analytics campaigns by specifying
campaign parameters when you create a Dynamic Link. When a user opens
a Dynamic Link with campaign parameters specified, the campaign
parameters are passed on to Google Analytics or the App Store.

Related

How to detect an iOS app install campaign inside the app

I would like to find out in my iOS app if the app was installed due to an ad campaign link.
Google Analytics is doing this and it is tracked on their analytics web page. iTunes Connect is doing this too and it is also tracked on the iTC web page.
I'm looking now for a way to get this information inside the app. When the app first starts i want to check if it was installed because the user was sent to the App Store by a campaign link and what campaign id it was.
Is there a way for an iOS app to ask Google Analytics, Firebase or iTC/StoreKit what campaign has led to its install?
Google Anlaytics uses IDFA of user's device as identifer after user installs the application, i.e. when user clicks on the ad, they are redirected to google analytics where they collect user's IDFA and redirects user to iTunes. Once user installs the application, they match the saved IDFA with user's IDFA and if they match they mark that user as attributed.
I looked at the Google Analytics docs, to find some info on callback that google may provide if there is a match, after user installs the application. Unfortunately, I could not find anything.
But the thing is, I don't think this method should work at all now after iOS 10. Apple provided users with Limit Ad Tracking from sometime now but on iOS 10, if a user has enabled it, the IDFA API returns a number like this: 00000000-0000-0000-0000-000000000000
You can imagine you cannot match user using IDFA now.
On the other hand, there are other ways to do fingerprint matching for iOS devices. It is not very accurate but it works most of the time.
I have used branch.io for deferred deeplinking and it worked. You can also look at the solution provided by them. They have a callback which you can implement and get to know from which link your app is getting installed.
It looks like Adjust can do this:
Adjust says it uses fingerprinting when IDFA is not available
https://docs.adjust.com/en/getting-started/#tracking-installs
According to https://docs.adjust.com/en/callbacks/#best-practice-accessing-adjust-attribution-data-externally
and
https://partners.adjust.com/placeholders/
the Adjust SDK seems to allow the app access to its data including campaign name for installs.
I will comment later if this really worked.
I got an answer from Adjust saying:
yes it is possible with the Adjust SDK to attribute installs to the
source which drove that install.
By setting up campaign parameter structure to the tracker URL, you can
actually find out the the Network Name, Campaign Name, Adgroup Name
and Creative Name.
For your reference here is the guide to setup campaign parameter
structures ->
https://docs.adjust.com/en/tracker-generation/#planning-your-tracker-structure

How to shorten a Firebase Dynamic Link using my own domain name

I'm trying to implement Firebase Dynamic Links in an iOS app. The goal is to have a clean URL for marketing purposes so folks can share links on social media. The idea is folks will share the clean URL that starts with my domain name.
When the app is installed following a click on that link, we want to be able to track who referred the app install by looking at the payload delivered by Firebase. I think this goal is similar to Firebase's use case to convert web users to mobile app users.
An example link I would like to provide for sharing on social media is: http://example.com/my-payload-here
I've tried several cases but I'm not able to get the behavior I'm looking for in any case. Has anyone implemented this successfully before?
Here is my test procedure:
Uninstall the app
Send the link to be tested in an iMessage to myself
Tap the link on my iOS device (not using a simulator)
Install the app from the App Store
Launch the app after download completes by tapping "Open" button in the App Store
Below are my findings:
Short link generated from the Firebase Console (https://xyz.app.goo.gl/ABCD) - Link opens in App Store. I install the app. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the payload is delivered.
Long link identical to the "Long Dynamic Link" from the Firebase console for the link generated in #1 (https://xyz.app.goo.gl/?link=http://example.com/my-payload-here&isi=12345&ibi=com.example.MyApp) - behavior is identical to #1
Short link using my domain (http://example.com/redirect/my-payload-here, configured to 301 redirect to URL in #2) - Opens in App Store. I install. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the link still goes to the App Store.
Some questions I have:
Why isn't the payload delivered on the first launch for cases 1 and 2?
How can we make this launch the app and deliver the payload instead of going to the App Store?
I've also consulted the Firebase flowchart for the deep link in case 2.
Google Firebase team added support for custom subdomains to Dynamic Links.
You can now specify up to five custom page.link subdomains for your Dynamic Links. Short links using these new custom subdomains look like the following example: https://example.page.link/abcXYZ
Firebase Dynamic Link domains assigned on projects couldn't be deleted at this time.( firebase team is working on it.)
You can now whitelist the URL patterns that can be used as a Dynamic Link's deep link (link) or fallback link (ifl, ipfl, afl, ofl). If you define a whitelist, Dynamic Links won't redirect to URLs that don't match a whitelisted pattern.
You can try both of these features in the Firebase console.
This is not currently possible with Firebase. If you need whitelabeled URLs, you either need to build it yourself or use a more powerful link platform like Branch.io (full disclosure: I'm on the Branch team).
To answer your questions specifically:
I have implemented Firebase Dynamic Links in a testbed app and can confirm that linking through installation the first time does work for both long and short URL variants. There is likely something wrong with your AppDelegate config, so we can take a look at that if you want to share code.
Firebase does not support custom domains at this time. In theory (if you can solve the first issue above) you could get this working for first install by using a redirect like you have tried. However, you'll never be able to get it to launch the app with Firebase link data once the app is installed. This is because Universal Links work based on the domain of the link, and don't even request the web destination. Even if you enable Universal Links manually on your own domain, the app will open immediately without ever calling Firebase and the link data will never be set.

Google Analytics UTM iOS Testing

I have installed Google Analytics SDK using the Google Analytics v3 iOS guide and I have verified that it is hitting analytics through the real time view of the analytics dashboard. I then followed all the campaign tracking v3 iOS guide, including the troubleshooting steps "Self-serve diagnosis for iOS conversion tracking." The IDFA data was getting sent to GA as verified by viewing the "Audience->Demographics->Overview" page, and all the other steps also verified we had set up the tracking correctly. I then submitted the app, waited for review, and tested the install tracking by creating the following UTM link using the google link generator at the bottom of the Campaign tracking guide (note that the link here is bogus data, but shows the general link structure):
https://click.google-analytics.com/redirect?tid=UA-1234-5&url=https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Fmy-app%2Fid123456789&aid=com.company.app&idfa{idfa}&cs=google&cm=cpc&ck=running%2Bshoes&anid=admob&hash=md5
I then uninstalled my app on the phone I was using to test, clicked on the link to get directed to the app store and installed my app from there. I proceeded to wait 3 days and then looked for the install in the "acquisition->sources->all" tab of analytics and did not see the campaign show up. I then looked more closely at the guide, which has the following warning:
"Note: iOS Install Tracking only works for ads served through mobile ad networks, such as AdMob that serves in-app ads."
Which seems to suggest that the only way to verify that the UTM link install gets tracked correctly is by paying an ad network to serve an add in an app and then click on that ad?? That seems absurd. So we did some backwards engineering. In Android, all one has to do is click on the link and the install gets successfully tracked. That suggested that the restrictions imposed by IDFA (an Apple innovation) made it difficult for analytics to serve a 'one link tracks all installs' solution. Looking back at the UTM link, I noted that there is an idfa{idfa} portion that presumably is supposed to include the idfa of the phone clicking on the link, which would only be possible if the app serving the add or some other entity that knows the phone's IDFA number changed the link to include that phone's IDFA. We then obtained the phone's IDFA number through the GA logs and edited the UTM link to include the IDFA number within the brackets so the portion that used to be idfa{idfa} now was idfa{}. We then clicked on that link and are now waiting for another three days to see if it shows up in GA acquisitions... We also made an Admob account and tied it into the analytics account to track the app... but it appears that is just another way to view the exact same information that is presented in the analytics dashboard.
What is the proper way to test UTM campaign tracking? Do I really have to create a mobile add, run it and click it? Should clicking on the link as generated by Google work fine and show up in GA acquisitions, and the absence of its presence signifying my UTM tracking is not working?

Want to track the iOS installs if the user install from Google ADs instead of directly from app store.

I am trying to track source of the App whether it is coming from Google Ads. If it is installed by clicking from Google Ads then I want to get the confirmation when a user registers.
I have followed http://mobileapptracking.com/docs/MAT-Tracking-Methods-For-Mobile-Apps.pdf but can't get any solution.
I guess, you could find the solution here: http://support.mobileapptracking.com/forums/20877789-Integrated-Publishers
It's a set of articles which describe how to add an app publisher (like Google Ads), to view the related statistics, etc.

How can I track referrals with Google Analytics SDK for iOS?

Here I can se how to pass tracking values: https://developers.google.com/analytics/devguides/collection/ios/devguide#campaigns
What I don't understand is how to pass referral info through the campaigns' links and how the app retrieves those parameters when I download the app.
As far as I can tell google analytics does not support referral tracking for iOS at this time. The Apple app store is sandboxed and there is no way to pass a url with referral parameters to the app store and then onto a downloaded iOS app. However, there are a couple sdks that do referral tracking via cookie tracking (Apsalar, MDotM, Flurry) and other sdks that do it via device identifiers (Mixpanel, hasOffers).

Resources