Tracking affiliate generated app installs in iOS greater than 24 hours - ios

I'm trying to run an affiliate project for my app and Apple's 24 hour cutoff makes it a bit difficult. I'm wondering whether there is a way to implement one's own tracking?
I first was thinking a landing page with a phone number input form. Upon submission we'd use something like Twillio to send the user the app store link via SMS and also store the phone number together with the affiliates code from the landing page URL. I then saw that Google somehow let's you track adwords in relation to app installs and thought that perhaps there might be a way that doesn't involve this phone number indirection... Anyone know how they do it?

To be or not to be
The main question here is nature of your intention.
It reasons necessary accuracy / limitations you have on iOS. I see two variants.
100% Accuracy
If you need 100% accuracy, you can use SFSafariViewController - it's view is rendered by another process and it has shareable cookies between your app and Safari. It's iOS 9+ only 100% way to attribute installs. Also you can go with explicit attribution (email, phone number etc.) requested from user after app install. It might be needed if business model relies on this process (like each install is paid out to user account etc.)
You can get an idea and do implementation following this link
<100% Accuracy
If you want to provide greatest UX possible (but it's not critical) or gather analytics (but it allows some kind of deviation) you can go with some approximation techniques, like gathering IP addresses, location etc from requests to your affilate link. The flow can be following:
Your landing page contains dynamically generated link
Upon clicking on link, user metadata is stored (ip, location, device info - whatever can be grabbed from User-Agent or another info available to your web service)
User is redirected to App Store
Upon install and run, app queries your service with device info and ip.
Your web service now decides on attribution. Matching algorithm can include any necessary amount of variables / conditions. Like "Same IP + Device Type + No more than 5 minutes since clicking the link".
This way you don't request any user info (email, phone number) but you're already able to track attribution. Correctness percent is subject to tuning.
Edit #1
This approach might be helpful to you, it's used to attribute login, however you can use modified for analytics.
Edit #2
If you're really wondering, how AdWords does this, you might be interested in install tracking step-by-step guide. It's explicitly stated (section "Instructions for tracking iOS app installs (first open)", p.14) that you should either use AdWords tracking code (this tutorial describes how) or setup server-server integration. So, going back to original questions:
..there might be a way that doesn't involve this phone number indirection?
Yes
Anyone know how they do it?
There are lots of techniques (as well as measurement pixel built on top of mentioned above SFSafariViewController), described in these docs:
Google SDK,
3d-party SDKs

Related

Pass some data to ITunes Store url and get it from application

Is there any known way to pass some data in iTunes Store url:
https://itunes.apple.com/app/id000000000?mt=8
And then get it from installed app?
As I know, Google Play have "referrer" parameter that you can get from installed app, but iTunes doesn't. I need to track installations of our apps, and don't know where to start. Maybe there is a way to link our url and application launch?
Some companies, like Adjust or Appsflyer can do that. How is that possible?
You have a few choices here:
A) you can rely on attribution measurement in Firebase/Google Analytics. This is the way you are asking about. It's for free, but it has some huge limitations like only attributing some sources (no Facebook campaigns for example) and you need to use generally very unreliable UTM parameters with each link.
B) You can rely on AppsFlyer or Adjust which attributes referrer sources on the back-end. So it's agreement between Facebook / Google etc. and AppsFlyer to hand-over that information. It's industry standard and if you have money (you pay for each non-organic attribution, approx. 5 cents per install)

Deep link after iOS app installed (Deferred deep linking)

How can you solve this scenario:
User is using Safari on iOS. They click a link on a website that says
"View Profile on our app". The user does not have the app, they are
taken to the app store to download the app. After they open the app,
the app immediately loads the profile screen (instead of the main
screen).
Currently in order for us to solve this problem, when the app is installed we immediately open Safari to grab the session cookie, if it matches the one on the server we load the right screen. However, Apple is now rejecting our app (and others) for loading Safari at startup.
What is a valid solution that won't get rejected by Apple?
(Also note that we were exploring IDFA - which would have worked - but Apple is rejecting apps that use IDFA if the app isn't using Ads)
This is definitely possible without the IDFA.
Basically, create a URL endpoint on your server that will 302 to the App Store on GET. When a user clicks this link, collect IP Address, OS, OS version, device model, screen size and other parameters and store it as a browser fingerprint.
Then, after the user installs your app, send the same array of meta data to your server as a device fingerprint. Your server can then match this device fingerprint to the browser fingerprint. If there's a match, you can be very certain that the user originated from your link.
Just to give you an idea of numbers, we (at Branch) give this service away for free and now process hundreds of millions of these match queries per day. We've seen that if a user will install, 99% of them will do it within the first 60 minutes. Just empirically, we estimate that this mechanism, with a short window of 2 hours is very close to 100% accurate.
For an added benefit, if you collect IDFA, you can drop a cookie on the browser on redirect and then store the matched pair to the IDFA to create a semi-permanent alternative to the fingerprinting mechanism I mentioned above. If someone clicks your link again, and you've got a cookie stored in the browser, you'll know who they are when they send their IDFA back to your service on install because you've seen that story play out before.
The best solution requires IDFA, which you are in fact allowed to collect for the purpose of deferred deep linking. The "Apple IDFA Scare" was a bit overblown in the media, and Apple revised its T&Cs to make it more clear. Apple also allows you to collect IDFA if you are an advertiser, for attributing installs, or for attributing post-install actions. In other words, you don't have serve ads in your own app in order to collect IDFAs.
Here's a link to the current Apple policy (https://developer.apple.com/news/?id=08282014a ), and this article from AdExchanger goes into a little more detail (http://www.adexchanger.com/mobile/apple-throws-a-bone-to-app-marketers-blesses-idfa-for-attribution/ )

Following a single user across the screen in iOS app

I have an iOS app that is linked to Google Analytics via the iOS SDK for GA
I want to find out from GA, how a single user (who I know has signed up at a specific time, and hence would have gone through some signup sequence of screens) has gone from screen to screen post the signup process
What is the best way to do this in GA? I can see a Behaviour Flow in terms of graphical data, where can I see the actual text log or some kind of line by line data for the same?
Thanks
Maybe it is possible with setting user specific values/keys in GAIDictionaryBuilder,
BUT based on Privacy policy: http://www.google.com/analytics/tos.html
You will not (and will not allow any third party to) use the Service
to track or collect personally identifiable information of Internet
users, nor will You (or will You allow any third party to) associate
any data gathered from Your website(s) (or such third parties'
website(s)) with any personally identifying information from any
source as part of Your use (or such third parties' use) of the
Service. You will have and abide by an appropriate privacy policy and
will comply with all applicable laws relating to the collection of
information from visitors to Your websites. You must post a privacy
policy and that policy must provide notice of your use of a cookie
that collects anonymous traffic data.

Deferred Deep Linking in iOS

We're trying to implement deferred deep linking in one of our iOS applications to encourage users to invite their friends to use the app, and reward users based on how many installs occur from their referral link. Basically similar to TapStream's product.
Consider this example:
So, UserA shares their link, “ourappURL.com/refer?id=userA”, on any
network they want. UserB clicks that link, which will take them to
Safari and then bounce them to the App Store page where UserB
downloads the app.
When UserB opens the app, the app checks which referral ID they came
in on (if any). In this example, the referral ID would be “userA” as
that’s the ID that was in the referral link. The app then sends this to
our servers and we award UserA with a referral credit.
I'm trying to break this issue down into its core parts. I believe the first part is getting the web page for the user's referral link to save the referral ID to the device somewhere that the app can access it. But I'm not sure this is possible because of the sandboxed nature of iOS.
I know this is fundamentally possible because many ad providers offer the ability to track installations from an ad campaign (see Mobile App Tracking for example).
We have also attempted to do this ourselves and I will try to break down the different steps here.
Going back to your example, you are correct about "remembering" the device identification, and all relevant data "id=userA". You are also correct about "sandboxed nature of iOS" which I presume it means a web page is not allowed to store information outside of the browser app (Safari) and apps (your app) are not able to access information stored by other apps (Safari).
Our solution to this is to store this device to data key-value pair in an environment that is both accessible by the browser as well as by your app, i.e. your backend server.
The next challenge, which remains to be the biggest challenge, is how to uniquely identify this device from the information collectable from the browser? Javascripts in browsers, unlike native apps, don't have access to IDFAs which could be used to uniquely identify a iOS device. To overcome this, one can imagine to use a combination of common information that is available both to the browser app as well to your native app, i.e. OS type, public IP, screen size, etc. etc. Please note, a composite key from these data fields does not guarantee uniqueness (imagine two iPhone 6 visiting this web page via the same router). Therefore, your backend server (assuming you are using it to store this key-value pair), will want to have a strategy on how to handle collisions on keys i.e. the second key deletes the first key, or you allow collision to exist by having a queue of values for a single key. This really depends on how you actual plan to use this technology.
The last step is to form this composite key on your app using the exact same fields you used earlier in the browser to perform a "lookup" on your backend server to retrieve the value previously stored.
Here is a summary of the steps:
User 1 invites User 2 by sending the following link to 2: example.com?inviter=1
User 2 visit Web Page P
P constructs and sends the following key-value pair to your server S iOS|55.55.55.55|750×1334 -> inviter_id=1
User 2 goes to the app store and downloads your App A
User 2 first launches A, A contacts S with the same key (assuming the IP hasn't changed).
S finds the value inviter_id=1 by using this key passed in and, let's say, reward User 1 five points for inviting 2.
Hope this help!
Edit 04/24:
Since Derrick mentioned it in the comments, I figure I would take this chance to finish our story here.
Going back to the beginning of my answer where I mentioned we've attempted to do this ourselves. We had a working prototype based on our current system architecture (which is not in anyway optimized, or meant to be optimized, for storing and analyzing deep link data like this), we ultimately decided not to allocate any additional engineering resource into this project.
Due to the heuristic nature of this matching process, we found this project needing debugging, tuning and optimizing constantly for a diminishing ROI. More importantly, we have found other companies which are more specialized and do a much better job than ourselves.
It has been probably 6 months since we stopped using our internal system and we haven't regretted making such decision.
During this processes, we've worked with a number of vendors, Appsflyer, Adjust, TapStream and we have ultimately ended up with Branch Metrics https://branch.io.
Whether you should DIY or work with another company again depends on your specific objective. We finally decided to stay with Branch, not only because the other vendors charged anywhere from $500 to thousands of dollars per month while Branch is completely free, but also the level of the support they have provided is simply unparalleled.
We've successfully used the clipboard (NSPasteboard) to achieve this: the web page that processes the redirect to the app store does a paste to the mobile device's clipboard before letting the user download the app. Once the app is installed, it uses NSPasteboard on first launch to check for an appropriately coded string. This string can contain the text of interest or, more securely, a token used to fetch interesting data from the backend. In Objective C:
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *pasteboardString = pasteboard.string;
The clipboard can be cleared once the app is done with it, to avoid repeating the same action.
There is a good solution here: http://blogs.innovationm.com/deferred-deep-linking-in-ios-with-universal-link/
Basic workflow:
User selects domain link on web.
Link sets referral ID to cookie.
User redirected to app store.
On app launch, load referral page in SFSafariViewController.
Referral page checks for cookie and if it exists calls a deeplink into the app with the referral ID.
My answer from HERE
Apple no longer supports Deep Links. It is now called Universal Links and works a bit differently.
Source
Now that Apple no longer supports URI schemes for deep linking, developers must implement Universal Links in order to deep link properly on iOS. If you are already using URI schemes, check out our blog on transitioning to Universal Links.
From: HERE
And HERE is another article on Universal Links and what they are.

How to create an unique identifier for an IOS device from a HTML aplication

We are building a web based system where there are money involved and we want to avoid fraud implementing a system that is able to identify the IOS device from where the requests are sent.
The reason of this security is because we offer money for execute actions from a mobile and we only want the user to obtain the money once, if we are not able to identify the device the user can execute the action several times.
This unique identifier can use any HTML, JS, server side technique, but not any native IOS call due the application is web based and it runs in a normal Safari instance.
The unique identifier is not needed to be the official UUID.
The system doesn't need to be bullet-proof just a few more difficult to cheat than a normal cookie.
The system should works in separate sessions, like if the user comes back after one week.
Heuristic based systems are welcome, also any combination of LocalStorage with Cookies, ...
The only ways you can identify a unique user/device in a web application is to use cookies and or track the user's IP address.
Of course, the IP address of a device will change as the owner moves around and cookies can be cleared/disabled or will expire after a set time.
Letting web sites access a device unique identifier such as the UDID would be a huge security risk / privacy invasion. If you were to find such a way, I would say that you found a severe security hole in iOS.
If you are only interested in triggering i.e. an email alert when an account is suspected of being stolen, you could use a heuristic based on device type (user agent string) and geo-ip-lookup to detect if the user has suddenly changed device type and continent and ask the user to confirm that this is really the case. I believe this is what e.g. Google and Facebook does.

Resources