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

  • Oct 26, 2026 3:15 AM UTC
  • 4 replies
  • 54 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!

This post has been closed for comments

4 replies

Forum|alt.badge.img+5
  • Active Helper
  • Oct 26, 2026 5:51 AM UTC

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.


Forum|alt.badge.img+1
  • RevenueCat Staff
  • Oct 27, 2026 1:06 PM UTC

Hi ​@agusagus ,

I have received this same question that you sent to us as a support ticket and replied to it. Please check the inbox of the email address you used for the support request for my answer. If anything in that reply is unclear, the easiest path is to continue the conversation in that ticket so everything stays in one place.

 

Best regards,


Forum|alt.badge.img
  • Author
  • New Member
  • Oct 28, 2026 3:37 AM UTC

Thank you everyone for taking the time to help! I've updated my code to include the recommended identity checks and guard pattern before triggering the purchase. Really appreciate all the insights!


Forum|alt.badge.img+1
  • RevenueCat Staff
  • Oct 28, 2026 7:14 AM UTC

​@agusagus Happy to help. Feel free to reach out again if you need anything!