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...

 

 

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

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);

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.