Hi there -
I just started experimenting with PlayStream events - loved the functionality, but seem to be running into issues incrementing statistics? In the example in the screenshot, the "player_watched_ad" event correctly fires in the PlayStream following this call in Unity:
PlayFab.PlayFabClientAPI.WritePlayerEvent(new PlayFab.ClientModels.WriteClientPlayerEventRequest { EventName = "player_watched_ad" }, null, null);
However, even though the rule is set up and the event fires, the "totalsAdsWatched" statistic doesn't get incremented. What am I doing wrong?
Answer by pfnathan · Jan 12, 2018 at 10:51 PM
You would need to change your namespace on your “custom event name” to;
EventName = “title.YourTitleID.Player_watched_ad”
PlayFab.PlayFabClientAPI.WritePlayerEvent(new PlayFab.ClientModels.WriteClientPlayerEventRequest { EventName = "player_watched_ad" }, null, null);
Add " title.TitleID.Player_watched_ad" on Rule in the Automation
Apologies for inconveniences, our tutorial on this link https://api.playfab.com/docs/tutorials/custom-events did not get updated correctly.
Thanks! But it then returns the following error:
Field contains invalid characters. Allowable values are ASCII alphanumeric and underscore characters.
I fixed it! It seems I did not need to add title.12345 to the code calling the event (as it was anyway included in the JSON data) but I did need to add it to the rule under the Automation section.
You are correct, thanks for catching this and apologies for somewhat not clear on the guide. You do not need to put TitleID in the write. As you have mentioned, however, you do need to put it in the evaluation of the event. (Automation/Rule)
thank you.