Discussion - Promotions
-
Thank you for the quick reply. You got it right for your What do you mean "as available" clarification, thank you for the answer.
I generally have a clearer idea now, but at this point I believe I have an issue with automated promotions:Yesterday I created a new segment for users with a login count greater or equal than 20, and an automated promotion that triggers for users that enter that segment. The User I'm using met the required login count this morning, but that promotion still isn't available for him. I have an active scheduled promotion that works just fine and I'm able to get its data from Braincloud, it's just the automated ones that are causing problems.
We're using BC for a game made with Unity, I don't know if this info is useful but if you need more data on our project I'd be happy to share it with you, in the meantime I'll wait for the rest of the clarifications, thank you in advance.
Francesco.
-
Hi everyone, I managed to get an automated promotion to show up on my User.
The automated promotion had a duration of 100000, it was an exaggerated value to just have it always available, and after setting it to 8 it immediately showed up on my User's elegible promotions list.
It seems like the max duration accepted by the system is 596 hours.I don't remember seeing a reference to a max duration on the official documentation, can you tell me more about this?
Francesco.
-
@francesco-lenolli
Excellent observation! You are correct. Our server-side validation was set to filter out any duration above 596 hours and mark it as "expired". However, we have thoroughly reviewed this validation and have since removed it. This patch will be deployed to our server today, meaning a duration limit will no longer exist. We appreciate you bringing this to our attention. Thank you. -
@JasonL
Looking back, I realized I forgot to mention a couple of things—sorry about that. I'll list them here:-
Is there a way to determine how many purchases a user has made of products affected by a given promotion? This is especially relevant for automated promotions, which have a "max purchases" value but no "purchases left" value in their data structure.
-
For automated promotions again, is there a way to check how much time is left before a promotion is disabled? A Unix timestamp indicating when the promotion became active would be useful for this purpose.
Both values would be helpful for displaying accurate promotion data to the user across multiple sessions.
-
-
@francesco-lenolli
For both of your questions, a single call --GetEligiblePromotions()
will do the work. It will return the values ofmaxPurchases
and the caller'spurchased
, as well as the Unix timestamps fortriggeredForUserAt
and 'expiresForUserAt` for automated promotions.