Is this possible?

Discussion in 'PHP' started by PoohBear88, Jul 21, 2007.

  1. #1
    Is it possible for a visitor to go onto google and whatever term they used to find me on Google will be relevant to the ads?

    For instance:

    If I searched for 'fishing poles' on Google, can I take that information and serve ads relevant to fishing poles?

    My whole point is to display the most targeted ads possible for the traffic I get from Google.
     
    PoohBear88, Jul 21, 2007 IP
  2. mrmonster

    mrmonster Active Member

    Messages:
    374
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    You can use the referrer information to parse out the search query used to find your site. Then, save it in a session and use the info on all the pages the person is navigation to.
     
    mrmonster, Jul 21, 2007 IP
  3. ds316

    ds316 Peon

    Messages:
    154
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    eregi('google\.com(\.\w+)?/search\?.*q=(^&+)',$_SERVER['HTTP_REFERRER'],$regs);

    urldecode($regs[2]) would contain your search query.
     
    ds316, Jul 22, 2007 IP
  4. OIOplus

    OIOplus Peon

    Messages:
    233
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    To cover a wider range of search engines, see the code in this wordpress plugin (it is generally applicable for any php application).

    You could then possibly put the query keywords into the google_page_url variable (if using adsense). Not sure if it still works for urls that aren't actually real, but it used to!
     
    OIOplus, Jul 22, 2007 IP
  5. PoohBear88

    PoohBear88 Active Member

    Messages:
    904
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    85
    #5
    That tool didn't seem to work on any of my wordpress blogs. I activated it and placed the code on my singlepost.php and page.php pages but I just got errors or it wouldn't show up.
     
    PoohBear88, Jul 22, 2007 IP
  6. Paintball Guns

    Paintball Guns Active Member

    Messages:
    173
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Anyone else know of a way to do this? Seems like a good idea.
     
    Paintball Guns, Jan 14, 2008 IP
  7. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If you already have a fishing pole page that has been indexed by Google, you can 301 to it based on an examination of the search terms Google passes in the referer header.

    However, this may upset Google since you're serving different pages to various users than you are to the indexer.

    You can also just draw a relevant page on the fly, but that wouldn't get you such well-targeted ads. And it's still upsetting to Google.
     
    SmallPotatoes, Jan 14, 2008 IP
  8. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #8
    If you have their SOAP API Key, you can use it to make 1,000 SOAP queries per day, but they've stopped dishing them out.

    Besides, if you screen scape it, you will get googled banned if someone visits your page and constantly refreshes it!

    Jay
     
    jayshah, Jan 14, 2008 IP