0

In my email inbox I got URL(http://localhost/sample.aspx) of a website when I click on this link this website open in browser.

Now I have to track on sample.aspx that this website coming from link clicked in email through JavaScript. How can I track that.

For example using document.referrer we can track last visited website URL.

Thanks

Sukhjeevan
  • 3,074
  • 9
  • 46
  • 89

1 Answers1

0

The only mechanism you have for this would be to add a parameter to the querystring, so something like http://localhost/sample.aspx?emailClicked=true

You can then read this on the web site using JavaScript (or anything else for that matter) and track it as you see fit.

You cannot use Document.referrer. Because nothing referrered this link (in the case of outlook for example) or if it did (for example gmail, etc.) you don't know what the URL(s) of the hundreds of referrer's would be.

Community
  • 1
  • 1
Liam
  • 27,717
  • 28
  • 128
  • 190
  • Actually my concern is that Is there any JavaScript object through which we can track that. – Sukhjeevan Jun 16 '14 at 10:40
  • No, there isn't, for the same reasons outlined above. The user clicks a link in an email. Where are they reading the email? Is it the web is it an external email client? If it's the web what's the web site? What's the difference between reading an email on a website or simply clicking a link from another web site, nothing?! – Liam Jun 16 '14 at 10:45