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.

  1. wait 25ms or so after the page loads in order to give the filesystem time to write the cookie. (setTimeout)
  2. read and parse the _utmz cookie * __utmz tracks where a visitor came from (search engine, search keyword, link)
  3. set a hidden variable if passing along in a form, or do your magic with the data.
Kategori: JavaScript

Search My Site