Browser SDK · JavaScript
Install the script on your landing page
Updated November 11, 20261 min
Add the leadli.me script and mark your Telegram button. The product verifies the installation so the SDK can connect an ad click to a confirmed join.
In this guide
1. Get your installation code
Add a channel in the dashboard and complete Telegram and ad-platform setup. At the own-landing step, add your page URL and copy the issued code. With MCP, use leadli_ensure_landing_installation and leadli_get_sdk_instructions for installation instructions.
2. Add the script and button
Insert the script into your page HTML or your builder's custom-code field. Add data-leadlime-subscribe to the Telegram link. Replace every placeholder with the issued values; this example shows the structure.
HTML
<script
src="https://sdk.leadli.me/v1.js"
data-leadlime-route="ROUTE_FROM_LEADLI_ME"
data-leadlime-installation="INSTALLATION_TOKEN"
data-leadlime-fallback="https://t.me/your_channel"
defer
></script>
<a href="https://t.me/your_channel" data-leadlime-subscribe>
Open Telegram
</a>src: the browser SDK URL issued by the product.data-leadlime-route: your channel's route key.data-leadlime-installation: the temporary installation verification token.data-leadlime-fallbackandhref: an ordinary Telegram link available if the SDK fails.data-leadlime-subscribe: marks the element that opens Telegram.
3. Verify and confirm the page
Publish the page and open its exact URL. The SDK must load and find at least one marked button. Return to the dashboard, check the installation state and confirm it.
An origin includes scheme, host and port. https://example.com and https://www.example.com are different origins. Confirm the origin used by your published page.
- For one page, MCP provides
leadli_get_landing_installationandleadli_confirm_landing. Initial setup also hasleadli_get_landing_installation_statusandleadli_confirm_landing_installation. - If the installation token expires, start a new attempt in the dashboard or with the matching restart tool. This replaces the previous token.
- A button click records an attribution click and attempts to get a personal Telegram invite. A confirmed join is verified separately through a Telegram event.
Direct answers
Should I put my MCP access key in this snippet?
No. A route key and temporary installation token are issued separately for the page. Organization keys and Telegram or Meta tokens must stay out of HTML.
What if the SDK is unavailable?
The ordinary link and fallback lead to Telegram. That join may remain unattributed.