Just wanted to write this down to remember. Using JavaScript to detect or pass in a form the keywords used on google to enter a site.
- wait 25ms or so after the page loads in order to give the filesystem time to write the cookie. (setTimeout)
- read and parse the _utmz cookie * __utmz tracks where a visitor came from (search engine, search keyword, link)
- set a hidden variable if passing along in a form, or do your magic with the data.