Tracking Keyword From Search Engine-Landing Page-Affiliate

Discussion in 'eBay' started by bsherwood, Jun 2, 2009.

  1. #1
    Hi Everyone,

    I am pretty new at all of this so I hope my question(s) doesn't sound newbish.

    How does one track keywords from a PPC campaign to your landing page and then to the affiliate link?

    Basically, how do I extract from Google/Yahoo/MSN what people are searching for on my landing page and add it to my affiliate subid (e.g &=google).

    Do the major search engines expose what keyword people found your page from the URL (e.g using PHP's $_GET[] variable)?

    Thanks for the help!
     
    bsherwood, Jun 2, 2009 IP
  2. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Depending on the network, you can send keywords with the click. I currently do this with AdWords, MSN and YSM. Unfortuantely, they're all different. On your landing page or site you would need use PHP to parse that out of the referring URL and then populate sid variable to the affiliate site.

    HTH
    hanji
     
    hanji, Jun 2, 2009 IP
  3. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hanji, Jun 2, 2009 IP
  4. bsherwood

    bsherwood Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the reply...I still have a few questions since I haven't quite grasped the concept. I did my best with following your article but my PHP skills are still fuzzy, so I didn't quite get everything.

    1. What GET variable are you taking the keywords from Google/Yahoo/MSN?

    
    <?php
    
    function getKeyword(){
        $keyword                    = '';
        if(isset($_REQUEST['x']) && strlen(trim($_REQUEST['x'])) > 0){
            $keyword                = sanitize($_REQUEST['x']);
        }
        // check yahoo
        if(isset($_REQUEST['OVKEY']) && strlen(trim($_REQUEST['OVKEY'])) > 0){
            $keyword                = sanitize($_REQUEST['OVKEY']);
        }
        return urlencode($keyword);
    ?>
    
    Code (markup):
    Is 'x' in $_REQUEST['x'] Google's keyword variable?

    The example I was thinking of would have been something like this (albeit without sanitizing the data):

    
    <?php
    $keyword = '';
    $keyword = $_GET['name of google variable in URL'];
    
    // Sanitize data and add to <a href="afflink.com/redirect.php?subid=<?php echo $keyword; ?>"</a>
    ?>
    
    Code (markup):
    Thanks for the help!
     
    bsherwood, Jun 2, 2009 IP
  5. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello

    $_REQUEST['x'], is the passed variable in my application. Meaning, if the user comes to the site from YSM, and passing OVKEY, I need to pass that around as they navigate around the site. I could have stored this in the session, etc as another option. Basically, if a keyword is found, it'll add that keyword to x variable on all my links within my site.

    I use $_REQUEST since I have some POST navigation along with GET URLs.

    Thanks!
    hanji
     
    hanji, Jun 2, 2009 IP
  6. bsherwood

    bsherwood Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Sorry, but I am still not following you.

    When I type some random search string in Google, say "Black Ties" (no quotes), the URL looks like:

    http://www.google.com/#hl=en&q=Black+Ties&aq=f&oq=&aqi=g10&=Google+Search&=I%27m+Feeling+Lucky&fp=2Inaafc1UxE
    HTML:
    The important piece of this is 'q=Black+Ties' Since that is the keyword the user searched for.

    My question how do I get my landing page to extract the 'q' variable and store it in another variable?

    Thanks!
     
    bsherwood, Jun 3, 2009 IP
  7. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hello bsherwood

    No problem. The first thing we need to understand, is that there is a difference between a landing page and fully functional web page. My sites are normally store fronts, articles, forums, etc. So when they land on my web page with querystring of one of the search engines, I capture the keyword.. just like how you're doing it. EXACTLY. but I then stuff a local variable to pass around the the other pages, so I can continue to have that variable.. if they go to the forum, or the contact page.. or read a article.

    Your example would totally work. I used $_REQUEST in my example, since if have both GET and POST methods if you navigate my sites. You could totally capture the keyword with $_GET and populate your sid variable to your merchant page.

    Does it seem a little clearer?

    Thanks!
    hanji
     
    hanji, Jun 3, 2009 IP
  8. bsherwood

    bsherwood Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for the help!
     
    bsherwood, Jun 5, 2009 IP
  9. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hanji, Jun 29, 2009 IP