question

alireza95 avatar image
alireza95 asked

Add Tag to player

I want to add a tag to a player calling a cloud script to do this since its only exposed in the server api and this is what i did but it doesnt work so what is the correct way i saw somewhere instead of TagName it said TagValue so this might be the issue but i took TagName from here :

https://api.playfab.com/documentation/Server/method/AddPlayerTag


handlers.onRegister = function (args, context) {


  
  var tag = args.tag;


    var request = {
        PlayFabId: currentPlayerId, 
      	TagName : tag
    };


    var playerStatResult = server.UpdatePlayerStatistics(request);
};


sdks
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

·
brendan avatar image
brendan answered

The AddPlayerTag request actually works fine from Cloud Script. In the code above though, you're calling UpdatePlayerStatistics. Can you try changing that to AddPlayerTag?

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.