I need my users that come from a specific external website to be redirected to a page in my site once they click a button.

Example:
  1. User clicks link on a page in site A leading to site B
  2. Once there, user clicks a link that will send only users that came from site A to the specific pages.
  3. All other users that did not come from site A will be redirected to another page from the users that did.



THIS NEEDS TO BE IN STRICTLY JAVASCRIPT AND HTML ONLY.