Documentation

Get your project key, drop in the SDK, and start tracking. Your data arrives in Telegram.

Quick Start

1

Get your project key

Open @MyTelegramAnalyticsBot in Telegram and type /add yourproject.com. The bot replies instantly with your API key.

2

Add the SDK

Pick your platform below. Initialize once with your key, then track events anywhere.

3

Ask the bot

Type /report signup 7d or /alert tell me every purchase. Charts and alerts arrive in your chat.

SDK Setup

One project key works across all platforms. Events from your web app, mobile app, and backend all flow into the same Telegram reports.

JavaScript / TypeScript

npm install or drop in a script tag. Works in React, Vue, vanilla JS, and server-side rendering.

// npm install tgram-analytics
import { TGA } from 'tgram-analytics';

// Initialize once
TGA.init('proj_xxx');

// Track events
TGA.track('signup', userId, { plan: 'pro' });
TGA.track('purchase', userId, { amount: 49 });

Flutter / Dart

Add to pubspec.yaml. The SDK buffers events before init, so you can track anywhere.

// flutter pub add tgram_analytics
import 'package:tgram_analytics/tgram_analytics.dart';

// In main():
void main() {
  TGA.init('proj_xxx');
  runApp(MyApp());
}

// Track from anywhere
TGA.track('purchase', userId, properties: {'amount': 49.99});

Python

Sync and async support. Great for Django, FastAPI, or background jobs.

# pip install tgram-analytics
from tgram_analytics import TGA

# Initialize
tga = TGA("proj_xxx")

# Track events
tga.track(
    "subscription_created",
    session_id=user.id,
    properties={"plan": "pro"}
)

Bot Commands

Everything happens in Telegram. No dashboard to open, no login to remember.

Command What it does Example
/add <project> Create a new project and get an API key /add myapp.com
/report <event> <time> Get a chart and totals for any event /report signup 7d, /report error 24h
/alert <message> Set up alerts for events or thresholds /alert tell me every purchase, /alert every 50 signups
/schedule <message> Get reports automatically on a schedule /schedule weekly summary every Monday
/projects List all your projects and keys /projects
/help Show all available commands /help