Author Tracking Code!

When you are on an author.php template page, you should be able to get the current author via $wp_query->get_queried_object(). That is also what is_author() uses when you want to check for a specific author.

Do you also have a question about setting the cookies? I don’t think WordPress has specific cookie functions. wp_setcookie() is deprecated by wp_set_auth_cookie(), but that seems to do more advanced stuff than just set a simple cookie.

If you use a specific visitor tracking system (like Google Analytics) I’m sure you can also save this kind of “lead” info with them. If you want to know more about that, the Pro Webmasters Stack Exchange site is probably a better place.