Stats

Sending stats

Any event in your game can be sent to Click Jogos, the value is stored in the score of a stat created by you, and later will be used to generate achievements for the user.

The stats can’t have negatives or floating values, so be careful, everytime you send some value to the Click Jogos using our API, it should not have dots or commas.

Stats types Registering stats Submitting Stats

Stats types

Maximum: The stats reported as 'Maximum' will have the value updated only if the value to be saved is greater than previous

Ex: Amount of points at level 3

Minimum: This stat will be updated only if the value to be saved be lower than previous

Ex: Time to complete the level 2

Add: The new value will be added to the value that already exists on the server, this type can be used to create any cumulative stat, this means that this type is more susceptible to submission errors, so we recommend its use only in cases that stats of your game can't be submitted as 'Maximum' or 'Minimum'

Ex: Amount of coins collected in all matches

Replace: This stat always overwrites the previous value on the server.

Ex: Latest score

In most cases, the best choices for sending stats is related to the player's progress. Stats as collected items, running time, user level and battles won, increase the time the player spends logged into your game.

Registering stats

After creating your list of stats, you need to configure them on the server, this can be done through the creation / editing of stats for each of your games in DevCenter

Stats_en

The registration process of stats is quite simple, you just need to insert the stat's name and select a type. Once you have registered all stats on server, it is time to integrate the API in your game.

Submitting Stats

After defining the stats for your game on the server, submit stats using the API is pretty easy.

The API function responsible for sending values to the statistics takes two arguments. The first is the name of the stats as defined, and the second is the value that will be stored.

statName:String

The exactly name of the stat

value:Number

The value that will be converted to integer and stored

salt

The encripted salt parameter in 64-base to authenticate your action. You don't need to send this param if you are using our SWC library

Ex: Submitting several types of stats to site