EcosystemTmaAnalytics
Installation via NPM package
Work in progress
This page is a placeholder.
How to install it?
1. Install the NPM package in your project
npm install @telegram-apps/analyticsyarn add @telegram-apps/analyticspnpm add @telegram-apps/analytics2. Add Telegram Mini Apps Analytics in code
Once you have your unique access token (if not, see Preparations page) and installed the NPM package, you can initialize the Telegram Analytics SDK in your code. To ensure that all events are collected correctly, you must initialize the SDK before the application starts rendering. For example, in React applications, before calling the render() function
import TelegramAnalytics from '@telegram-apps/analytics'
TelegramAnalytics.init({
token: 'YOUR_TOKEN',
appName: 'ANALYTICS_IDENTIFIER',
});Supported events
After initializing the Telegram analytics, you are all set to transfer the data, gain insights, and improve user engagement. (99% of them will be tracked automatically without manual control)
Last updated on