# Preparations (https://docs-fpm2731fy-ton-core-docs.vercel.app/llms/ecosystem/tma/analytics/preparation/content.md)



### Connect the TON Connect SDK [#connect-the-ton-connect-sdk]

Web3 events for the Telegram Mini Apps Analytics SDK are supported by the [`@tonconnect/ui`](https://www.npmjs.com/package/@tonconnect/ui) and [`@tonconnect/ui-react`](https://www.npmjs.com/package/@tonconnect/ui-react) libraries since version 2.0.3, [`@tonconnect/sdk`](https://www.npmjs.com/package/@tonconnect/sdk) since version 3.0.3.

[Read more about TON Connect integration](https://github.com/ton-connect)

Don't worry if your app doesn't use TON Connect; the analytics SDK will still work and collect non-Web3 events.

### Get the token with TON Builders [#get-the-token-with-ton-builders]

Register your project on [TON Builders](https://builders.ton.org) and go to the Analytics tab.

<Image src="/images/tma-analytics/analytics-preparations-1.png" darkSrc="/images/tma-analytics/analytics-preparations-1.png" alt="Analytics tab in TON Builders" />

Enter your Telegram Bot URL and mini app domain to receive an **API key** for SDK initialization. You can also manage your existing keys from the same section. Enter your Telegram Bot URL and mini app domain to receive a token for SDK initialization.

### Initialize SDK [#initialize-sdk]

Now you can initialize the SDK in your application. There are two ways to do this:

* [Install with script tag](/llms/ecosystem/tma/analytics/install-via-script/content.md)
* [Install with NPM package](/llms/ecosystem/tma/analytics/install-via-npm/content.md)
