Analytics: some StoreKit 2 purchases still logged automatically, duplicating manual logTransaction events

Author: emilolofssonCreated Sep 23, 2026Updated Sep 23, 2026
Labelsapi: analytics

Description

We migrated to StoreKit 2 (via Unity IAP 5.4.2) and followed the docs by logging purchases manually with logTransaction (through the Unity wrapper LogAppleTransactionAsync(transactionId)).

Expected: StoreKit 2 purchases are either not logged automatically at all (so manual logging is the only source), or automatic and manual events for the same transaction are de-duplicated.

Actual: a small, seemingly random share of StoreKit 2 purchases is still logged automatically, and those purchases then appear twice.

1. Automatic logging still captures some StoreKit 2 purchases

In an app version with no manual logging, 272 in_app_purchase events over 10 days were still logged, all with firebase_event_origin = auto and validated = 1. Compared with the next version, which logs every purchase manually, that's only about 5 to 10% of purchases.

We found no pattern that separates captured from uncaptured purchases:

  • products: consumables, non-consumables and subscription trial starts, 33 products
  • iOS versions: 16 to 27, mostly 26 and 18
  • devices and countries: many iPhone and iPad models, many countries

The purchases happen during normal play, not at launch or on app open.

2. With manual logging, the automatically captured purchases are logged twice

In the versions that call logTransaction, about 8% of in_app_purchase events (309 of 3,967 over 13 days) share a ga_dedupe_id with another event. In 183 such pairs over 7 days:

  • all pairs are on the same device and app version
  • the median gap between the two events is 0 seconds (60% within 1 s, 90% within 3 min)
  • 174 of 183 pairs have identical parameters
  • event_bundle_sequence_id is consecutive, but the events are in different upload batches, so these are two separate logging calls, not a re-upload

That share is close to the automatic-only rate in point 1, so we believe each pair is one automatic event plus our manual one. The docs say manual events aren't de-duplicated, but they don't say which purchases are still logged automatically, so we can't avoid the overlap.

3. Subscriptions

We also call logTransaction for each renewal and trial conversion. None of our in_app_purchase events for subscription products carry a value (they're all free-trial starts with value = 0), so those calls presumably become app_store_subscription_convert / app_store_subscription_renew. These events are also reported by the StoreKit 1 fallback described in https://github.com/firebase/firebase-ios-sdk/discussions/15586, so renewal revenue may be counted twice. We can't verify this in BigQuery, because those events aren't exported.

Questions

  1. What determines whether a StoreKit 2 purchase is still logged automatically?
  2. Is there a supported way to disable automatic in_app_purchase logging on iOS (plist key or API)?
  3. Is ga_dedupe_id derived from the transaction, and are events sharing it de-duplicated in GA4 reports, key events or Google Ads conversions?
  4. For subscriptions, should logTransaction only be called for the initial purchase, leaving renewals and conversions to the StoreKit 1 fallback?

Reproducing the issue

  1. App purchases only through StoreKit 2 (Product.purchase()), with Firebase Analytics integrated.
  2. Call logTransaction once for each verified purchase, before transaction.finish().
  3. Make purchases in production over several days and look at the in_app_purchase events in the BigQuery export.
  4. Group the events by the ga_dedupe_id parameter: about 8% of transactions appear twice, logged a few milliseconds apart.
  5. Without step 2, about 5 to 10% of purchases still appear as automatic in_app_purchase events.

We only see this at production scale and can't reproduce it on demand on a test device, which is why we're asking what triggers the automatic capture.

Firebase SDK Version

12.16.0 (Firebase Unity SDK 13.14.0)

Xcode Version

26.2.0

Installation Method

CocoaPods

Firebase Product(s)

Analytics

Targeted Platforms

iOS

Relevant Log Output

bash

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
json

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
yaml

Replace this line with the contents of your Podfile.lock!

Source: firebase/firebase-ios-sdk