How can I tell what keywords people searched for before they viewed a listing?

The best way is to look at your Etsy shop stats or install Google Analytics and enable site search tracking.