question

adrianvoinea avatar image
adrianvoinea asked

Timed Segment Overrides (for stores)

Hello,

Long story short, I would like to run a limited campaign, using a segment override over a store which contains a promotion.

Is there any way to time it automatically (let's say I want it to run for 48h sharp from the moment I push it)?

Thanks,

Adrian

10 |1200

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

adrianvoinea avatar image
adrianvoinea answered

Hey.

Thanks for the answer.

I have the following issues with the scheduled tasks, and thus with the workaround above.

1) The scheduling system doesn't seem to be working properly. I cannot make a schedule task to execute. It just passed over the date of the execution, and does nothing. Running it manually works fine.

The schedule task id is: 305B91696598C43E and my title id is F457

2) You cannot set a statistic value. You can only "Increment Player Statistic". Which is a big problem, as that means that you need to schedule an increment with a minus sign. This causes some issues.

(Activate increments a statistic with 1, Deactivate can only increments the same statistic with -1)

3) If any player comes in after the Activate Promo task has happened, he will not see the promo, because the activate task has ran.

Further more, because of issue 2) and 3) above, when the Scheduled Task that disabled the promo flag comes, he will have his "promo" statistic set to -1 (because of issue 2 above).

That means, any player that comes in during the campaign will never be able to see any promo campaign ever again, because the next campaign, he will have his flag incremented back by 1, which will set him to 0.

Thanks,

Adrian

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.

adrianvoinea avatar image adrianvoinea commented ·

Temporarily, I will be working with increments of 10.

Activating a campaign (the fist time) will increment by 1, Deactivate it will increment by -10.

Second campaign will increment it with 100, and Deactivating with 1000, and I will adapt manually the rules of the statistic after the campaign.

And so forth for the 3rd campaign, 4th campaign, etc.

And, for users coming during the campaign, I will be running the "Activate" task once a day for the duration of the campaign.

This will limit me to running campaigns shorter then 10 days but it should cover it...

However, the above approach is extremely susceptible to human error.

If you have another suggestion, I am looking forward for it.

0 Likes 0 ·
brendan avatar image brendan commented ·

We'll be adding event management to the service in a future update, but your item 3 is the reason I'd advise against doing it this way. The other issue is that it's going to take non-zero time to iterate across all players, especially as your player base grows. What you may want to do instead is use a cron job running on a local machine to use the Admin API to make the changes you need to your store, instead. For your items above, though:

1. I don't follow. Your deactivate promotion ran at the scheduled time.

2. That's actually the way it's intended to work - you specify a negative number to subtract. As you've seen in your testing, that does work to do this.

3. Correct - see above.

0 Likes 0 ·
akirachen avatar image
akirachen answered

For your question, you can solve it by creating a new temporary segment, and making use of schedules tasks as a timer.

Here is a workaround :

  1. Add a new statistic as an identifier named IsInCampaign.
  2. Create a new segment which have totally same conditions of your aimed segment.
  3. Add IsInCampaign statistic to conditions of your new segment. (For example, when IsInCampaign equal to 1 )
  4. In Automation -> Scheduled Tasks , create 2 tasks.

    The first one is setting All players’ IsInCampaign statistic to 1. Your aimed players can be added into your new segment, and show correct prices you set. You can run it whenever you want to start the campaign.

      The second one is setting All player’s IsInCampaign statistic back to 0. Enter in the task setting, click Schedule, modify Schedule from manual to recurring. Set the time as year, after that you could set the accurate endpoint of your campaign. (Notice: this script will run per year if you forget to delete it. It is better for you to set it back to manual after your campaign). When this task finished, players will be removed from new segment automatically and their prices will restore.

      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 ·

      Thanks for providing that workaround, AkiraChen! I've marked it as an answer for now.

      I'll add that we've heard multiple requests for easier configuration and management of scenarios like this and it's something we're working on for a future release. If there are specific things you'd like to be able to do in your game within a given time window, let us know so that we can be sure to consider inclusion in our future work.

      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.