question

Niklas Lundberg avatar image
Niklas Lundberg asked

Need help with removing alot of inactive users

Hey! I have a project that I have been developing on and off for the last couple of years. Im the only one working on it, and its a non-profit community project for now. I recently crossed the 100k user mark, but the amount of active users is far less than that. At this time, I simply cant afford the 99$ fee by myself, so I need to get rid of old, inactive users to keep myself in the "Development Tier".

I havent quite figured out how to do this though. I get alot of users that just stumble across the app on the Play Store, but since it has a very specific target group, most users just sign in once and then uninstall the app.

I would like to f.ex. remove any user that hasnt been logged in for the past 60 days, AND also dont have more than 2-3 player data entries. Is this possible to do in some automatic way? Im not super familiar with user management - I mostly just use the APIs through Unity.

Thank you in advance!

unity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

Yes, it is possible. You may navigate to [Game Manager] -> [Segments] to create segment which is filtered by the last login time. The time can be configured via date or specified minutes according to your choice. After that, you may create a Scheduled Task and select Type of task as “Run actions on each player in a segment” for the target segment. The Action will be “Delete player”. Please note that “Delete player” is to remove the title player account and will keep master player account (The account quantity limit for the title will only count title player accounts, and this method will work).

Moreover, if this solution doesn’t work due to reasons like task execution failure when there are too many players, you may need to create a local admin tools in Unity to call admin API GetPlayersInSegment first, to retrieve the list of players. Then iteratively calling admin API DeletePlayer for the deletion. (DeleteMasterPlayerAccount API will also do the job, however, you may need to ensure that titles in the same studio don't share data) This will need to process quite a time, I will suggest adding waiting time for each deletion in case the frequency limits is exceeded. Please try to avoid asynchronous API calls, which may directly burst too many calls to exceed the limit. Even though the limits for admin/server API is more tolerant than client API, you may still need to add interval time.

Also please note that last login time is special resource, which won’t continue to update after the segment is saved. If you have processed this once and after few months, it is required for another run, you may need to enter the segment and save again to refresh the data.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Niklas Lundberg avatar image Niklas Lundberg commented ·

Thank you @SethDu ! I will look into that and see which approach is best for me. I would also like to take the amount of Player Data entries into account; is that possible through the [Game Manager], or do I have to use the Admin API inside Unity to achieve that?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Niklas Lundberg commented ·

Segments have filter options in the configuration page. I am not sure how Player Data is counted in your scenario, but Player Data is not one of the filter option.

My suggestions here is to create a scheduled task, which will run for those last login time is long, which is created like what I have mentioned above (I won't recommend the "All players" segment because it is resource wasting). The action will be running a cloud script/Azure function to get any data you want to calculate the 'amount' you have mentioned. Then, create a flag for marking in any forms, for example, add tags for those not qualified.

After that, create another segments, whose have that specific marking tag and create another scheduled task to delete players in that segment.

You may see there are many workaround and I only provide one of these. Please also refer to documentation to figure out your own customized solution:

0 Likes 0 ·
Niklas Lundberg avatar image
Niklas Lundberg answered

Im sorry, I forgot to thank you for elaborating on your reply! I appreciate the time you took to help me :)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ozan Yilmaz avatar image
Ozan Yilmaz answered

@SethDu

I'm about to delete inactive players in my title. I didn't understand the last paragraph of your answer.

Also please note that last login time is special
resource, which won’t continue to update after the segment is saved. If you
have processed this once and after few months, it is required for another run,
you may need to enter the segment and save again to refresh the data.

I created a segment months ago. It now shows me that about 400 players need to be deleted. As far as I understand, if a player in this segment logs in to the game, they won't leave the segment even though the last login will be updated. Is that correct?

By the way, I will use Admin APIs to delete the players. So, I need to get the players in the segment first. Will there be any issue still?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

For now, it is correct. Please always remember to enter the segment and save again, before you perform a batch deletion.

1 Like 1 ·
Ozan Yilmaz avatar image Ozan Yilmaz Seth Du ♦ commented ·

@SethDu I want to ask a follow-up question. The segment I created checks both a statistic (Experience) and last login value. Do I still need to enter the segment and save again?

For example; the segment's rule is this: The experience value is lower or equal than 10,000 and the last login is greater than 30 days. If a player who is in the segment log in to the game and exceed the 10,000 experience limit, do they leave the segment?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.