question

Kim Strasser avatar image
Kim Strasser asked

Removing player tags is not working

I get this PlayStream event but the player tag is not removed from the players account.

Raw event JSON
{
    "EventName": "player_tag_removed",
    "TagName": "title.BFD0A.Gold Ticket",
    "Namespace": "title.BFD0A",
    "EventNamespace": "com.playfab",
    "EntityType": "player",
    "Source": "PlayFab",
    "TitleId": "BFD0A",
    "EntityId": "C30AD4505A3C3388",
    "EventId": "79cd968277fc4fd18e9422f152a15de5",
    "SourceType": "BackEnd",
    "Timestamp": "2020-02-05T13:58:45.9481756Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "PlayFabEnvironment": {
        "Vertical": "master",
        "Cloud": "main",
        "Application": "mainserver",
        "Commit": "a41b21a"
    }
}

Why is the player tag still in the players account?

In addition, is it possible to create player tags without the first part of the string "title.BFD0A."? Is it possible to create the player tag like this: "Gold Ticket"?

Is it only possible to remove player tags with code or can I remove player tags manually in the players account too?

private async Task RemovePlayerTagData(string currentplayertag)
{
    var resultprofile = await PlayFabServerAPI.RemovePlayerTagAsync(new PlayFab.ServerModels.RemovePlayerTagRequest()
    {
        PlayFabId = PlayerPlayFabID,
        TagName = currentplayertag
    });

    if (resultprofile.Error != null)
        Console.WriteLine("Error.");
    else
        Console.WriteLine("Removing player tag successful.");
}
Player Data
10 |1200

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

1 Answer

·
JayZuo avatar image
JayZuo answered

In PlayFab, a tag is made up of a Namespace and a TagName. So when you set a tag, you will set the TagName to "Gold Ticket", and our system will automatically add Namespace based on the Title Id, which in your case is "title.BFD0A". And when you get the tag, it would be "title.BFD0A.Gold Ticket", which combines Namespace with TagName. Every tag will have its namespace, there is no way to set a tag with only name. If you only want to display the tag name in your client, you can write some codes to handle this.

And when remove the tag, as the RemovePlayerTag API show, you will need to set the TagName property to its name ("Gold Ticket") not the whole tag ("title.BFD0A.Gold Ticket").

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.