question

arda avatar image
arda asked

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
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

·
Citrus Yan avatar image
Citrus Yan answered

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.

3 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.

arda avatar image arda commented ·

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.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan arda commented ·

You can find them in Event History or PlayFab Explorer:

0 Likes 0 ·
1.png (46.7 KiB)
arda avatar image arda Citrus Yan commented ·

Thanks! @Citrus Yan

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.