question

Max Guernsey, III avatar image
Max Guernsey, III asked

Is there a way to make sure experimental variant-assignments are attached to custom events?

Hello,

I have a stream of custom events that get generated by users. Assigning them to experimental variants is difficult because there are no experimental variants on the resulting events in the PlayStream.

Currently, to perform analytics on them, I approximating experimental variant-assignments by joining against another query, in which variants are inferred from experimental variant-assignment events. Then I filter out events that are before their corresponding variant-assignment.

It would be nice if I could just access the variant-assignments directly. However, the following query shows that there are no such data on my custom events:

['events.all']
| where FullName_Name == 'player_report_experience' and isnotnull(ExperimentVariants)
| summarize Count = count()

So I have to do something like this:

['events.all']
| where FullName_Name == 'player_experiment_variants_changed'
| mv-expand Variant = EventData.ExperimentVariants
| extend Variant = tostring(Variant)
| where not (EventData.PreviousExperimentVariants has Variant)
| where Variant in ('<variant 1>', '<variant 2>','<variant 3>')
| project Entity_Id, Variant, ExperimentTimestamp=Timestamp
| join (['events.all'] | where FullName_Name == 'player_report_experience') on Entity_Id

I'm using PlayFabClientAPI.WritePlayerEvent from the Unity PlayFab SDK.

Is that the wrong call to be making? Is there some flag I can set?

Obviously, I've already checked the documentation and haven't found anything.

Is there something I'm missing or are custom player events currently stuck without experimental variant-assignments?

Thank you,

Max

PlayStream
gyiji.png (2.1 KiB)
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

·
Seth Du avatar image
Seth Du answered

Would you try my query?

['events.all'] 
| limit 2000
| where FullName_Name == "player_experiment_variants_changed" and EventData has "ExperimentVariants"
| where EventData["ExperimentVariants"] != "[]"
| project Entity_Id, Entity_Type, EntityLineage_title, EventData["ExperimentVariants"], EventData["PreviousExperimentVariants"]

In addition, PlayStream is very important analytical data for developers, hence it is not recommended to report important data via PlayFabClientAPI.WritePlayerEvent API on your client unless it is used as a debug or administrative tool because there can be abusive use.

player_experiment_variants_changed is an event generated by PlayFab, which doesn’t require actively report. You may also find variants on player_logged_in event.

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.

Max Guernsey, III avatar image Max Guernsey, III commented ·

@SethDu:

Remembering that my question was "Is there a way to make sure experimental variant-assignments are attached to custom events?" I think my takeaway from your response is "No. There's no way to do that with the current API."

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Max Guernsey, III commented ·

No, there is no such API. However, if you want to use Custom PlayStream Events for analysis, you may implement Cloud Script/Azure function and retrieve Experiment Variants from Player Profile and call WritePlayerEvent there.

0 Likes 0 ·
Max Guernsey, III avatar image Max Guernsey, III Seth Du ♦ commented ·

I'm sure there are cases where that makes sense. The event I'm writing is literally a player event in the client. I occasionally pop up a little "how happy are you" dialog and record their answer. So the event originates from the client.

...unless you are saying I could attach the experimental variants to an event generated by the server?

I don't think that's what you mean.

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.