title: How to track a user coming from a certain URL to trigger a function using JavaScript
body: <p>I am wanting to trigger a function that will display all events but only when the user comes from a URL with /events/ in it. </p>
  
  <p>Right now I am using referrer to take the user back to the page and to scroll to the last event they clicked on. But if the event they clicked on has to be loaded by clicking 'view more' it will just scroll to the bottom of the page. I need all the events to collapse when the user hits the return button.</p>
  
  <p>Any help is much appreciated!</p>