question

eric-2 avatar image
eric-2 asked

Analytics - Event not appearing

hi! I am trying to send some custom events to playfab but some of them are not appearing.

for example:

Dictionary<string, object> dataDict = new Dictionary<string, object>(); dataDict.Add("playerid", playID); dataDict.Add("playername", playername);

if (PlayFabClientAPI.IsClientLoggedIn()) { PlayFabClientAPI.WritePlayerEvent(new WriteClientPlayerEventRequest() { Body = dataDict, EventName = "tutorialcompleted" }, null, null); }

nothing appears. there are other events i sent via this format and they are captured by playfab correctly.

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

·
Hernando avatar image
Hernando answered

In the coding, writing a complete callback makes it easy to locate errors and debug them. And console in Unity editor will also provide useful data at the right time. I copied the code you posted and reproduced the error you got:

As its error message says, field playerid is a reserved PlayFab field and may not be overridden. As long as you rename this key, you can successfully generate a custom event.

Besides. is the playerid field in your code used to record the PlayFabId? If so, you can find the event you raised from client in [GameManager]->[Dashboard]->[PlayStream Monitor], and the "EntityId" in event JSON will be PlayFabId you need. Or if you need to use it in CloudScript, PlayFabId has been saved in context.playerProfile.PlayerId.


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.

eric-2 avatar image eric-2 commented ·

ah ok thanks. i tried using a try catch to see the exception but i did not get any exceptions from playfab

0 Likes 0 ·
Andy avatar image Andy ♦♦ eric-2 commented ·

We generally try not to throw exceptions. Instead we return an error in the response payload and let you handle it how you'd like. Throwing exceptions in game engines can be expensive. :)

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.