question

Dave W avatar image
Dave W asked

PlayStream - Segments not running action

Hi,

I'm testing out the segments functionality in PlayStream to see if it's able to report on specific users based on how many days they've been inactive for. I've setup a simple segment as below and click save.



As it notes in the  "What's this?" icon in the top right, this should trigger on a user's first login and grant 10 coins to the user. The Left Segment tab has no action either. 

However, the coins never get granted to new users and the user does not appear to ever enter the segment (checking under the player info ->Segments). I tried setting up a segment based on the criteria of a specific amount of coins - that appears to trigger properly. 

Is there an issue with the segment player filters related to login times?

Please let me know if you need more information.

Thanks!

10 |1200

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

brendan avatar image
brendan answered

There are two issues with this:

The first is that your filter is effectively saying "let me know when the time span since the first login is exactly zero seconds", which makes it extremely unlikely that it could ever fire, since there's going to be a tiny amount of latency before the evaluation occurs.

But the second is that this isn't really a Segment, per-se, since it's "every user who has ever signed into my game". What I would do instead is set up an Action using the player_added_title event - that's the one that only fires the first time a player signs into the title for the first time (account creation is different, as it's the first time the player signs into any title in your Publisher ID).

10 |1200

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

Dave W avatar image
Dave W answered

Hi Brendan,

Our goal with the segments is to create a system where if a user has not logged in for 5 days, then a cloud script call is made which calls a script using http requests on our server, that sends a Facebook web App notification to them to return. 

I was using the example that was given on the What's This? icon on the segment page to test it, but your explanation of why it fails makes sense - that help tip probably should be updated. I changed it to Player first login (time span) >= 0 for testing, and it triggers as expected.

Given our use case, is segments still the best option? Webhooks seems like it'd be a better fit, but it's purely based on events and not the criteria we're looking for as far as I can tell.

Thanks,
Dave

10 |1200

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

Dave W avatar image
Dave W answered

Actually, you note that this is for all titles in my publisher id - is there a way to accomplish what we're looking for per title using segments, web hooks or something else?

10 |1200

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

brendan avatar image
brendan answered

Ah, interesting - I'll work with the tools team to get that updated. The thing is though, setting it to first login > 0 means it's going to fire every single time the player signs in. If that's the intent, great. But I'd still recommend the first login event Action instead, if all you want for that first part is the first time user login.

What I was saying about the Publisher ID is that all your titles share it. The events, actions, and segments are all per-title - it's just that the user account is the same for all of them. That's what allows you to share data cross-title via the User Publisher Data.

But all that aside, yes, Segments are what you're looking for, to accomplish your design goal. The idea is that you would set up a segment where you include the filter of "Last login (time span)" greater than or equal to some value to represent the period of time you need (you mentioned 5 days, which would be 432000 seconds - and we'll have drop downs with hours/days/weeks/months options there later on, the way we do for consumable item definitions in the catalog).

Please note though - non-action filtering (like the one I'm describing above) is coming in the near future. The filter I just described, using last login, won't actually trigger until we've completed the non-action evaluation work we're doing. If you have an urgent need for this, please be sure to email us at devrel@playfab.com with your release date info, so that we can discuss this in more detail with you.

10 |1200

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

PelleB avatar image
PelleB answered

Hey

We are currently trying to do something similar, as in send out a push notification if a player enters a segment, but the actions doesnt execute and segments report that there is players inside the segment, i can test the segment by doing a manual execution which works, but no feedback if it triggers the actions attached to this segment, is this feature still a work in progress? @Brendan

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

brendan avatar image brendan commented ·

What is the definition of the segment? What filters are you using? Bear in mind that a player will be added to a segment one of two ways:

1. An active event. Examples would be logins, purchases, stat changes, etc. If there's an event that says "this just happened", and that's what you're filtering on, the player will be added to the segment (or removed, as determined by your filter) when that happens.

2. On re-evaluation of the segment. This occurs, for example, when a scheduled task runs, making sure the segment is accurate. Think of this as the way a player gets added to a segment if the change is "passive". For example, if one of your filter elements is the time since last login, that cannot be re-evaluated across the entire player base every second. If you have a filter element that does not have an active event, you need to plan for how you're using that segment differently. Using the last login time as the example, you could set up a task that runs every hour and messages players who haven't played for > N, but < N+60 minutes (targeting only players who've hit that one-hour "lapsed" window, so that the message arrives when they normally play).

0 Likes 0 ·
PelleB avatar image PelleB brendan commented ·

Thank you Brendan, that cleared up a lot for me!

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.