https://www.desidime.com/discussions/how-to-check-telegram-subscriber-referred-by-which-person?page=1#post_9274856
Like creating personalized invite links
Like creating personalized invite links
If it is public, you can't know from where people are coming from, but you can create invite links and share in different places. Name it appropriately so that you'll know from which source you're getting subscribers.
If it is private, you can create links like above.
If you want user specific tracking then make the channel private, announce a bot name in the channel and code it in such a way that it generates a bot link with the user identifier. So when someone uses that bot link, bot should save the referrer and referee id. And then it provides an invite link.
Personalised invite link is open source on my GitHub but not refer functionality. DM me for quote on a custom bot.