Correct revenue for Apple transactions
Last week we had some problems with the analytics. From the 6th to the 10th of February prices for around 4% of Apple transactions were set to 0 instead of the actual price. It didn’t affect users of your apps or real revenue in the App Store. No data were lost. But charts, cohorts, and other analytics were incorrect.
TL;DR.
It was because of purchases API refactoring that was rolled out on Monday. We found the issue on Thursday and mitigated it, we recovered the correct prices for all affected transactions on Friday. In the future, we will notify you about big internal changes in advance, so if something goes wrong you'll be aware of the possible reasons. And we're sorry we haven't done it this time.
Full version.
It all happened because we rolled out refactoring to purchase infrastructure. It makes purchases API faster and it was a major step to introduce StoreKit 2 support, which will be live soon. We tested it for over 2 months and decided we were ready. We rolled out the update late Monday, monitored everything for a couple of hours and everything was smooth.
There was a small hiccup that caused delays in the integration events (Webhook, AppsFlyer, Amplitude, etc). But it wasn’t critical, we fixed it and all events were sent successfully. Tuesday was very normal, no reports all the metrics looked right.
On Wednesday we started to receive reports from some customers that revenue is going down. We started investigating, checked multiple apps, run the purchase flow with our demo app — couldn’t find an issue. On Thursday we received another bunch of reports, some saying that revenue has fallen 50%+ in the last couple of days.
This is when we found the issue. Purchases (specifically renewals) were recorded in the database correctly first, but when the customer opened the app with a legacy SDK version, the last transaction price was set to 0. We didn’t catch this error while testing because we were using newer SDK versions. And we didn’t notice it right after release because it gradually grew over time when more customers with legacy SDK opened the app. On top of that, it only affected products with free trials.
After fixing this problem (it was pretty easy, too bad we've not noticed it earlier), we recovered the correct prices for most of the affected transactions on Thursday, and the rest on Friday.
Bugs can happen and fortunately, this one wasn't critical, although nasty. The problem is we haven't warned you about refactoring in advance. We're sorry for that. In the future, before making big internal changes to our API, we will notify you.