question

HectorRodriguezFigueroa avatar image
HectorRodriguezFigueroa asked

Is there a programmatic way or api to add a user to a segment?

I'm curious if you can add a player to a specific segment dynamically based say on some action like for example achievement or item purchase?

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

·
JayZuo avatar image
JayZuo answered

Players are added to a segment based on the filters you've set for that segment. There is no way to add a user to a segment directly. For more info about Segment, please see: https://api.playfab.com/docs/tutorials/landing-players/segments/segment-config. When a player meets the condition in your segment filtering, he will be added into the segment automatically. So you may programmatically change player's data (such as statistic value, virtual currency and so on) to add a player to a segment.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy avatar image Andy ♦♦ commented ·

One quick addition to JayZuo's response. You can use AddPlayerTag to gain a little more control over segmentation. If you use a Tag as the condition for a segment, it's very easy to just add a tag to a player at the appropriate time. There's a bit more in this thread: https://community.playfab.com/questions/22956/putting-players-into-a-segment-based-on-tag.html

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.