Skip to main content

Issue with Anonymous app_user_id on Webhook Breaking Subscription Flow

  • December 12, 2024
  • 1 reply
  • 30 views

Forum|alt.badge.img+3

Hi ​@joan-cardona,  ​@Haley Pace 

I am facing an issue with the configuration of appUserId and API key while using the RevenueCat SDK for subscriptions. Currently, I am configuring appUserId and API key multiple screens to ensure that the SDK receives the correct data at the time of subscribing.

I have integrated Sentry logs for the purchases.getCustomerInfo() call and am logging this information within the onPurchaseStarted event on the RevenueCat paywall. From the logs, I can confirm that the originalAppUserId is being set correctly and as intended.

However, on the webhook, the app_user_id appears as an anonymous user ID instead of the configured appUserId. This discrepancy is breaking our subscription flow, leading to a poor user experience and dissatisfaction among our users.

Could you please help identify the root cause of this issue? Additionally, I would appreciate any suggestions or best practices for ensuring that the correct appUserId is passed consistently through the webhook.

We make payments only for logged in users, not for the users who are not logged in, we are sure about this, because after sometime on revenue cat dashboard, the email was reflecting and showing an alias of appUserId with correct one and intended. This is not helpful at that time as the webhook is not having the right data.

This was happening only on ios till now. Looking forward to your guidance on resolving this matter.

This post has been closed for comments

1 reply

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 509 replies
  • December 16, 2024

Hi,

Currently, I am configuring appUserId and API key multiple screens to ensure that the SDK receives the correct data at the time of subscribing.

You only want to configure the RevenueCat SDK once in the lifecycle of your app, doing this multiple times will create multiple instances of the Purchases object which will cause unexpected behavior and can break the app.

 

However, on the webhook, the app_user_id appears as an anonymous user ID instead of the configured appUserId. This discrepancy is breaking our subscription flow, leading to a poor user experience and dissatisfaction among our users.

Could you please help identify the root cause of this issue? Additionally, I would appreciate any suggestions or best practices for ensuring that the correct appUserId is passed consistently through the webhook.

Anonymous users are created when configure() is called without an app user id or if logOut() is called. To avoid anonymous users, please follow our guide here: https://www.revenuecat.com/docs/customers/user-ids#how-to-only-use-custom-app-user-ids. Only using custom app user ids will ensure that the app user id in the webhook is the same and that you do not need to worry about anonymous users. If you do want users to be able to use our app without logging in, then anonymous users will be generated and will alias with the custom app user id based on the logic here: https://www.revenuecat.com/docs/customers/user-ids#login-method-alias-behavior. When looking at webhooks, you can also check the alias array for the custom app user id if the one being shown in the app_user_id field is the anonymous one.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings