3

What I want to do is to track the keywords my visitors used in search to land on my page.

For example if you search for stackoverflow and then click on the link, I must be able to recognize using javascript that the user searched for stackoverflow

I tried using the document.referrer. The problem is that from https://www.google.co.in/search?q=stackoverflow&oq=stackoverflow&sugexp=chrome,mod=1&sourceid=chrome&ie=UTF-8

it redirects to http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCEQFjAA&url=http%3A%2F%2Fstackoverflow.com%2F form which I can't access the keywords.

Is there a way to get the previous URL?

Xpleria
  • 5,472
  • 5
  • 52
  • 66
  • 2
    Why not google analytics? http://analytics.google.com – thatidiotguy Sep 27 '12 at 20:26
  • 2
    I'm making a custom tracker for my site. This way I can handle data the way I want. – Xpleria Sep 27 '12 at 20:27
  • See http://stackoverflow.com/questions/6045477/extract-keyword-from-google-search-in-javascript –  Sep 27 '12 at 20:29
  • I don't really know how much better it can be presented than google analytics but ok. You know its free right? And you can output the data in a variety of formats? – thatidiotguy Sep 27 '12 at 20:30
  • 3
    Most of Google search traffic is through HTTPS, so you won't get any information anyhow. – Michael Jasper Sep 27 '12 at 20:34
  • But I'm 90% done with my tracker. I just dont want to login to GA to check my keywords. @user1702584 the problem is that I'm not getting the URL with the keywords. Its redirecting to another URL and then landing on my page. See question. – Xpleria Sep 27 '12 at 20:34

0 Answers0