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 /
  • API and SDK Questions /
avatar image
Question by arda · Oct 15, 2020 at 01:50 AM ·

WriteTelemetryEvents does not working

Hi, I'm trying to send a telemetry event but I'm doing something wrong. Code and debug log when I run this code is attached below.

Note:AccountDataScript.pfContext equals to context returning from OnLoginResult function.

WriteEventsRequest writeEventsRequest = new WriteEventsRequest();
        List<EventContents> contentList = new List<EventContents>();
        EventContents content = new EventContents();
        PlayFabAuthenticationContext context = new PlayFabAuthenticationContext();

        context.EntityToken = AccountDataScript.AU_CONTEXT.EntityToken;
        context.EntityType = AccountDataScript.AU_CONTEXT.EntityType;
        context.EntityId = AccountDataScript.AU_CONTEXT.EntityId;
        context.ClientSessionTicket = AccountDataScript.AU_CONTEXT.ClientSessionTicket;
        
        Debug.Log("Entity token::" + AccountDataScript.ENTITY_TOKEN);
        Debug.Log("Entity ID::" + AccountDataScript.ENTITY_ID);
        Debug.Log("Entity Type::" + AccountDataScript.ENTITY_TYPE);

	content.Name = "player_game_started";
        content.EventNamespace = "custom";
        content.Entity = new PlayFab.EventsModels.EntityKey();
        content.Entity.Id = AccountDataScript.ENTITY_ID;
        content.Entity.Type = AccountDataScript.ENTITY_TYPE;
        contentList.Add(content);

        writeEventsRequest.Events = contentList;
        writeEventsRequest.AuthenticationContext = context;

        PlayFabEventsAPI.WriteTelemetryEvents(writeEventsRequest, CustomEventResult_Telemetry, OnPlayFabError);
Entity token::M3x7ImkiOiIyMDIwLTEwLTE0VDEyOjE3OjQwLjY0NDA0MDVaIiwiaWRwIjoiRmFjZWJvb2siLCJlIjoiMjAyMC0xMC0xNVQxMjoxNzo0MC42NDQwNDA1WiIsImgiOiI0OEVCOTI2RkYyMTY4QjU4IiwicyI6Ilh2Qkc4RHZrSm1nd2lBM0RSellMdW1aSm4zckJWSlliVzd1STEvcXBOM009IiwiZWMiOiJ0aXRsZV9wbGF5ZXJfYWNjb3VudCExLzhGNUEvMkQ1MDY5Q0Q1RTE2MkRDQi84RkNCMTgyRjcwNjkyNjExLyIsImVpIjoiOEZDQjE4MkY3MDY5MjYxMSIsImV0IjoidGl0bGVfcGxheWVyX2FjY291bnQifQ==
Entity ID::8FCB182F70692611
Entity Type::title_player_account
error.ErrorMessage: Invalid input parameters
error.ErrorDetails: System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[System.String]]
error.HttpCode: 400
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 Citrus Yan · Oct 15, 2020 at 05:09 AM

It seems that you didn’t specify the “Payload” or ”PayloadJSON” property in EventContents, one of them must be defined in order to call WriteTelemetryEvents.

Comment
arda

People who like this

1 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 arda · Oct 15, 2020 at 07:01 AM 0
Share

It's working perfectly now thanks @Citrus Yan , where can I find the telemetry events I sent on Playfab dashboard? PlayStream doesn't show them, also I didn't noticed anything about it on "Reports" section. Thank you.

avatar image Citrus Yan ♦ arda · Oct 15, 2020 at 07:18 AM 0
Share

You can find them in Event History or PlayFab Explorer:

1.png (47.8 kB)
avatar image arda Citrus Yan ♦ · Oct 15, 2020 at 07:21 AM 0
Share

Thanks! @Citrus Yan

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

    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