Jump to content

Is it possible to pick out the paramters from google and pass them?


kiowa_jackson

Recommended Posts

Google has several parameters when you search, the most interesting being the query

 

http://www.google.com/search?q=pumpkin+pie&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

 

is there a way to capture the value of this at the landing page, if someone clicks through from the organic results? It doesn't look like google passes them on through the organic links, but I've heard you can capture it using javascript...

 

 

Link to comment
Share on other sites

i.e you are trying to track query strings that refer to your site?

 

this is your best idea.

 

1) Get the refer ($_SERVER['HTTP_REFER'])

 

2) If the server is Google process it into mysql

 

3) Explode the REFER at the ? and then explode the second part (the query string at the = signs)

foreach (query string) insert into mysql

 

Then you can track it via mysql.

 

 

Although google usually does this for u

Link to comment
Share on other sites

Best way is

 

<?php
$ref = 'http://www.google.com/search?q=pumpkin+pie&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a';
$query = parse_url($ref, PHP_URL_QUERY);
parse_str($query, $arr);

print_r($arr);

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.