Skip to main content
Question

[Flutter SDK] Transactions attached to new $RCAnonymousID instead of identified app_user_id (and missing $email) despite enforced login before shop access

  • October 26, 2026
  • 1 reply
  • 11 views

Forum|alt.badge.img

Hi everyone,

I am using the RevenueCat Flutter SDK (purchases_flutter) on Android (Google Play Store) in my game. I am encountering an intermittent issue where purchases are occasionally attributed to a newly generated $RCAnonymousID at the moment of purchase, even though Purchases.logIn("2585") is executed during app initialization.

Important Context: In my game architecture, users cannot access or open the shop page unless they are fully signed in. Therefore, an anonymous purchase flow should theoretically be impossible under normal user operation.

Additionally, right before a user selects a product to pay, I explicitly call Purchases.setEmail(). However, when this bug occurs and the purchase is unexpectedly assigned to an anonymous ID, subscriber_attributes in the webhook payload remains completely empty (no $email present).

This issue happens rarely; in most cases, the Flutter SDK works as expected and attaches purchases to the logged-in app_user_id.

Timeline of Events (from Dashboard Logs)

  • 04:14 UTC – First seen or purchased (App launched, user logged in, Purchases.logIn("2585") executed).

  • 14:30 UTC – User opened shop (passed login check), selected a product (called setEmail()), and completed purchase of coin_pack_large for IDR 79,000.

  • 14:34 UTC – RevenueCat created a new alias ($RCAnonymousID:05274ada113f4728a66e925xxxxx).

  • 14:38 UTC – Last opened the app.

 

App User IDs:

  • Original App User ID: 2585

  • Alias #1: $RCAnonymousID:05274ada113f4728a66e925xxxxx

 

Raw Logs

1. RevenueCat Webhook Payload (Received at Backend)

{
"level": 30,
"time": 1792938843897,
"pid": 1554,
"hostname": "srvxxxxxx",
"event_timestamp_ms": 1792938842985,
"product_id": "coin_pack_large",
"period_type": "NORMAL",
"purchased_at_ms": 1792938603674,
"expiration_at_ms": null,
"environment": "PRODUCTION",
"entitlement_id": null,
"entitlement_ids": null,
"presented_offering_id": null,
"transaction_id": "GPA.3314-xxxx-xxxx-xxxxx",
"original_transaction_id": "GPA.3314-xxxx-xxxx-xxxxx",
"is_family_share": false,
"country_code": "ID",
"app_user_id": "$RCAnonymousID:05274ada113f4728a66e925xxxxx",
"aliases": [
"$RCAnonymousID:05274ada113f4728a66e925xxxxx"
],
"original_app_user_id": "$RCAnonymousID:05274ada113f4728a66e925xxxxx",
"currency": "IDR",
"price": 4.37,
"price_in_purchased_currency": 79000,
"subscriber_attributes": {},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"tax_percentage": 0,
"commission_percentage": 0.15,
"metadata": null,
"renewal_number": null,
"discount_percentage": null,
"discount_amount": null,
"discount_identifier": null,
"type": "NON_RENEWING_PURCHASE",
"id": "EF6CB83D-xxxx-xxxx-xxxx-15F618F22514",
"app_id": "appxxxxxxxx",
"msg": "RevenueCat webhook received"
}

2. Backend Error Log

{
"level": 40,
"time": 1792938843897,
"pid": 1554,
"hostname": "srvxxxxxx",
"eventId": "EF6CB83D-xxxx-xxxx-xxxx-15F618F22514",
"transactionId": "GPA.3314-xxxx-xxxx-xxxxx",
"appUserId": "$RCAnonymousID:05274ada113f4728a66e925xxxxx",
"msg": "RevenueCat purchase skipped: user could not be resolved by app_user_id or email"
}

3. RevenueCat Activity Log

Last opened the app: 2026-10-25, 2:38 p.m. UTC
Created a new alias $RCAnonymousID:05274ada113f4728a66e925xxxxx: 2026-10-25, 2:34 p.m. UTC
Made a purchase of coin_pack_large for IDR 79,000: 2026-10-25, 2:30 p.m. UTC
First seen or purchased: 2026-10-25, 4:14 a.m. UTC
Original App User ID: 2585

My Questions

  1. What underlying Flutter SDK behavior or network condition could cause RevenueCat to silently lose an authenticated session and generate a new $RCAnonymousID during purchase execution, even when the user is strictly logged in before entering the shop?

  2. Why are subscriber attributes set via Purchases.setEmail() in Flutter missing from the webhook when this fallback occurs? While I prioritize resolving transactions using the original App User ID over email, I added setEmail() as a fallback—only to find that the email attribute is also empty when the $RCAnonymousID is sent.

  3. What is the recommended guard pattern or API call in Flutter to ensure identity and attributes are fully flushed/synced before triggering Purchases.purchasePackage()?

Any help or suggestions would be greatly appreciated. Thank you!

1 reply

Forum|alt.badge.img+5
  • Active Helper
  • October 26, 2026

Are you awaiting Purchases.logIn() and handling errors before allowing purchases? Check Purchases.appUserID immediately before setting the email and again before purchasing, and stop if it doesn’t match the signed-in user. Also check for later logout calls or repeated SDK configuration.

Could you share your purchases_flutter version and the configure/login/purchase code, including any logout calls? Redacted SDK debug logs would help show when the ID changes. Remove emails, tokens and customer identifiers before posting.