Affiliate Linking Tools & Resources App Development Geo-Fragmentation

Swallowing The Cookie: Converting Affiliate Parameters Into The Affiliate Cookie

Last week we began a three-part series taking a look at the behind-the-scenes processes that occur as URLs resolve within an app, and what you, as a developer, can do to ensure both the UX and your commissions are preserved. 

In our final installment, we bring your attention to an uncommon but dirty little devil of an affiliate-related problem we call “Swallowing the Cookie”.  This issue can happen when code has been implemented into an app or SDK to improve the user experience around resolving a link but interferes with correctly setting the affiliate cookie.

By implementing the code that Apple has provided, QA 1629, this issue can easily be avoided. However, if you’re seeing a high number of affiliated clicks, no commissions after waiting for the reporting lag, and have implemented code to keep links from opening in Safari, you could be unknowingly reversing your affiliate-linking efforts:

The Stutter Step
Dealing with URLs inside an iOS app can be complicated. When an app isn’t prepared for multiple http-based redirects, like an affiliate link, the resolution of the URL can sometimes cause your device to jump around between apps, Safari and the iTunes store. 
This user experience faux pas is called the “Stutter Step“, and in a world where providing users with a streamlined UX is not an option, it can cause  a few frowns.
QA 1629
Fortunately for developers everywhere, Apple recognizes this and has provided a snippet of code known as QA 1629 to help reverse this user experience. (At GeoRiot, we’ve even developed a slightly modified version of QA 1629 to better compliment your GeoRiot links.) However, implementing this workaround can cause a few hiccups in your affiliate links if not done properly. 
Swallowing The Cookie
To convert the affiliate tracking parameters into the affiliate cookie, a 301 redirect outside of the app is required.
A common misconception is that the code that handles redirects behind the scenes should “release” the link once its completely done resolving. However, doing this sets the affiliate cookie in the local app, and not in the “shared cookie jar” which the iTunes Store / App Store pulls from when attributing a sale(s) to a specific referrer. Without this redirect, the cookie can’t be referenced by the store on subsequent purchases, and your affiliate link essentially becomes a raw iTunes link. 
In other words, this guy has just “swallowed the cookie”.
Affiliate Link Resolution
Here’s an example of the behind-the-scenes redirects that take place as a affiliate link resolves: 
1.) GeoRiot Link 
 2.) Affiliate Network Link 
3.) iTunes link (with Affiliate Parameters)
— >
4.) Regular iTunes Link (Now With Affiliate Cookie Set
Take note of the last bounce from the iTunes link with affiliate tracking parameters, to a regular looking iTunes link, now with an affiliate cookie – this is the stage where the affiliate cookie is set. 
Assigning Affiliate Tracking Parameters 
Proper Handling
The code to handle the stutter step should release the link as soon as an URL comes up. It’s crucial that this last step takes place outside of the app, as it’s responsible for tagging the user’s subsequent purchases as affiliated, and then accrediting back to the referrer. 
As always, the best way to test if your affiliate link is working correctly is to simply test it from end to end with a purchase from the iTunes Store or App Store.
If you suspect that your commissions are drastically out of line with what they should be, and think that it may be due to “Swallowing the Cookie” then please don’t hesitate to contact the GeoRiot support team.