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
来源:https://stackoverflow.com/questions/46252203/how-to-detect-an-ios-app-install-campaign-inside-the-app