You can use PHP to track how someone got to a specific page by grabbing the referring page, called the referer. Use this code to get that info:
$myReferer = $_SERVER[‘HTTP_REFERER’];
NOTE: Watch the code above, depending upon my current CSS in my current theme the single quotes or even double quote may change to fancy quotes which will need to be edited if you cut-n-paste the code.
MORE info available on PHP.net’s $_SERVER manual page