Collect data

Data collection is the process of gathering user’s behavioral data such as join, login and purchase during game play or product use. Collected data is used as a basis of data analysis that helps to evaluate the activity and marketability of your game or software product (for example, web site).

Join, Login, and Purchase constitute the basic user actions whose data are being used to produce the core information (also known as Hourglass analysis) about your product such as user activity, attendance frequency, number of buyers, revenue, and average login days.

Here is an example of calling one of data collecting methods that TentuPlay SDK provides. It is sendLogin to send Login information to the server. For more information about methods and parameters, see the API reference section.

Sending login data to server
import { TentuPlay } from '@tentuplay/js-client-sdk';
const tp = new TentuPlay({
	clientKey: "{clientKey}",
});
// Your login function
function myLogin() {
  ...
	// On successful login
	tp.onInit(() => {
		tp.sendLogin({ playerUUID: "<player_slug>" }); // User behavior to send
	});
}
Do you need help?

Contact us at TentuPlay Discord if you have any questions or feedback on the documentation.