How to create a custom leaderboard

IMPORTANT
This page is obsolete now because we have implemented a native leaderboard. Check out this article to know more: http://support.maitreapp.co/article/77-how-to-show-a-leaderboard


Leaderboard is currently an experimental feature and requires some technical skill to be implemented.

To enable this feature you must set the property require_leaderboard to"true" when initialising the Maître object.

<code><script type="text/javascript"><br><br>  window.Maitre = {<br>    uuid: MFXXXX,<br>    require_leaderboard: true<br>  };<br><br></script>

When require_leaderboard is set to "true", the json object that is sent as response to a form submission will contain the property "leaderboard".

This property is an object that contains two values:

  • last_updated_at: timestamp of the last time the list was updated (lists are updated every 10-15 minutes)
  • ranking: object containing the top 10 subscribers in ascendent order

The leaderboard object will look like this: 

<code>{<br>  last_updated_at: 1460026215,<br>  ranking: [<br>    { email: "m.******om", referred: 19 },<br>    { email: "re******m2", referred: 12 },<br>    { email: "kj******co", referred: 0}<br>  ]<br>}

By default all emails in the leaderboard are modified to prevent malicious activity, but if the subscriber submitting the form is present in the leaderboard, his/her email will be visible.

Please get in touch if you need help implementing this feature.

Still need help? Contact Us Contact Us