Grabbing the incoming keywords and print them out?

Discussion in 'Programming' started by aronsthlm, Mar 20, 2009.

  1. #1
    This could probably fit in the Google section aswell, but as it's related to programming I believe this is the right place to be.

    What I want to do is get/save the keywords people are searching for and ending up on my website from. Then echo/print it on the same page.

    Let's say someone type in "Buying a new house in New York", and end up on my landing page about "Real Estate NY"-page.

    I want to save that specific keyword and the number of times it has occured and print it out like this:

    "Incoming keywords: Buying a new house in New York (3 searches), Another Keyword (12 searches), Another Keyword (15 searches).

    This INFO is easy to get from Google Analytics - which tracks both keywords, the number of times they have occured, AND which page the user land on when typing in the keyword, so it must be possible.

    But, google analytics doesn't allow me to do it on autopilot. I could, of course, do it manually every day, but with 1000's of keywords it's a bit of a hussle over the long run.

    I have seen other people doing the exact same thing, so it must be possible.

    Does anyone know how to do this? I would use mysql/PHP for the programming.

    Please have in mind that i'm NOT asking anyone to do the job for me, I just need someone to point me in the right direction or provide me with some example.
     
    aronsthlm, Mar 20, 2009 IP
  2. Seraskier

    Seraskier Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I dont think this would work, I just came up with it on the top of my head.

    Get the $_SERVER['HTTP_REFERER'] variable, put it into a variable and then chop up the string.

    for example: http://www.google.com/search?hl=en&q=test+search&aq=f&oq=
    take everything in between &q and &aq then use a for function to seperate by '+' and print.

    Again, I don't think this would work, but its worth a look at.

    Jordan
     
    Seraskier, Mar 22, 2009 IP
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    getting search engine terms was discussed in the asp forum...
    http://forums.digitalpoint.com/showthread.php?t=1251909

    you could then just split the keywords where the spaces are, and load the info into a database(keyword,hits).
    This isn't in PHP, but you get the idea of how it can be done... someone might convert it for you.
     
    camjohnson95, Mar 22, 2009 IP