Forum Discussion

ann_eav's avatar
5 years ago

Custom Badges - badge criteria for date events

Hi everyone!

We are creating some new custom badges to improve our gamification and we have found out with an issue. I hope that someone can help us to find a workaround or to report it as a bug.

We want to create a badge with this criteria:

If the user logs into the community on a specified day of the year, the user gains the badge. Examples: pi day, programmers day, Christmas...

To achieve this, the criteria I was using was:

example: cake day badge:

signin_date >= '2021-2-17'

But I can see here a problem because if I go live with this badge, I won't be able to update the formula because live badges are unable to perform this action. So this badge won't be possible to win in 2022.

Looking through the documentation I can't find a solution to match login date by day and month but not for a year.

https://community.khoros.com/t5/Badges/About-badge-rules-and-supported-badge-criteria/ta-p/117227

How can I achieve this action? Do someone has this type of gamification? How did you achieve this?

Thanks

  • Hi ann_eav,

    Badge rules are pretty limited, despite the seemingly large list of options.

    We did a badge for Star Wars day (May the Fourth) and used this date formula:
    signin_date >= '2020-05-04T00:00:00' AND signin_date < '2020-05-04T23:59:59'

    If we use the same badge again next year, I'll disable global notifications for a minute and grant the badge to users with a particular role- in this case the role will be for those who got the badge in 2020. Notifications will be disabled briefly so there's no confusion on the "new" award. A new badge for the 2021 date will be created and we'll repeat.

    Until there's a better solution, I hope this helps.

    -Drew

9 Replies

  • Hi ann_eav,

    Badge rules are pretty limited, despite the seemingly large list of options.

    We did a badge for Star Wars day (May the Fourth) and used this date formula:
    signin_date >= '2020-05-04T00:00:00' AND signin_date < '2020-05-04T23:59:59'

    If we use the same badge again next year, I'll disable global notifications for a minute and grant the badge to users with a particular role- in this case the role will be for those who got the badge in 2020. Notifications will be disabled briefly so there's no confusion on the "new" award. A new badge for the 2021 date will be created and we'll repeat.

    Until there's a better solution, I hope this helps.

    -Drew

  • ann_eav's avatar
    ann_eav
    Ace
    5 years ago

    Hi Drew_C 

    I think that this solution is very clever! However, I see that maybe you could win the badge two times if you have sign-in in 2021, maybe the new badge created should have a mix of having the role OR sign-in in the date? 

    I know that this is possible but I have never tried it before. If this works, every year a little maintenance would have to be done:

    - Extract the users that have the badge.

    - add them all to the role. Disable the notifications.

    - Delete the badge, and create a new one that checks for the role or the sign-in in the new year.

    - Repeat every year.

    And that way the users would be going to the role eventually and the badge would not be repeated.

     

    However, I really hope that an easier workaround could be found...

     

    Thanks again for the response. Let's see if we can find something more efficient and if not I will mark your answer as the solution!

  • Drew_C's avatar
    Drew_C
    Boss
    5 years ago

    However, I see that maybe you could win the badge two times if you have sign-in in 2021, maybe the new badge created should have a mix of having the role OR sign-in in the date? I know that this is possible but I have never tried it before.

    That's a good point and I'm not sure how I want to handle that yet. I tried combining the role OR date, but there was a problem with that- now I can't remember if it showed up as an invalid formula or if it just didn't work.

    Either way, the automatic badge award options look nice, but don't really play nice when you want to get creative.

  • ann_eav's avatar
    ann_eav
    Ace
    5 years ago

    So, I posted a ticket to Khoros and they don't have te functionality to support date comparison without specifying the year and they don't have complex rules with OR only with AND so the only solution is create a badge every year for the remarkable event dates. Thanks Drew_C for all the help ๐Ÿ™‚ 

  • cblown's avatar
    cblown
    Boss
    5 years ago

    We've experimented with solutions to workaround the various limitations of gamification engine and other things. Some ideas that we may or may not have actually tried from memory. ๐Ÿ™‚ 

    Use an external analytics system to track activities we are interested in, via a custom tracking script. Use the API of the analytics system and our own external API and load this in via http.client(). Then we can set Roles or custom profile settings (which can be used in Badges I think) to create added functions. 

    Use the Bulk Data API and sift through all this data to find the activities we are interested and then (as above) query back what we captured via http.client.

    While this is all possible its just not practical, and having to maintain it isn't ideal.

  • What cblown said is what we are in the middle of doing ourselves. For badges earned outside of Khoros, we are using custom profile attributes to assign these via the API (Example: Once a user earns a certification in our learning system, we write to a khoros custom profile attribute the value of 'True', which in turn gets picked up by the badge logic to assign the certification badge)

    I'm now trying to decide how crazy we take this, and if we do the bulk data/write back values into custom profile attributes to allow us to trigger off more data points. It seems crazy to have to pull data out of Khoros only to push it right back in, but that's the only option in some cases ๐Ÿ˜ž

  • ann_eav's avatar
    ann_eav
    Ace
    5 years ago

    Hi StanGromer, thanks for your reply. 

    The logic that you are describing is very interesting. ๐Ÿ™‚

    Could you tell me the API call to retrieve the users custom attributes? we have asked for the creation of two fields but I can't find the API call to retrieve data of the profile of a user.

  • StanGromer's avatar
    StanGromer
    Boss
    5 years ago

    ann_eav eg: SELECT c_custom_badge_103 FROM users WHERE id = 10

    *Note the "c_" - We had custom attribute called "custom_badge_103" created, but they automatically add the c_ onto them.

    Admittedly, it was a lot of back and forth w/ support to get everything working (I don't think a lot of Khoros customers are doing stuff like this) - 

     

  • Hi @all,

    Is there any badge formula for board specific?

    We want to award a badge to anyone who posts or likes in a particular board. 


    Thanks in Advance!