0

The user followed the link, for example from a telegram application, how can I determine that it was a telegram without passing get parameters in URL?

I visit suit following the link from email, telegram. In $_SERVER['HTTP_REFERRER'] - it's empty.

Vito Bryliano
  • 161
  • 1
  • 5
  • 4
    You can't. You need to either pass a query parameter or have an alternative URL for telegram links (which can log and redirect the user to the main URL). – M. Eriksson Dec 27 '22 at 14:37
  • I hope this link helps you. https://stackoverflow.com/questions/6880659/in-what-cases-will-http-referer-be-empty – slaff.bg Dec 27 '22 at 15:42
  • did you try [Document.referrer](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) ? – Mister Jojo Dec 27 '22 at 16:58
  • You can set a cookie when the user clicks on a link. You would need to remember to unset it after recognising it so all subsequent requests weren't treated as telegrams. Alternatively, you could use a different port on your server for telegrams. – Simon Goater Dec 27 '22 at 17:07

0 Answers0