PHP Script For Capturing Exact Searches

Discussion in 'Google AdWords' started by ominc, Nov 13, 2006.

  1. #1
    Can anybody point me in a direction of a script that captures exact search of the keywords used when someone clicks on one of my adwords campaigns?
     
    ominc, Nov 13, 2006 IP
  2. fastimprovement

    fastimprovement Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming you're only talking about Google, then here's the relevant bit you need:

    $referer = $_SERVER['HTTP_REFERER'];
    $matches = array();
    preg_match('/q=(.+?)&/', $referer, $matches);
    if (isset($matches[1]))
    {
    $search_term = ucwords(strtolower(urldecode($matches[1])));
    }


    If you need more help, just let me know.

    H
     
    fastimprovement, Nov 13, 2006 IP
  3. IntelliGuy

    IntelliGuy Banned

    Messages:
    42
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    HTTP referer may not be always available. A solid technique is:

    1. Add {keyword} to you adwords ads destination URL as: http://www.example.com/landing-page.php?kw={keyword}. Do NOT use actual keyword you were bidding for, use the exact word {keyword} including curly braces. Google will automatically replace it with the actual search term or phrase.

    2. Retrieve kw query value from landing-page script from $_GET global array which contains the exact search term or phrase.

    Its will always work.
     
    IntelliGuy, Nov 14, 2006 IP
  4. fastimprovement

    fastimprovement Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Absolutely correct. However ...

    ... this gets the keyword that is *matched* i.e. the term you're bidding on, which may or may not be what the searcher actually typed in the search box, and technically wasn't actually the original question in this thread :)

    ... BUT I agree with you that this is a better option.

    H
     
    fastimprovement, Nov 14, 2006 IP
  5. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This was good information, I will add it to my site's reporting when I get round to it. Useful info.
     
    Kalyse, Nov 15, 2006 IP
  6. IntelliGuy

    IntelliGuy Banned

    Messages:
    42
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No dear, {keyword} matches the exact search phrase, not just the keyword we bid on. Here is its some unofficial description.

    http://www.adwordmiracles.co.uk/articles/2006/10/16/how-to-con-adwords-visitors-into-believing-you-have-what-theyre-looking-for-guaranteed/

    But, bad news, its seems to be not working now due to new Adwords Quality Score algorithm. See the latest adwords articles on the site.
     
    IntelliGuy, Nov 18, 2006 IP
  7. fastimprovement

    fastimprovement Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I had to go and have another look at that post, because that's *my* site :)

    <giggle>

    I didn't think I had said it matches the search phrase, but I guess it could be misread if we don't establish the definition of the terms that we're using ...

    So, for the rest of this post:

    search term = what the google user types into the search box
    keyword = the keyword or keyword phrase that an advertiser bids on
    ad text = the creative ad that the advertiser writes which shows up on the right hand side of Google's search results

    {keyword} *doesn't* return the search term, {keyword} returns the keyword that triggered an impression of the ad text.

    So, if the keyword = "google", and search term = google adwords, {keyword} would return

    {keyword} = google

    :)

    H
    p.s. if you don't believe me, check your web logs (assuming you pass it back to the landing page)
    p.p.s and I might just have to go back and edit that post to make sure it reads correctly, because I've used the words 'search term' and 'search phrase' and haven't really defined what I mean by them!
    p.p.s sorry for the confusion
    p.p.p.s cheers for reading my blog :)
     
    fastimprovement, Nov 18, 2006 IP
  8. IntelliGuy

    IntelliGuy Banned

    Messages:
    42
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Oh, its your blog, i didnt look at you sig and blog feeds :)

    Quite informative articles there, but i think almost everyone will conclude the same from this blog post. You have given an example with search phrase - google ads - without specifying that we will have to bid on this as a keyword keyword to make the {keyword} an exact match. This leads to confusion. But, now it would mean that it is useful if we have a lot of keyword for the same ad or ad group, or if we dont want to create a different ad for each keyword. Right?
     
    IntelliGuy, Nov 19, 2006 IP
  9. fastimprovement

    fastimprovement Peon

    Messages:
    168
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You know, you're absolutely right there :)

    Seriously though, I appreciate your input because I knew what I was saying at the time and it sounded right to me (in my own head!), but now it's a little ambiguous, isn't it?

    As for different ad text for different sets of keywords, I usually set up an ad group and then run through each keyword (keyword phrase) to make sure it makes sense when using dynamic insertion. If not, I either shove the keyword into a different ad group, or create a different generic text instead of the dynamic insertion, that includes the majority of terms in the keyword (keyword phrase) ...

    ... oh dear, does that sound ambiguous again? ... I wouldn't be surprised as I've had a couple of beers (and a few more besides) this Sunday lunchtime ...

    H
    <hic />
     
    fastimprovement, Nov 19, 2006 IP