question

giorgiotino avatar image
giorgiotino asked

Automatically delete player accounts without linked identities

TL;DR;

How can I automatically get rid of payer account that, due to specific conditions, do not have any identity linked anymore (thus being virtually unusable and just sitting there forever)?

Are those account even a problem from analytics/server point of view?

Background

Whenever a player downloads and runs the game we use the DeviceID (D1) to retrieve or create a PlayFab account (PF1) and link the DeviceId to it.

Then, within the gameplay, we let the player link additional identities (Facebook, Google/Apple depending on the platform). We do not offer PlayFab account linking.

We store the preferred login method and fallback on DeviceId if none has been linked yet.

NOTE: we do want to immediately and automatically create a PlayFab account linked to the DeviceId, so that's mandatory.

Scenario

Let's say that the player links Facebook account (FB1) to PF1. Now PF1 has two identities linked: D1 and FB1.

The player then somehow relaunches the game with a different DeviceId (new phone, uninstalls/reinstall the app etc...).


A new PlayFab player account is created (PF2), linked to the new DeviceId (D2). The game starts from the very beginning, this being a completely new user.

The player, having already linked Facebook (FB1) to another account (PF1) already logs in with FB1. We retrieve the PlayFab account (PF1) linked to that Facebook identity, and link the current DeviceId to PF1.

Now PF1 has three identities linked: D1, D2 and FB1

Problem/Question

This re-linking operation leaves PF1 without any identity linked, and that account is never going to be used again.

We would like to completely delete those "orphan" accounts without identities, as we feel it's pointless to have them around and they might just mess up our analytics and whatnot.

How do we do this automatically?

Is this even a problem? How do you guys suggest to deal with this issue?

apisAccount Management
1 comment
10 |1200

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

giorgiotino avatar image giorgiotino commented ·

EDIT: "This re-linking operation leaves PF2 without any identity linked, and that account is never going to be used again."

(I can't edit the original question, sorry for the confusion)

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

PlayFab does not provide a mechanism to collect and clear such orphan accounts. If you can confirm a part of accounts are orphan accounts, you can delete them in the administrator tools using admin API DeleteMasterPlayerAccount. In the previous pricing model, non-monthly active users would not affect billing. But in the new pricing model, a development mode title can contain up to100,000 users. We don’t suggest to automatically create a new account for every new device.

For your case, we would suggest changing the login workflow in the clients. For example, you can add options on the login page, let users can choose “have no account, register” and “have an account, log in directly” to avoid creating redundant accounts. When users choose “login directly” you can log users in via client API LoginWithFacebook, then link the new device Ids to their accounts using client API LinkIOSDeviceID or LinkAndroidDeviceID.

3 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.

giorgiotino avatar image giorgiotino commented ·

I was wondering though: is there a way to create a custom segment with players that have NO identities linked, and then use a Scheduled Task to periodically Delete all the players from that segment? I have tried but I don't see any options to identify those orphaned players, but maybe I am missing something?

1 Like 1 ·
John Clark avatar image John Clark giorgiotino commented ·

@Sarah Zhang, I am curious about this also. It would be crucial to be able to create a segment that represents accounts that are orphaned in the new pricing model, so that they can be cleaned up with a cloudscript or other mechanism.

0 Likes 0 ·
giorgiotino avatar image giorgiotino commented ·

Thanks for the answer, I guess we should either avoid creating accounts automatically or manage those orphan account manually then...

0 Likes 0 ·
nobloat avatar image
nobloat answered

Hey all, thought I'd pitch in with an approach that's worked for me. I have a Segment of players that I call "AccessibleAccounts", which is any account that has at least one linked login method. This segment has an Action assigned so that when a player leaves AccessibleAccounts (thus making their account orphaned/unusable) their account is deleted.

First, create a Segment like this and continue chaining clauses together with OR so that all options for "Linked user account to" are included. Select "that ignores email" for each as well.

Add an Action for "Left segment" that deletes accounts once they become orphaned.

The end result from your Segments list should look like this:

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.

nobloat avatar image nobloat commented ·

Whoops, the images I copy-pasted in didn't get posted! Here they are with descriptions in order:

First, create a Segment like this and continue chaining clauses together with OR so that all options for "Linked user account to" are included. Select "that ignores email" for each as well.

Add an Action for "Left segment" that deletes accounts once they become orphaned (at the bottom of the Edit Segment screen). The end result from your Segments list should look like this:

1 Like 1 ·
mattias avatar image mattias nobloat commented ·
@NoBloat

Thank you for this post!

Do you need to supply any Arguments to the Azure/Cloud function? How do you access which master account should be deleted in the function?

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered
@NoBloat

Thanks for the sharing.

10 |1200

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

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.