Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by corporate · Jan 12, 2018 at 09:06 PM · Leaderboards and StatisticsPlayStream

Incrementing statistics from PlayStream events doesn't seem to work?

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?

playstreamaction.png (26.6 kB)
Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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.

Comment

People who like this

0 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image corporate · Jan 13, 2018 at 02:40 PM 0
Share

Thanks! But it then returns the following error:

Field contains invalid characters. Allowable values are ASCII alphanumeric and underscore characters.
avatar image corporate · Jan 13, 2018 at 02:45 PM 0
Share

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.

avatar image pfnathan ♦ · Jan 13, 2018 at 11:50 PM 0
Share

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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Recommended Method for Cost-Based Player Display Name Changes? 1 Answer

    My PlayStream doens't work [Photon Addon] 1 Answer

    fuzzy search OR Partial DisplayName search 1 Answer

    Leaderboard/Analytics - trying to understand better. 1 Answer

    Adding a Leaderboard to my UE4 BP Project 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges