Skip to main content
Question

How to track purchases made by unauthorised user


customuse
Forum|alt.badge.img+5

Hi RevenueCat community,

We are going to open part of our application to unauthorised users.
And we want our users to be able to purchase a Pro subscription before they even sign up.

Customuse backend handles RevenueCat webhook events and tracks user subscriptions to control access to features. But it works with real user id’s only.

Our thought was that after signing up, we could restore/transfer purchases made by anonymous user to the registered user (with a custom user ID) so that webhook event would be sent to our backend and we could assign the subscription. But it seems that instead of transferring, a simple aliasing takes place, and no webhook events are being sent.

We're sure this is a typical scenario, and would appreciate it if you could advise how to approach this?
How can we check on the backend side whether the user has active subscriptions in RevenueCat at the time of registration?

Sincerely,
Dmitry, Customuse

This post has been closed for comments

2 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 579 replies
  • October 27, 2023

Hi, this aliasing is happening because of how the login() method works, which is if you are logging in an anonymous id and a custom id already exists, then these will be merged: https://www.revenuecat.com/docs/user-ids#login-method-alias-behavior

What you can do is include a flag in your app that checks if you are using login() with an anonymous id, and if you are then you can check their customerInfo for the active subscription: https://www.revenuecat.com/docs/customer-info 


customuse
Forum|alt.badge.img+5
  • Author
  • New Member
  • 3 replies
  • October 27, 2023

@Haley Pace Hi, thank you for the answer!


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