Avoid Google keyword detection picking up Firefox ‘aq=’
For those of you who are monitoring or stripping keywords from referrer strings from Google you may be seeking out the query string parameter ‘q=’.
Beware that a simple string match on ‘q=’ could lead you to match on the additional Firefox parameter ‘aq=’. This appears in a Google referrer string if the search terms were originally searched for from the Firefox searchbar.
The aq=t parameter was added by Mozilla in 2006 at the request of Google.
Make sure that any string matching you’re doing is looking for a preceeding ampersand (&) or question mark (?) so that you match the ‘q=’ parameter correctly.
- Share this:
- StumbleUpon
2 Responses to Avoid Google keyword detection picking up Firefox ‘aq=’
Leave a Reply Cancel reply
Tag Cloud
3G adobe agriculture analogy Apple authentication berkovitz BIN Contacts CreatePageURLSegment credit card credit cards developers Episerver Esendex Google iPhone Joost Linux log4net logging luhn Mac maestro Mastercard Microsoft NMock Page PATH payWave Plesk regex RFID security software SQL Server Stored Procedures SugarOS T-SQL TechEd uk validation Visa Windows XCodeCategories
Jbjon
- If anyone from 1989 calls and needs a database reference manual get them in touch with me! #dataease #mandrawer http://t.co/CbnFBuUq
- @KnackeredCoder oh I agree. It all helps. 2nd in the table is a great start. I'd just like wins to be try based,penalty light tussles
- @KnackeredCoder not exactly singing. As they said it was Scotland that lost not England that won.
- That was so close to a try for Scotland. I reckon it was his wrist that stopped that ball rotating but it was nearly his hand. #BBC6nations
- @rhys_isterix I think they're getting back on top of this game. England dented their confidence mid first half.


Good point there Jon. I’ve been using the following snippet to detect these things…
http://tinypaste.com/2247d
// GET AND LOG QUERYSTRING FROM REFERER
if ($_SERVER['HTTP_REFERER']){
$refer = $_SERVER['HTTP_REFERER'];
$referrer_url = $refer;
if (strstr($referrer_url, "google")) {
$sitefrom = "Google";
$ptn = '![?&]q=([^&.]*)!';
} else if (strstr($referrer_url, "yahoo")) {
$sitefrom = "Yahoo";
$ptn = '![?&]p=([^&.]*)!';
} else if (strstr($referrer_url, "msn")) {
$sitefrom = "MSN";
$ptn = '![?&]q=([^&.]*)!';
}
if (preg_match($ptn, $referrer_url, $matches)) {
$qstring = urldecode($matches[1]);
logaction("arrived from " . $sitefrom .", searched for '" . $qstring . "'");
}
}
good tips but can you write more about this so we could follow