Javascript
The vanilla Javascript library collects events as effeciently as the Telemetree React SDK while being framework agnostic.
Getting started
System Requirements
- A Telegram Mini App project or a website set up with Javascript
Installation
- Place these scripts before the closing
<head>
tag in your tempate or call it accordingly to your framework of choice practices:
- And inside the
<body>
initialise Telemetree with your credentials like so:
- That’s it! Now you can add custom events with
telemetreeBuilder.track
function transfering any type of valuable information required for the further analysis:
Default set of events like pageload is automatically tracked and collected by the library and you don’t need to specifically wrap those unless you want custom data to be collected on such actions.
You can use Telemetree React SDK and Telemetree Pixel simultaniously in your app if for some reason you have to. Just make sure to avoid data duplication problems.
User data and Processing
Adhering to Telegram’s high standards of security, we employ RSA encryption for the transmission of data across networks, ensuring both the integrity and safety of your analytics processes. You can learn more in the dedicated section of Documentation.
Debugging
- Use browser developer tools to monitor network requests and confirm that events are being sent to Telemetree.
- Add console logs in your event handling functions to verify that events are being triggered as expected.
Using Telemetree Pixel with Google Tag Manager
- In your Google Tag Manager interface, create a new Tag with a name
tag_pixel
like so:
(Also set Triggering
to All Pages
if that’s your goal.)
- In the Variables section of the Tag Manager interface, create a new variable with a name
config
and your credentials like so:
Now you can Preview and Publish this container.
Configuring custom events works exactly the same as in the vanilla Javascript library:
Other options
We also provide a Python SDK for tracking backend related events.